[authfd.c channels.c dh.c log.c readconf.c servconf.c sftp-int.c
      ssh.c sshconnect.c sshd.c]
     log functions should not be passed strings that end in newline as they
     get passed on to syslog() and when logging to stderr, do_log() appends
     its own newline.
This commit is contained in:
Ben Lindstrom 2001-03-05 07:47:23 +00:00
parent fafea18d68
commit 6df8ef4196
11 changed files with 42 additions and 36 deletions

View File

@ -159,6 +159,12 @@
- stevesk@cvs.openbsd.org 2001/03/04 12:54:04 - stevesk@cvs.openbsd.org 2001/03/04 12:54:04
[sshd.8] [sshd.8]
spelling spelling
- millert@cvs.openbsd.org 2001/03/04 17:42:28
[authfd.c channels.c dh.c log.c readconf.c servconf.c sftp-int.c
ssh.c sshconnect.c sshd.c]
log functions should not be passed strings that end in newline as they
get passed on to syslog() and when logging to stderr, do_log() appends
its own newline.
20010304 20010304
- (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid.
@ -4351,4 +4357,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.901 2001/03/05 07:43:27 mouring Exp $ $Id: ChangeLog,v 1.902 2001/03/05 07:47:23 mouring Exp $

View File

@ -35,7 +35,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: authfd.c,v 1.36 2001/03/01 02:11:25 deraadt Exp $"); RCSID("$OpenBSD: authfd.c,v 1.37 2001/03/04 17:42:27 millert Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
@ -254,7 +254,7 @@ ssh_get_num_identities(AuthenticationConnection *auth, int version)
/* Get the number of entries in the response and check it for sanity. */ /* Get the number of entries in the response and check it for sanity. */
auth->howmany = buffer_get_int(&auth->identities); auth->howmany = buffer_get_int(&auth->identities);
if (auth->howmany > 1024) if (auth->howmany > 1024)
fatal("Too many identities in authentication reply: %d\n", fatal("Too many identities in authentication reply: %d",
auth->howmany); auth->howmany);
return auth->howmany; return auth->howmany;

View File

@ -40,7 +40,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: channels.c,v 1.97 2001/03/04 00:03:59 markus Exp $"); RCSID("$OpenBSD: channels.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
#include <openssl/rsa.h> #include <openssl/rsa.h>
#include <openssl/dsa.h> #include <openssl/dsa.h>
@ -521,7 +521,7 @@ channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset)
* We have received an X11 connection that has bad * We have received an X11 connection that has bad
* authentication information. * authentication information.
*/ */
log("X11 connection rejected because of wrong authentication.\r\n"); log("X11 connection rejected because of wrong authentication.");
buffer_clear(&c->input); buffer_clear(&c->input);
buffer_clear(&c->output); buffer_clear(&c->output);
close(c->sock); close(c->sock);

4
dh.c
View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: dh.c,v 1.6 2001/01/21 19:05:49 markus Exp $"); RCSID("$OpenBSD: dh.c,v 1.7 2001/03/04 17:42:28 millert Exp $");
#include "xmalloc.h" #include "xmalloc.h"
@ -90,7 +90,7 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg)
return (1); return (1);
fail: fail:
error("Bad prime description in line %d\n", linenum); error("Bad prime description in line %d", linenum);
return (0); return (0);
} }

6
log.c
View File

@ -34,7 +34,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: log.c,v 1.17 2001/03/04 17:42:28 millert Exp $"); RCSID("$OpenBSD: log.c,v 1.16 2001/03/03 23:59:34 markus Exp $");
#include "log.h" #include "log.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -265,7 +265,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
log_level = level; log_level = level;
break; break;
default: default:
fprintf(stderr, "Unrecognized internal syslog level code %d\n", fprintf(stderr, "Unrecognized internal syslog level code %d",
(int) level); (int) level);
exit(1); exit(1);
} }
@ -315,7 +315,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
break; break;
default: default:
fprintf(stderr, fprintf(stderr,
"Unrecognized internal syslog facility code %d\n", "Unrecognized internal syslog facility code %d",
(int) facility); (int) facility);
exit(1); exit(1);
} }

View File

@ -12,7 +12,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: readconf.c,v 1.63 2001/02/24 10:37:55 deraadt Exp $"); RCSID("$OpenBSD: readconf.c,v 1.64 2001/03/04 17:42:28 millert Exp $");
#include "ssh.h" #include "ssh.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -187,7 +187,7 @@ add_local_forward(Options *options, u_short port, const char *host,
#ifndef HAVE_CYGWIN #ifndef HAVE_CYGWIN
extern uid_t original_real_uid; extern uid_t original_real_uid;
if (port < IPPORT_RESERVED && original_real_uid != 0) if (port < IPPORT_RESERVED && original_real_uid != 0)
fatal("Privileged ports can only be forwarded by root.\n"); fatal("Privileged ports can only be forwarded by root.");
#endif #endif
if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION); fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION);
@ -534,7 +534,7 @@ parse_int:
arg = strdelim(&s); arg = strdelim(&s);
value = log_level_number(arg); value = log_level_number(arg);
if (value == (LogLevel) - 1) if (value == (LogLevel) - 1)
fatal("%.200s line %d: unsupported log level '%s'\n", fatal("%.200s line %d: unsupported log level '%s'",
filename, linenum, arg ? arg : "<NONE>"); filename, linenum, arg ? arg : "<NONE>");
if (*activep && (LogLevel) * intptr == -1) if (*activep && (LogLevel) * intptr == -1)
*intptr = (LogLevel) value; *intptr = (LogLevel) value;
@ -659,7 +659,7 @@ read_config_file(const char *filename, const char *host, Options *options)
} }
fclose(f); fclose(f);
if (bad_options > 0) if (bad_options > 0)
fatal("%s: terminating, %d bad configuration options\n", fatal("%s: terminating, %d bad configuration options",
filename, bad_options); filename, bad_options);
} }

View File

@ -10,7 +10,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: servconf.c,v 1.69 2001/03/04 11:16:06 stevesk Exp $"); RCSID("$OpenBSD: servconf.c,v 1.70 2001/03/04 17:42:28 millert Exp $");
#ifdef KRB4 #ifdef KRB4
#include <krb.h> #include <krb.h>
@ -318,7 +318,7 @@ add_listen_addr(ServerOptions *options, char *addr)
hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0;
snprintf(strport, sizeof strport, "%d", options->ports[i]); snprintf(strport, sizeof strport, "%d", options->ports[i]);
if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0)
fatal("bad addr or host: %s (%s)\n", fatal("bad addr or host: %s (%s)",
addr ? addr : "<NULL>", addr ? addr : "<NULL>",
gai_strerror(gaierr)); gai_strerror(gaierr));
for (ai = aitop; ai->ai_next; ai = ai->ai_next) for (ai = aitop; ai->ai_next; ai = ai->ai_next)
@ -371,11 +371,11 @@ read_server_config(ServerOptions *options, const char *filename)
fatal("%s line %d: ports must be specified before " fatal("%s line %d: ports must be specified before "
"ListenAdress.\n", filename, linenum); "ListenAdress.\n", filename, linenum);
if (options->num_ports >= MAX_PORTS) if (options->num_ports >= MAX_PORTS)
fatal("%s line %d: too many ports.\n", fatal("%s line %d: too many ports.",
filename, linenum); filename, linenum);
arg = strdelim(&cp); arg = strdelim(&cp);
if (!arg || *arg == '\0') if (!arg || *arg == '\0')
fatal("%s line %d: missing port number.\n", fatal("%s line %d: missing port number.",
filename, linenum); filename, linenum);
options->ports[options->num_ports++] = atoi(arg); options->ports[options->num_ports++] = atoi(arg);
break; break;
@ -405,7 +405,7 @@ parse_int:
case sListenAddress: case sListenAddress:
arg = strdelim(&cp); arg = strdelim(&cp);
if (!arg || *arg == '\0') if (!arg || *arg == '\0')
fatal("%s line %d: missing inet addr.\n", fatal("%s line %d: missing inet addr.",
filename, linenum); filename, linenum);
add_listen_addr(options, arg); add_listen_addr(options, arg);
break; break;
@ -591,7 +591,7 @@ parse_flag:
arg = strdelim(&cp); arg = strdelim(&cp);
value = log_facility_number(arg); value = log_facility_number(arg);
if (value == (SyslogFacility) - 1) if (value == (SyslogFacility) - 1)
fatal("%.200s line %d: unsupported log facility '%s'\n", fatal("%.200s line %d: unsupported log facility '%s'",
filename, linenum, arg ? arg : "<NONE>"); filename, linenum, arg ? arg : "<NONE>");
if (*intptr == -1) if (*intptr == -1)
*intptr = (SyslogFacility) value; *intptr = (SyslogFacility) value;
@ -602,7 +602,7 @@ parse_flag:
arg = strdelim(&cp); arg = strdelim(&cp);
value = log_level_number(arg); value = log_level_number(arg);
if (value == (LogLevel) - 1) if (value == (LogLevel) - 1)
fatal("%.200s line %d: unsupported log level '%s'\n", fatal("%.200s line %d: unsupported log level '%s'",
filename, linenum, arg ? arg : "<NONE>"); filename, linenum, arg ? arg : "<NONE>");
if (*intptr == -1) if (*intptr == -1)
*intptr = (LogLevel) value; *intptr = (LogLevel) value;
@ -615,7 +615,7 @@ parse_flag:
case sAllowUsers: case sAllowUsers:
while ((arg = strdelim(&cp)) && *arg != '\0') { while ((arg = strdelim(&cp)) && *arg != '\0') {
if (options->num_allow_users >= MAX_ALLOW_USERS) if (options->num_allow_users >= MAX_ALLOW_USERS)
fatal("%s line %d: too many allow users.\n", fatal("%s line %d: too many allow users.",
filename, linenum); filename, linenum);
options->allow_users[options->num_allow_users++] = xstrdup(arg); options->allow_users[options->num_allow_users++] = xstrdup(arg);
} }
@ -624,7 +624,7 @@ parse_flag:
case sDenyUsers: case sDenyUsers:
while ((arg = strdelim(&cp)) && *arg != '\0') { while ((arg = strdelim(&cp)) && *arg != '\0') {
if (options->num_deny_users >= MAX_DENY_USERS) if (options->num_deny_users >= MAX_DENY_USERS)
fatal( "%s line %d: too many deny users.\n", fatal( "%s line %d: too many deny users.",
filename, linenum); filename, linenum);
options->deny_users[options->num_deny_users++] = xstrdup(arg); options->deny_users[options->num_deny_users++] = xstrdup(arg);
} }
@ -633,7 +633,7 @@ parse_flag:
case sAllowGroups: case sAllowGroups:
while ((arg = strdelim(&cp)) && *arg != '\0') { while ((arg = strdelim(&cp)) && *arg != '\0') {
if (options->num_allow_groups >= MAX_ALLOW_GROUPS) if (options->num_allow_groups >= MAX_ALLOW_GROUPS)
fatal("%s line %d: too many allow groups.\n", fatal("%s line %d: too many allow groups.",
filename, linenum); filename, linenum);
options->allow_groups[options->num_allow_groups++] = xstrdup(arg); options->allow_groups[options->num_allow_groups++] = xstrdup(arg);
} }
@ -642,7 +642,7 @@ parse_flag:
case sDenyGroups: case sDenyGroups:
while ((arg = strdelim(&cp)) && *arg != '\0') { while ((arg = strdelim(&cp)) && *arg != '\0') {
if (options->num_deny_groups >= MAX_DENY_GROUPS) if (options->num_deny_groups >= MAX_DENY_GROUPS)
fatal("%s line %d: too many deny groups.\n", fatal("%s line %d: too many deny groups.",
filename, linenum); filename, linenum);
options->deny_groups[options->num_deny_groups++] = xstrdup(arg); options->deny_groups[options->num_deny_groups++] = xstrdup(arg);
} }

View File

@ -28,7 +28,7 @@
/* XXX: recursive operations */ /* XXX: recursive operations */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sftp-int.c,v 1.23 2001/03/01 02:18:04 deraadt Exp $"); RCSID("$OpenBSD: sftp-int.c,v 1.24 2001/03/04 17:42:28 millert Exp $");
#include "buffer.h" #include "buffer.h"
#include "xmalloc.h" #include "xmalloc.h"
@ -579,7 +579,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
break; break;
case I_LPWD: case I_LPWD:
if (!getcwd(path_buf, sizeof(path_buf))) if (!getcwd(path_buf, sizeof(path_buf)))
error("Couldn't get local cwd: %s\n", error("Couldn't get local cwd: %s",
strerror(errno)); strerror(errno));
else else
printf("Local working directory: %s\n", printf("Local working directory: %s\n",

8
ssh.c
View File

@ -39,7 +39,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh.c,v 1.102 2001/03/04 10:57:53 stevesk Exp $"); RCSID("$OpenBSD: ssh.c,v 1.103 2001/03/04 17:42:28 millert Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/err.h> #include <openssl/err.h>
@ -388,7 +388,7 @@ main(int ac, char **av)
options.log_level++; options.log_level++;
break; break;
} else { } else {
fatal("Too high debugging level.\n"); fatal("Too high debugging level.");
} }
/* fallthrough */ /* fallthrough */
case 'V': case 'V':
@ -544,14 +544,14 @@ main(int ac, char **av)
/* Do not allocate a tty if stdin is not a tty. */ /* Do not allocate a tty if stdin is not a tty. */
if (!isatty(fileno(stdin)) && !force_tty_flag) { if (!isatty(fileno(stdin)) && !force_tty_flag) {
if (tty_flag) if (tty_flag)
log("Pseudo-terminal will not be allocated because stdin is not a terminal.\n"); log("Pseudo-terminal will not be allocated because stdin is not a terminal.");
tty_flag = 0; tty_flag = 0;
} }
/* Get user data. */ /* Get user data. */
pw = getpwuid(original_real_uid); pw = getpwuid(original_real_uid);
if (!pw) { if (!pw) {
log("You don't exist, go away!\n"); log("You don't exist, go away!");
exit(1); exit(1);
} }
/* Take a copy of the returned structure. */ /* Take a copy of the returned structure. */

View File

@ -13,7 +13,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect.c,v 1.97 2001/02/15 23:19:59 markus Exp $"); RCSID("$OpenBSD: sshconnect.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
@ -618,7 +618,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
"Are you sure you want to continue connecting (yes/no)? ", "Are you sure you want to continue connecting (yes/no)? ",
host, ip, type, key_fingerprint(host_key)); host, ip, type, key_fingerprint(host_key));
if (!read_yes_or_no(prompt, -1)) if (!read_yes_or_no(prompt, -1))
fatal("Aborted by user!\n"); fatal("Aborted by user!");
} }
if (options.check_host_ip && ip_status == HOST_NEW) { if (options.check_host_ip && ip_status == HOST_NEW) {
snprintf(hostline, sizeof(hostline), "%s,%s", host, ip); snprintf(hostline, sizeof(hostline), "%s,%s", host, ip);
@ -719,7 +719,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
} else if (options.strict_host_key_checking == 2) { } else if (options.strict_host_key_checking == 2) {
if (!read_yes_or_no("Are you sure you want " \ if (!read_yes_or_no("Are you sure you want " \
"to continue connecting (yes/no)? ", -1)) "to continue connecting (yes/no)? ", -1))
fatal("Aborted by user!\n"); fatal("Aborted by user!");
} }
} }

4
sshd.c
View File

@ -40,7 +40,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshd.c,v 1.171 2001/03/04 01:46:30 djm Exp $"); RCSID("$OpenBSD: sshd.c,v 1.172 2001/03/04 17:42:28 millert Exp $");
#include <openssl/dh.h> #include <openssl/dh.h>
#include <openssl/bn.h> #include <openssl/bn.h>
@ -738,7 +738,7 @@ main(int ac, char **av)
options.protocol &= ~SSH_PROTO_2; options.protocol &= ~SSH_PROTO_2;
} }
if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
log("sshd: no hostkeys available -- exiting.\n"); log("sshd: no hostkeys available -- exiting.");
exit(1); exit(1);
} }