diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | session.c | 5 |
2 files changed, 8 insertions, 0 deletions
@@ -4,6 +4,9 @@ | |||
4 | des.no | 4 | des.no |
5 | - (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] | 5 | - (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] |
6 | Add a usleep replacement for platforms that lack it; ok dtucker | 6 | Add a usleep replacement for platforms that lack it; ok dtucker |
7 | - (djm) [session.c] FreeBSD needs setusercontext(..., LOGIN_SETUMASK) to | ||
8 | occur after UID switch; patch from John Marshall via des AT des.no; | ||
9 | ok dtucker@ | ||
7 | 10 | ||
8 | 20120312 | 11 | 20120312 |
9 | - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] | 12 | - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] |
@@ -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); |