summaryrefslogtreecommitdiff
path: root/debian/patches/selinux-fix-chroot-directory.patch
blob: a69ded59bf87c4285ac261f0623612fd61be79b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index: b/session.c
===================================================================
--- a/session.c
+++ b/session.c
@@ -1522,6 +1522,10 @@
 # endif /* USE_LIBIAF */
 #endif
 
+#ifdef WITH_SELINUX
+		ssh_selinux_setup_exec_context(pw->pw_name);
+#endif
+
 		if (options.chroot_directory != NULL &&
 		    strcasecmp(options.chroot_directory, "none") != 0) {
                         tmp = tilde_expand_filename(options.chroot_directory,
@@ -1550,10 +1554,6 @@
 
 	if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
 		fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
-
-#ifdef WITH_SELINUX
-	ssh_selinux_setup_exec_context(pw->pw_name);
-#endif
 }
 
 static void