Do not set user context too many times for root logins (#1269072)

This commit is contained in:
Jakub Jelen 2015-11-04 10:17:32 +01:00
parent fa54d5472d
commit b6d4dc0a6f
1 changed files with 13 additions and 0 deletions

View File

@ -132,3 +132,16 @@ index 07f9926..a97f8b7 100644
#else
if (authctxt->pw->pw_uid == 0 || options.use_login) {
#endif
diff --git a/session.c b/session.c
index 684f867..09048bc 100644
--- a/session.c
+++ b/session.c
@@ -1538,7 +1538,7 @@ do_setusercontext(struct passwd *pw)
platform_setusercontext(pw);
- if (platform_privileged_uidswap()) {
+ if (platform_privileged_uidswap() && !is_child) {
#ifdef HAVE_LOGIN_CAP
if (setusercontext(lc, pw, pw->pw_uid,
(LOGIN_SETALL & ~(LOGIN_SETPATH|LOGIN_SETUSER))) < 0) {