diff options
author | Damien Miller <djm@mindrot.org> | 2013-03-15 11:22:37 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-03-15 11:22:37 +1100 |
commit | 585284019020eccaf0ce744df198bd56b6aa109f (patch) | |
tree | 7756a5cb2b679af3477af2e399b740f03cd2020b /session.c | |
parent | f4db77d7668104c1237636781cfbd59ef30f79b0 (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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |