diff options
author | Darren Tucker <dtucker@zip.com.au> | 2008-03-27 07:27:20 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2008-03-27 07:27:20 +1100 |
commit | b8eb586412f338dcee69639ae375d5f72e26a094 (patch) | |
tree | 01aae213b6980e733522d5c1fa235519aaf82649 /session.c | |
parent | a19390067474ab3a8ad806dbf551fd84164e78a4 (diff) |
- (dtucker) Cache selinux status earlier so we know if it's enabled after a
chroot. Allows ChrootDirectory to work with selinux support compiled in
but not enabled. Using it with selinux enabled will require some selinux
support inside the chroot. "looks sane" djm@
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1345,6 +1345,11 @@ do_setusercontext(struct passwd *pw) | |||
1345 | { | 1345 | { |
1346 | char *chroot_path, *tmp; | 1346 | char *chroot_path, *tmp; |
1347 | 1347 | ||
1348 | #ifdef WITH_SELINUX | ||
1349 | /* Cache selinux status for later use */ | ||
1350 | (void)ssh_selinux_enabled(); | ||
1351 | #endif | ||
1352 | |||
1348 | #ifndef HAVE_CYGWIN | 1353 | #ifndef HAVE_CYGWIN |
1349 | if (getuid() == 0 || geteuid() == 0) | 1354 | if (getuid() == 0 || geteuid() == 0) |
1350 | #endif /* HAVE_CYGWIN */ | 1355 | #endif /* HAVE_CYGWIN */ |