diff --git a/ChangeLog b/ChangeLog index 2fd25234c..0722b57c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,11 @@ [readconf.c] Check listen addresses for null, prevents xfree from dying during ClearAllForwardings (bz #996). From Craig Leres, ok markus@ + - deraadt@cvs.openbsd.org 2005/03/10 22:01:05 + [misc.c ssh-keygen.c servconf.c clientloop.c auth-options.c ssh-add.c + monitor.c sftp-client.c bufaux.h hostfile.c ssh.c sshconnect.c channels.c + readconf.c bufaux.c sftp.c] + spacing 20050313 - (dtucker) [contrib/cygwin/ssh-host-config] Makes the query for the @@ -2338,4 +2343,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3711 2005/03/14 12:02:46 dtucker Exp $ +$Id: ChangeLog,v 1.3712 2005/03/14 12:08:12 dtucker Exp $ diff --git a/auth-options.c b/auth-options.c index 04d12d66e..829c37f1d 100644 --- a/auth-options.c +++ b/auth-options.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-options.c,v 1.29 2005/03/01 10:09:52 djm Exp $"); +RCSID("$OpenBSD: auth-options.c,v 1.30 2005/03/10 22:01:05 deraadt Exp $"); #include "xmalloc.h" #include "match.h" @@ -255,8 +255,8 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum) xfree(patterns); goto bad_option; } - host = cleanhostname(host); - if (p == NULL || (port = a2port(p)) == 0) { + host = cleanhostname(host); + if (p == NULL || (port = a2port(p)) == 0) { debug("%.100s, line %lu: Bad permitopen port " "<%.100s>", file, linenum, p ? p : ""); auth_debug_add("%.100s, line %lu: " diff --git a/bufaux.c b/bufaux.c index 4ea6af1b6..5dbf2b770 100644 --- a/bufaux.c +++ b/bufaux.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.34 2004/12/06 16:00:43 markus Exp $"); +RCSID("$OpenBSD: bufaux.c,v 1.35 2005/03/10 22:01:05 deraadt Exp $"); #include #include "bufaux.h" @@ -179,7 +179,7 @@ buffer_get_bignum2_ret(Buffer *buffer, BIGNUM *value) { u_int len; u_char *bin; - + if ((bin = buffer_get_string_ret(buffer, &len)) == NULL) { error("buffer_get_bignum2_ret: invalid bignum"); return (-1); diff --git a/bufaux.h b/bufaux.h index e30911ddc..f5efaed3e 100644 --- a/bufaux.h +++ b/bufaux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bufaux.h,v 1.20 2004/10/29 23:56:17 djm Exp $ */ +/* $OpenBSD: bufaux.h,v 1.21 2005/03/10 22:01:05 deraadt Exp $ */ /* * Author: Tatu Ylonen @@ -40,7 +40,7 @@ void buffer_put_string(Buffer *, const void *, u_int); void buffer_put_cstring(Buffer *, const char *); #define buffer_skip_string(b) \ - do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while(0) + do { u_int l = buffer_get_int(b); buffer_consume(b, l); } while (0) int buffer_put_bignum_ret(Buffer *, const BIGNUM *); int buffer_get_bignum_ret(Buffer *, BIGNUM *); diff --git a/channels.c b/channels.c index 1be213bce..4bd9af8e6 100644 --- a/channels.c +++ b/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.212 2005/03/01 10:09:52 djm Exp $"); +RCSID("$OpenBSD: channels.c,v 1.213 2005/03/10 22:01:05 deraadt Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1018,7 +1018,7 @@ channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset) debug2("channel %d: only socks5 connect supported", c->self); return -1; } - switch(s5_req.atyp){ + switch (s5_req.atyp){ case SSH_SOCKS5_IPV4: addrlen = 4; af = AF_INET; @@ -2199,11 +2199,11 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por /* * Determine whether or not a port forward listens to loopback, - * specified address or wildcard. On the client, a specified bind - * address will always override gateway_ports. On the server, a - * gateway_ports of 1 (``yes'') will override the client's - * specification and force a wildcard bind, whereas a value of 2 - * (``clientspecified'') will bind to whatever address the client + * specified address or wildcard. On the client, a specified bind + * address will always override gateway_ports. On the server, a + * gateway_ports of 1 (``yes'') will override the client's + * specification and force a wildcard bind, whereas a value of 2 + * (``clientspecified'') will bind to whatever address the client * asked for. * * Special-case listen_addrs are: @@ -2317,7 +2317,7 @@ channel_cancel_rport_listener(const char *host, u_short port) u_int i; int found = 0; - for(i = 0; i < channels_alloc; i++) { + for (i = 0; i < channels_alloc; i++) { Channel *c = channels[i]; if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER && @@ -2629,7 +2629,7 @@ channel_send_window_changes(void) struct winsize ws; for (i = 0; i < channels_alloc; i++) { - if (channels[i] == NULL || !channels[i]->client_tty || + if (channels[i] == NULL || !channels[i]->client_tty || channels[i]->type != SSH_CHANNEL_OPEN) continue; if (ioctl(channels[i]->rfd, TIOCGWINSZ, &ws) < 0) diff --git a/clientloop.c b/clientloop.c index 1e250883f..1591215bd 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.135 2005/03/01 10:09:52 djm Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.136 2005/03/10 22:01:05 deraadt Exp $"); #include "ssh.h" #include "ssh1.h" @@ -627,7 +627,7 @@ client_process_control(fd_set * readset) "to %s? ", host); if (allowed) quit_pending = 1; - /* FALLTHROUGH */ + /* FALLTHROUGH */ case SSHMUX_COMMAND_ALIVE_CHECK: /* Reply for SSHMUX_COMMAND_TERMINATE and ALIVE_CHECK */ buffer_clear(&m); diff --git a/hostfile.c b/hostfile.c index 2e1c8bcd0..bf2a31c9b 100644 --- a/hostfile.c +++ b/hostfile.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.33 2005/03/01 10:40:26 djm Exp $"); +RCSID("$OpenBSD: hostfile.c,v 1.34 2005/03/10 22:01:05 deraadt Exp $"); #include #include @@ -92,7 +92,7 @@ extract_salt(const char *s, u_int l, char *salt, size_t salt_len) salt_len, ret); return (-1); } - + return (0); } @@ -123,7 +123,7 @@ host_hash(const char *host, const char *name_from_hostfile, u_int src_len) HMAC_Final(&mac_ctx, result, NULL); HMAC_cleanup(&mac_ctx); - if (__b64_ntop(salt, len, uu_salt, sizeof(uu_salt)) == -1 || + if (__b64_ntop(salt, len, uu_salt, sizeof(uu_salt)) == -1 || __b64_ntop(result, len, uu_result, sizeof(uu_result)) == -1) fatal("host_hash: __b64_ntop failed"); @@ -310,7 +310,7 @@ lookup_key_in_hostfile_by_type(const char *filename, const char *host, */ int -add_host_to_hostfile(const char *filename, const char *host, const Key *key, +add_host_to_hostfile(const char *filename, const char *host, const Key *key, int store_hash) { FILE *f; diff --git a/misc.c b/misc.c index 2e366f81b..7adbcea1c 100644 --- a/misc.c +++ b/misc.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: misc.c,v 1.28 2005/03/01 10:09:52 djm Exp $"); +RCSID("$OpenBSD: misc.c,v 1.29 2005/03/10 22:01:05 deraadt Exp $"); #include "misc.h" #include "log.h" @@ -303,13 +303,13 @@ hpdelim(char **cp) case '\0': *cp = NULL; /* no more fields*/ break; - + case ':': case '/': *s = '\0'; /* terminate */ *cp = s + 1; break; - + default: return NULL; } @@ -391,7 +391,7 @@ read_keyfile_line(FILE *f, const char *filename, char *buf, size_t bufsz, debug("%s: %s line %lu exceeds size limit", __func__, filename, *lineno); /* discard remainder of line */ - while(fgetc(f) != '\n' && !feof(f)) + while (fgetc(f) != '\n' && !feof(f)) ; /* nothing */ } } diff --git a/monitor.c b/monitor.c index 301e150b3..4dc11a275 100644 --- a/monitor.c +++ b/monitor.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.62 2005/01/30 11:18:08 dtucker Exp $"); +RCSID("$OpenBSD: monitor.c,v 1.63 2005/03/10 22:01:05 deraadt Exp $"); #include @@ -976,7 +976,7 @@ mm_answer_keyallowed(int sock, Buffer *m) debug3("%s: key_from_blob: %p", __func__, key); if (key != NULL && authctxt->valid) { - switch(type) { + switch (type) { case MM_USERKEY: allowed = options.pubkey_authentication && user_key_allowed(authctxt->pw, key); diff --git a/readconf.c b/readconf.c index f35fe5647..8ace1bbd4 100644 --- a/readconf.c +++ b/readconf.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.138 2005/03/10 10:15:02 dtucker Exp $"); +RCSID("$OpenBSD: readconf.c,v 1.139 2005/03/10 22:01:05 deraadt Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -301,7 +301,7 @@ process_config_line(Options *options, const char *host, Forward fwd; /* Strip trailing whitespace */ - for(len = strlen(line) - 1; len > 0; len--) { + for (len = strlen(line) - 1; len > 0; len--) { if (strchr(WHITESPACE, line[len]) == NULL) break; line[len] = '\0'; diff --git a/servconf.c b/servconf.c index 2d1a0c362..96ad18084 100644 --- a/servconf.c +++ b/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.139 2005/03/01 10:09:52 djm Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.140 2005/03/10 22:01:05 deraadt Exp $"); #include "ssh.h" #include "log.h" @@ -1001,7 +1001,7 @@ parse_server_config(ServerOptions *options, const char *filename, Buffer *conf) obuf = cbuf = xstrdup(buffer_ptr(conf)); linenum = 1; - while((cp = strsep(&cbuf, "\n")) != NULL) { + while ((cp = strsep(&cbuf, "\n")) != NULL) { if (process_server_config_line(options, cp, filename, linenum++) != 0) bad_options++; diff --git a/sftp-client.c b/sftp-client.c index d894a11f2..92df42751 100644 --- a/sftp-client.c +++ b/sftp-client.c @@ -20,7 +20,7 @@ /* XXX: copy between two remote sites */ #include "includes.h" -RCSID("$OpenBSD: sftp-client.c,v 1.52 2004/11/25 22:22:14 markus Exp $"); +RCSID("$OpenBSD: sftp-client.c,v 1.53 2005/03/10 22:01:05 deraadt Exp $"); #include "openbsd-compat/sys-queue.h" @@ -856,7 +856,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path, debug3("Received reply T:%u I:%u R:%d", type, id, max_req); /* Find the request in our queue */ - for(req = TAILQ_FIRST(&requests); + for (req = TAILQ_FIRST(&requests); req != NULL && req->id != id; req = TAILQ_NEXT(req, tq)) ; @@ -1109,7 +1109,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, debug3("SSH2_FXP_STATUS %d", status); /* Find the request in our queue */ - for(ack = TAILQ_FIRST(&acks); + for (ack = TAILQ_FIRST(&acks); ack != NULL && ack->id != r_id; ack = TAILQ_NEXT(ack, tq)) ; diff --git a/sftp.c b/sftp.c index f8553ed82..16a6cf0c6 100644 --- a/sftp.c +++ b/sftp.c @@ -16,7 +16,7 @@ #include "includes.h" -RCSID("$OpenBSD: sftp.c,v 1.62 2005/02/20 22:59:06 djm Exp $"); +RCSID("$OpenBSD: sftp.c,v 1.63 2005/03/10 22:01:05 deraadt Exp $"); #ifdef USE_LIBEDIT #include @@ -357,7 +357,7 @@ parse_ls_flags(const char **cpp, int *lflag) /* Check for flags */ if (cp++[0] == '-') { - for(; strchr(WHITESPACE, *cp) == NULL; cp++) { + for (; strchr(WHITESPACE, *cp) == NULL; cp++) { switch (*cp) { case 'l': *lflag &= ~VIEW_FLAGS; diff --git a/ssh-add.c b/ssh-add.c index 06a52464e..a796647a7 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.70 2004/05/08 00:21:31 djm Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.71 2005/03/10 22:01:06 deraadt Exp $"); #include @@ -389,7 +389,7 @@ main(int argc, char **argv) goto done; } - for(i = 0; default_files[i]; i++) { + for (i = 0; default_files[i]; i++) { snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, default_files[i]); if (stat(buf, &st) < 0) @@ -402,7 +402,7 @@ main(int argc, char **argv) if (count == 0) ret = 1; } else { - for(i = 0; i < argc; i++) { + for (i = 0; i < argc; i++) { if (do_file(ac, deleting, argv[i]) == -1) ret = 1; } diff --git a/ssh-keygen.c b/ssh-keygen.c index a9931d4d8..b38e9c9c4 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.120 2005/03/02 01:27:41 djm Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.121 2005/03/10 22:01:06 deraadt Exp $"); #include #include @@ -684,7 +684,7 @@ do_known_hosts(struct passwd *pw, const char *name) if (delete_host && !c) print_host(out, cp, public, 0); } else if (hash_hosts) { - for(cp2 = strsep(&cp, ","); + for (cp2 = strsep(&cp, ","); cp2 != NULL && *cp2 != '\0'; cp2 = strsep(&cp, ",")) { if (strcspn(cp2, "*?!") != strlen(cp2)) diff --git a/ssh.c b/ssh.c index 9acec3082..1f025c784 100644 --- a/ssh.c +++ b/ssh.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.233 2005/03/01 17:22:06 jmc Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.234 2005/03/10 22:01:06 deraadt Exp $"); #include #include @@ -856,8 +856,8 @@ ssh_init_forwarding(void) for (i = 0; i < options.num_local_forwards; i++) { debug("Local connections to %.200s:%d forwarded to remote " "address %.200s:%d", - (options.local_forwards[i].listen_host == NULL) ? - (options.gateway_ports ? "*" : "LOCALHOST") : + (options.local_forwards[i].listen_host == NULL) ? + (options.gateway_ports ? "*" : "LOCALHOST") : options.local_forwards[i].listen_host, options.local_forwards[i].listen_port, options.local_forwards[i].connect_host, @@ -1343,7 +1343,7 @@ control_client(const char *path) switch (mux_command) { case SSHMUX_COMMAND_ALIVE_CHECK: - fprintf(stderr, "Master running (pid=%d)\r\n", + fprintf(stderr, "Master running (pid=%d)\r\n", control_server_pid); exit(0); case SSHMUX_COMMAND_TERMINATE: diff --git a/sshconnect.c b/sshconnect.c index 49190560d..07703cf77 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.161 2005/03/02 01:00:06 djm Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.162 2005/03/10 22:01:06 deraadt Exp $"); #include @@ -247,13 +247,13 @@ timeout_connect(int sockfd, const struct sockaddr *serv_addr, tv.tv_sec = timeout; tv.tv_usec = 0; - for(;;) { + for (;;) { rc = select(sockfd + 1, NULL, fdset, NULL, &tv); if (rc != -1 || errno != EINTR) break; } - switch(rc) { + switch (rc) { case 0: /* Timed out */ errno = ETIMEDOUT;