summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/session.c')
-rw-r--r--crypto/openssh/session.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 57a3e18..82913ff 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -1533,6 +1533,12 @@ do_setusercontext(struct passwd *pw)
perror("unable to set user context (setuser)");
exit(1);
}
+
+ /*
+ * FreeBSD's setusercontext() will not apply the user's
+ * own umask setting unless running with the user's UID.
+ */
+ setusercontext(lc, pw, pw->pw_uid, LOGIN_SETUMASK);
#else
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
OpenPOWER on IntegriCloud