summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--session.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f6fc7058..f9f2166b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
820120312 1120120312
9 - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] 12 - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh]
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);