]> andersk Git - openssh.git/blobdiff - sshd.c
- markus@cvs.openbsd.org 2002/05/13 20:44:58
[openssh.git] / sshd.c
diff --git a/sshd.c b/sshd.c
index f3e4d835e7f96709bfadc9df5305b151c558267c..589a1160d36182ba87480bde5690cdc77511cbf2 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1005,6 +1005,16 @@ main(int ac, char **av)
        if (test_flag)
                exit(0);
 
+       /*
+        * Clear out any supplemental groups we may have inherited.  This
+        * prevents inadvertent creation of files with bad modes (in the
+        * portable version at least, it's certainly possible for PAM 
+        * to create a file, and we can't control the code in every 
+        * module which might be used).
+        */
+       if (setgroups(0, NULL) < 0)
+               debug("setgroups() failed: %.200s", strerror(errno));
+
        /* Initialize the log (it is reinitialized below in case we forked). */
        if (debug_flag && !inetd_flag)
                log_stderr = 1;
This page took 0.03463 seconds and 4 git commands to generate.