]> andersk Git - openssh.git/commitdiff
- deraadt@cvs.openbsd.org 2006/03/19 18:56:41
authordjm <djm>
Sun, 26 Mar 2006 02:59:20 +0000 (02:59 +0000)
committerdjm <djm>
Sun, 26 Mar 2006 02:59:20 +0000 (02:59 +0000)
     [clientloop.c progressmeter.c serverloop.c sshd.c]
     ARGSUSED for signal handlers

ChangeLog
clientloop.c
progressmeter.c
serverloop.c
sshd.c

index 1f9a714d09ede563260feef619bfd0575c14f5f9..a25dff96aa7fa3fcf3133a48a661c04eeb10e870 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -43,6 +43,9 @@
    - deraadt@cvs.openbsd.org 2006/03/19 18:53:12
      [kex.c kex.h monitor.c myproposal.h session.c]
      spacing
+   - deraadt@cvs.openbsd.org 2006/03/19 18:56:41
+     [clientloop.c progressmeter.c serverloop.c sshd.c]
+     ARGSUSED for signal handlers
 
 20060325
  - OpenBSD CVS Sync
index 6d58a5afbc8ac25ce9e2076ec7499bb7ba302377..d321cb8bf2d67d262ece86049405c436abf7fe23 100644 (file)
@@ -190,7 +190,7 @@ enter_non_blocking(void)
  * Signal handler for the window change signal (SIGWINCH).  This just sets a
  * flag indicating that the window has changed.
  */
-
+/*ARGSUSED */
 static void
 window_change_handler(int sig)
 {
@@ -202,7 +202,7 @@ window_change_handler(int sig)
  * Signal handler for signals that cause the program to terminate.  These
  * signals must be trapped to restore terminal modes.
  */
-
+/*ARGSUSED */
 static void
 signal_handler(int sig)
 {
index 26b34a3e9de93c9c09986e149d23855dcbb03288..ff99acf715b4dd093572940e03b8c83ee9767d8d 100644 (file)
@@ -272,6 +272,7 @@ stop_progress_meter(void)
        atomicio(vwrite, STDOUT_FILENO, "\n", 1);
 }
 
+/*ARGSUSED*/
 static void
 sig_winch(int sig)
 {
index 3efe7d80b24a1c894a4f8530dea29f907b790800..816215e05bfcda57612290aaabd7cc2846d2326c 100644 (file)
@@ -147,6 +147,7 @@ notify_done(fd_set *readset)
                        debug2("notify_done: reading");
 }
 
+/*ARGSUSED*/
 static void
 sigchld_handler(int sig)
 {
@@ -159,6 +160,7 @@ sigchld_handler(int sig)
        errno = save_errno;
 }
 
+/*ARGSUSED*/
 static void
 sigterm_handler(int sig)
 {
@@ -942,7 +944,7 @@ server_request_tun(void)
 
        tun = packet_get_int();
        if (forced_tun_device != -1) {
-               if (tun != SSH_TUNID_ANY && forced_tun_device != tun)
+               if (tun != SSH_TUNID_ANY && forced_tun_device != tun)
                        goto done;
                tun = forced_tun_device;
        }
diff --git a/sshd.c b/sshd.c
index e6b1f5496656aa94d4204f32a693d014be5f24b7..cfd38906edd528d2df8965fce5163c625120627c 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -257,6 +257,8 @@ close_startup_pipes(void)
  * the effect is to reread the configuration file (and to regenerate
  * the server key).
  */
+
+/*ARGSUSED*/
 static void
 sighup_handler(int sig)
 {
@@ -271,6 +273,7 @@ sighup_handler(int sig)
  * Called from the main program after receiving SIGHUP.
  * Restarts the server.
  */
+/*ARGSUSED*/
 static void
 sighup_restart(void)
 {
@@ -286,6 +289,7 @@ sighup_restart(void)
 /*
  * Generic signal handler for terminating signals in the master daemon.
  */
+/*ARGSUSED*/
 static void
 sigterm_handler(int sig)
 {
@@ -296,6 +300,7 @@ sigterm_handler(int sig)
  * SIGCHLD handler.  This is called whenever a child dies.  This will then
  * reap any zombies left by exited children.
  */
+/*ARGSUSED*/
 static void
 main_sigchld_handler(int sig)
 {
@@ -314,6 +319,7 @@ main_sigchld_handler(int sig)
 /*
  * Signal handler for the alarm after the login grace period has expired.
  */
+/*ARGSUSED*/
 static void
 grace_alarm_handler(int sig)
 {
@@ -356,6 +362,7 @@ generate_ephemeral_server_key(void)
        arc4random_stir();
 }
 
+/*ARGSUSED*/
 static void
 key_regeneration_alarm(int sig)
 {
@@ -976,7 +983,8 @@ main(int ac, char **av)
                        options.log_level = SYSLOG_LEVEL_QUIET;
                        break;
                case 'b':
-                       options.server_key_bits = atoi(optarg);
+                       options.server_key_bits = (int)strtonum(optarg, 256,
+                           32768, NULL);
                        break;
                case 'p':
                        options.ports_from_cmdline = 1;
@@ -1013,7 +1021,7 @@ main(int ac, char **av)
                        test_flag = 1;
                        break;
                case 'u':
-                       utmp_len = atoi(optarg);
+                       utmp_len = (u_int)strtonum(optarg, 0, MAXHOSTNAMELEN+1, NULL);
                        if (utmp_len > MAXHOSTNAMELEN) {
                                fprintf(stderr, "Invalid utmp length.\n");
                                exit(1);
@@ -1169,10 +1177,9 @@ main(int ac, char **av)
        }
 
        if (use_privsep) {
-               struct passwd *pw;
                struct stat st;
 
-               if ((pw = getpwnam(SSH_PRIVSEP_USER)) == NULL)
+               if (getpwnam(SSH_PRIVSEP_USER) == NULL)
                        fatal("Privilege separation user %s does not exist",
                            SSH_PRIVSEP_USER);
                if ((stat(_PATH_PRIVSEP_CHROOT_DIR, &st) == -1) ||
@@ -1444,8 +1451,8 @@ main(int ac, char **av)
                                if (!FD_ISSET(listen_socks[i], fdset))
                                        continue;
                                fromlen = sizeof(from);
-                               newsock = accept(listen_socks[i], (struct sockaddr *)&from,
-                                   &fromlen);
+                               newsock = accept(listen_socks[i],
+                                   (struct sockaddr *)&from, &fromlen);
                                if (newsock < 0) {
                                        if (errno != EINTR && errno != EWOULDBLOCK)
                                                error("accept: %.100s", strerror(errno));
@@ -1516,10 +1523,11 @@ main(int ac, char **av)
                                         */
                                        if ((pid = fork()) == 0) {
                                                /*
-                                                * Child.  Close the listening and max_startup
-                                                * sockets.  Start using the accepted socket.
-                                                * Reinitialize logging (since our pid has
-                                                * changed).  We break out of the loop to handle
+                                                * Child.  Close the listening and
+                                                * max_startup sockets.  Start using
+                                                * the accepted socket. Reinitialize
+                                                * logging (since our pid has changed).
+                                                * We break out of the loop to handle
                                                 * the connection.
                                                 */
                                                startup_pipe = startup_p[1];
@@ -1527,7 +1535,10 @@ main(int ac, char **av)
                                                close_listen_socks();
                                                sock_in = newsock;
                                                sock_out = newsock;
-                                               log_init(__progname, options.log_level, options.log_facility, log_stderr);
+                                               log_init(__progname,
+                                                   options.log_level,
+                                                   options.log_facility,
+                                                   log_stderr);
                                                if (rexec_flag)
                                                        close(config_s[0]);
                                                break;
@@ -1548,7 +1559,10 @@ main(int ac, char **av)
                                        close(config_s[1]);
                                }
 
-                               /* Mark that the key has been used (it was "given" to the child). */
+                               /*
+                                * Mark that the key has been used (it
+                                * was "given" to the child).
+                                */
                                if ((options.protocol & SSH_PROTO_1) &&
                                    key_used == 0) {
                                        /* Schedule server key regeneration alarm. */
@@ -1558,8 +1572,6 @@ main(int ac, char **av)
                                }
 
                                arc4random_stir();
-
-                               /* Close the new socket (the child is now taking care of it). */
                                close(newsock);
                        }
                        /* child process check (or debug mode) */
@@ -1794,11 +1806,14 @@ ssh1_session_key(BIGNUM *session_key_int)
 {
        int rsafail = 0;
 
-       if (BN_cmp(sensitive_data.server_key->rsa->n, sensitive_data.ssh1_host_key->rsa->n) > 0) {
+       if (BN_cmp(sensitive_data.server_key->rsa->n,
+           sensitive_data.ssh1_host_key->rsa->n) > 0) {
                /* Server key has bigger modulus. */
                if (BN_num_bits(sensitive_data.server_key->rsa->n) <
-                   BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) + SSH_KEY_BITS_RESERVED) {
-                       fatal("do_connection: %s: server_key %d < host_key %d + SSH_KEY_BITS_RESERVED %d",
+                   BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) +
+                   SSH_KEY_BITS_RESERVED) {
+                       fatal("do_connection: %s: "
+                           "server_key %d < host_key %d + SSH_KEY_BITS_RESERVED %d",
                            get_remote_ipaddr(),
                            BN_num_bits(sensitive_data.server_key->rsa->n),
                            BN_num_bits(sensitive_data.ssh1_host_key->rsa->n),
@@ -1813,8 +1828,10 @@ ssh1_session_key(BIGNUM *session_key_int)
        } else {
                /* Host key has bigger modulus (or they are equal). */
                if (BN_num_bits(sensitive_data.ssh1_host_key->rsa->n) <
-                   BN_num_bits(sensitive_data.server_key->rsa->n) + SSH_KEY_BITS_RESERVED) {
-                       fatal("do_connection: %s: host_key %d < server_key %d + SSH_KEY_BITS_RESERVED %d",
+                   BN_num_bits(sensitive_data.server_key->rsa->n) +
+                   SSH_KEY_BITS_RESERVED) {
+                       fatal("do_connection: %s: "
+                           "host_key %d < server_key %d + SSH_KEY_BITS_RESERVED %d",
                            get_remote_ipaddr(),
                            BN_num_bits(sensitive_data.ssh1_host_key->rsa->n),
                            BN_num_bits(sensitive_data.server_key->rsa->n),
@@ -2035,7 +2052,7 @@ do_ssh2_kex(void)
                myproposal[PROPOSAL_COMP_ALGS_CTOS] =
                myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib@openssh.com";
        }
-       
+
        myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = list_hostkey_types();
 
        /* start key exchange */
This page took 0.677579 seconds and 5 git commands to generate.