summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-03-15 11:22:37 +1100
committerDamien Miller <djm@mindrot.org>2013-03-15 11:22:37 +1100
commit585284019020eccaf0ce744df198bd56b6aa109f (patch)
tree7756a5cb2b679af3477af2e399b740f03cd2020b /session.c
parentf4db77d7668104c1237636781cfbd59ef30f79b0 (diff)
- (djm) [session.c] FreeBSD needs setusercontext(..., LOGIN_SETUMASK) to
occur after UID switch; patch from John Marshall via des AT des.no; ok dtucker@
Diffstat (limited to 'session.c')
-rw-r--r--session.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/session.c b/session.c
index 643e7fc59..19eaa20c3 100644
--- a/session.c
+++ b/session.c
@@ -1520,6 +1520,11 @@ do_setusercontext(struct passwd *pw)
1520 perror("unable to set user context (setuser)"); 1520 perror("unable to set user context (setuser)");
1521 exit(1); 1521 exit(1);
1522 } 1522 }
1523 /*
1524 * FreeBSD's setusercontext() will not apply the user's
1525 * own umask setting unless running with the user's UID.
1526 */
1527 (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK);
1523#else 1528#else
1524 /* Permanently switch to the desired uid. */ 1529 /* Permanently switch to the desired uid. */
1525 permanently_set_uid(pw); 1530 permanently_set_uid(pw);