]> andersk Git - openssh.git/blobdiff - sshd.c
- (djm) Always use mysignal() for SIGALRM
[openssh.git] / sshd.c
diff --git a/sshd.c b/sshd.c
index 65837c938fea8828ecfbd9382f2d095d6a948529..bc458488be0835dea20cba9e85134c193187348e 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.265 2003/04/14 14:17:50 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.268 2003/06/04 10:23:48 djm Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -564,8 +564,6 @@ privsep_preauth_child(void)
        do_setusercontext(pw);
 #else
        gidset[0] = pw->pw_gid;
-       if (setgid(pw->pw_gid) < 0)
-               fatal("setgid failed for %u", pw->pw_gid );
        if (setgroups(1, gidset) < 0)
                fatal("setgroups: %.100s", strerror(errno));
        permanently_set_uid(pw);
@@ -825,7 +823,6 @@ main(int ac, char **av)
 
        /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
        saved_argc = ac;
-       saved_argv = av;
        saved_argv = xmalloc(sizeof(*saved_argv) * (ac + 1));
        for (i = 0; i < ac; i++)
                saved_argv[i] = xstrdup(av[i]);
@@ -834,6 +831,7 @@ main(int ac, char **av)
 #ifndef HAVE_SETPROCTITLE
        /* Prepare for later setproctitle emulation */
        compat_init_setproctitle(ac, av);
+       av = saved_argv;
 #endif
 
        /* Initialize configuration options to their default values. */
@@ -1375,7 +1373,7 @@ main(int ac, char **av)
                                if ((options.protocol & SSH_PROTO_1) &&
                                    key_used == 0) {
                                        /* Schedule server key regeneration alarm. */
-                                       signal(SIGALRM, key_regeneration_alarm);
+                                       mysignal(SIGALRM, key_regeneration_alarm);
                                        alarm(options.key_regeneration_time);
                                        key_used = 1;
                                }
@@ -1464,7 +1462,7 @@ main(int ac, char **av)
         * mode; it is just annoying to have the server exit just when you
         * are about to discover the bug.
         */
-       signal(SIGALRM, grace_alarm_handler);
+       mysignal(SIGALRM, grace_alarm_handler);
        if (!debug_flag)
                alarm(options.login_grace_time);
 
This page took 0.089364 seconds and 4 git commands to generate.