summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-05 07:47:23 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-05 07:47:23 +0000
commit6df8ef4196f1287d4c328f09ea7f8c0995e0cab1 (patch)
treec4d4da3f9a84099838388a6070c7cdc675c27155
parentfafea18d68f3d1a4ea412ff4618fd66c1a05b548 (diff)
- 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.
-rw-r--r--ChangeLog8
-rw-r--r--authfd.c4
-rw-r--r--channels.c4
-rw-r--r--dh.c4
-rw-r--r--log.c6
-rw-r--r--readconf.c8
-rw-r--r--servconf.c22
-rw-r--r--sftp-int.c4
-rw-r--r--ssh.c8
-rw-r--r--sshconnect.c6
-rw-r--r--sshd.c4
11 files changed, 42 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index d11d0e377..a726baf0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,12 @@
159 - stevesk@cvs.openbsd.org 2001/03/04 12:54:04 159 - stevesk@cvs.openbsd.org 2001/03/04 12:54:04
160 [sshd.8] 160 [sshd.8]
161 spelling 161 spelling
162 - millert@cvs.openbsd.org 2001/03/04 17:42:28
163 [authfd.c channels.c dh.c log.c readconf.c servconf.c sftp-int.c
164 ssh.c sshconnect.c sshd.c]
165 log functions should not be passed strings that end in newline as they
166 get passed on to syslog() and when logging to stderr, do_log() appends
167 its own newline.
162 168
16320010304 16920010304
164 - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid. 170 - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid.
@@ -4351,4 +4357,4 @@
4351 - Wrote replacements for strlcpy and mkdtemp 4357 - Wrote replacements for strlcpy and mkdtemp
4352 - Released 1.0pre1 4358 - Released 1.0pre1
4353 4359
4354$Id: ChangeLog,v 1.901 2001/03/05 07:43:27 mouring Exp $ 4360$Id: ChangeLog,v 1.902 2001/03/05 07:47:23 mouring Exp $
diff --git a/authfd.c b/authfd.c
index 74518e3fb..76e917755 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: authfd.c,v 1.36 2001/03/01 02:11:25 deraadt Exp $"); 38RCSID("$OpenBSD: authfd.c,v 1.37 2001/03/04 17:42:27 millert Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -254,7 +254,7 @@ ssh_get_num_identities(AuthenticationConnection *auth, int version)
254 /* Get the number of entries in the response and check it for sanity. */ 254 /* Get the number of entries in the response and check it for sanity. */
255 auth->howmany = buffer_get_int(&auth->identities); 255 auth->howmany = buffer_get_int(&auth->identities);
256 if (auth->howmany > 1024) 256 if (auth->howmany > 1024)
257 fatal("Too many identities in authentication reply: %d\n", 257 fatal("Too many identities in authentication reply: %d",
258 auth->howmany); 258 auth->howmany);
259 259
260 return auth->howmany; 260 return auth->howmany;
diff --git a/channels.c b/channels.c
index 1d74efe0c..bb872dc94 100644
--- a/channels.c
+++ b/channels.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: channels.c,v 1.97 2001/03/04 00:03:59 markus Exp $"); 43RCSID("$OpenBSD: channels.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
44 44
45#include <openssl/rsa.h> 45#include <openssl/rsa.h>
46#include <openssl/dsa.h> 46#include <openssl/dsa.h>
@@ -521,7 +521,7 @@ channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset)
521 * We have received an X11 connection that has bad 521 * We have received an X11 connection that has bad
522 * authentication information. 522 * authentication information.
523 */ 523 */
524 log("X11 connection rejected because of wrong authentication.\r\n"); 524 log("X11 connection rejected because of wrong authentication.");
525 buffer_clear(&c->input); 525 buffer_clear(&c->input);
526 buffer_clear(&c->output); 526 buffer_clear(&c->output);
527 close(c->sock); 527 close(c->sock);
diff --git a/dh.c b/dh.c
index f1f7e5d43..c88a014a5 100644
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: dh.c,v 1.6 2001/01/21 19:05:49 markus Exp $"); 26RCSID("$OpenBSD: dh.c,v 1.7 2001/03/04 17:42:28 millert Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29 29
@@ -90,7 +90,7 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg)
90 90
91 return (1); 91 return (1);
92 fail: 92 fail:
93 error("Bad prime description in line %d\n", linenum); 93 error("Bad prime description in line %d", linenum);
94 return (0); 94 return (0);
95} 95}
96 96
diff --git a/log.c b/log.c
index c9c1631c9..ad93f515f 100644
--- a/log.c
+++ b/log.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#include "includes.h" 36#include "includes.h"
37RCSID("$OpenBSD: log.c,v 1.17 2001/03/04 17:42:28 millert Exp $"); 37RCSID("$OpenBSD: log.c,v 1.16 2001/03/03 23:59:34 markus Exp $");
38 38
39#include "log.h" 39#include "log.h"
40#include "xmalloc.h" 40#include "xmalloc.h"
@@ -265,7 +265,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
265 log_level = level; 265 log_level = level;
266 break; 266 break;
267 default: 267 default:
268 fprintf(stderr, "Unrecognized internal syslog level code %d\n", 268 fprintf(stderr, "Unrecognized internal syslog level code %d",
269 (int) level); 269 (int) level);
270 exit(1); 270 exit(1);
271 } 271 }
@@ -315,7 +315,7 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
315 break; 315 break;
316 default: 316 default:
317 fprintf(stderr, 317 fprintf(stderr,
318 "Unrecognized internal syslog facility code %d\n", 318 "Unrecognized internal syslog facility code %d",
319 (int) facility); 319 (int) facility);
320 exit(1); 320 exit(1);
321 } 321 }
diff --git a/readconf.c b/readconf.c
index 7cce92310..33649a8d5 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.63 2001/02/24 10:37:55 deraadt Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.64 2001/03/04 17:42:28 millert Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -187,7 +187,7 @@ add_local_forward(Options *options, u_short port, const char *host,
187#ifndef HAVE_CYGWIN 187#ifndef HAVE_CYGWIN
188 extern uid_t original_real_uid; 188 extern uid_t original_real_uid;
189 if (port < IPPORT_RESERVED && original_real_uid != 0) 189 if (port < IPPORT_RESERVED && original_real_uid != 0)
190 fatal("Privileged ports can only be forwarded by root.\n"); 190 fatal("Privileged ports can only be forwarded by root.");
191#endif 191#endif
192 if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION) 192 if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
193 fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION); 193 fatal("Too many local forwards (max %d).", SSH_MAX_FORWARDS_PER_DIRECTION);
@@ -534,7 +534,7 @@ parse_int:
534 arg = strdelim(&s); 534 arg = strdelim(&s);
535 value = log_level_number(arg); 535 value = log_level_number(arg);
536 if (value == (LogLevel) - 1) 536 if (value == (LogLevel) - 1)
537 fatal("%.200s line %d: unsupported log level '%s'\n", 537 fatal("%.200s line %d: unsupported log level '%s'",
538 filename, linenum, arg ? arg : "<NONE>"); 538 filename, linenum, arg ? arg : "<NONE>");
539 if (*activep && (LogLevel) * intptr == -1) 539 if (*activep && (LogLevel) * intptr == -1)
540 *intptr = (LogLevel) value; 540 *intptr = (LogLevel) value;
@@ -659,7 +659,7 @@ read_config_file(const char *filename, const char *host, Options *options)
659 } 659 }
660 fclose(f); 660 fclose(f);
661 if (bad_options > 0) 661 if (bad_options > 0)
662 fatal("%s: terminating, %d bad configuration options\n", 662 fatal("%s: terminating, %d bad configuration options",
663 filename, bad_options); 663 filename, bad_options);
664} 664}
665 665
diff --git a/servconf.c b/servconf.c
index 1e77d32f7..1e38f3b60 100644
--- a/servconf.c
+++ b/servconf.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: servconf.c,v 1.69 2001/03/04 11:16:06 stevesk Exp $"); 13RCSID("$OpenBSD: servconf.c,v 1.70 2001/03/04 17:42:28 millert Exp $");
14 14
15#ifdef KRB4 15#ifdef KRB4
16#include <krb.h> 16#include <krb.h>
@@ -318,7 +318,7 @@ add_listen_addr(ServerOptions *options, char *addr)
318 hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; 318 hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0;
319 snprintf(strport, sizeof strport, "%d", options->ports[i]); 319 snprintf(strport, sizeof strport, "%d", options->ports[i]);
320 if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) 320 if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0)
321 fatal("bad addr or host: %s (%s)\n", 321 fatal("bad addr or host: %s (%s)",
322 addr ? addr : "<NULL>", 322 addr ? addr : "<NULL>",
323 gai_strerror(gaierr)); 323 gai_strerror(gaierr));
324 for (ai = aitop; ai->ai_next; ai = ai->ai_next) 324 for (ai = aitop; ai->ai_next; ai = ai->ai_next)
@@ -371,11 +371,11 @@ read_server_config(ServerOptions *options, const char *filename)
371 fatal("%s line %d: ports must be specified before " 371 fatal("%s line %d: ports must be specified before "
372 "ListenAdress.\n", filename, linenum); 372 "ListenAdress.\n", filename, linenum);
373 if (options->num_ports >= MAX_PORTS) 373 if (options->num_ports >= MAX_PORTS)
374 fatal("%s line %d: too many ports.\n", 374 fatal("%s line %d: too many ports.",
375 filename, linenum); 375 filename, linenum);
376 arg = strdelim(&cp); 376 arg = strdelim(&cp);
377 if (!arg || *arg == '\0') 377 if (!arg || *arg == '\0')
378 fatal("%s line %d: missing port number.\n", 378 fatal("%s line %d: missing port number.",
379 filename, linenum); 379 filename, linenum);
380 options->ports[options->num_ports++] = atoi(arg); 380 options->ports[options->num_ports++] = atoi(arg);
381 break; 381 break;
@@ -405,7 +405,7 @@ parse_int:
405 case sListenAddress: 405 case sListenAddress:
406 arg = strdelim(&cp); 406 arg = strdelim(&cp);
407 if (!arg || *arg == '\0') 407 if (!arg || *arg == '\0')
408 fatal("%s line %d: missing inet addr.\n", 408 fatal("%s line %d: missing inet addr.",
409 filename, linenum); 409 filename, linenum);
410 add_listen_addr(options, arg); 410 add_listen_addr(options, arg);
411 break; 411 break;
@@ -591,7 +591,7 @@ parse_flag:
591 arg = strdelim(&cp); 591 arg = strdelim(&cp);
592 value = log_facility_number(arg); 592 value = log_facility_number(arg);
593 if (value == (SyslogFacility) - 1) 593 if (value == (SyslogFacility) - 1)
594 fatal("%.200s line %d: unsupported log facility '%s'\n", 594 fatal("%.200s line %d: unsupported log facility '%s'",
595 filename, linenum, arg ? arg : "<NONE>"); 595 filename, linenum, arg ? arg : "<NONE>");
596 if (*intptr == -1) 596 if (*intptr == -1)
597 *intptr = (SyslogFacility) value; 597 *intptr = (SyslogFacility) value;
@@ -602,7 +602,7 @@ parse_flag:
602 arg = strdelim(&cp); 602 arg = strdelim(&cp);
603 value = log_level_number(arg); 603 value = log_level_number(arg);
604 if (value == (LogLevel) - 1) 604 if (value == (LogLevel) - 1)
605 fatal("%.200s line %d: unsupported log level '%s'\n", 605 fatal("%.200s line %d: unsupported log level '%s'",
606 filename, linenum, arg ? arg : "<NONE>"); 606 filename, linenum, arg ? arg : "<NONE>");
607 if (*intptr == -1) 607 if (*intptr == -1)
608 *intptr = (LogLevel) value; 608 *intptr = (LogLevel) value;
@@ -615,7 +615,7 @@ parse_flag:
615 case sAllowUsers: 615 case sAllowUsers:
616 while ((arg = strdelim(&cp)) && *arg != '\0') { 616 while ((arg = strdelim(&cp)) && *arg != '\0') {
617 if (options->num_allow_users >= MAX_ALLOW_USERS) 617 if (options->num_allow_users >= MAX_ALLOW_USERS)
618 fatal("%s line %d: too many allow users.\n", 618 fatal("%s line %d: too many allow users.",
619 filename, linenum); 619 filename, linenum);
620 options->allow_users[options->num_allow_users++] = xstrdup(arg); 620 options->allow_users[options->num_allow_users++] = xstrdup(arg);
621 } 621 }
@@ -624,7 +624,7 @@ parse_flag:
624 case sDenyUsers: 624 case sDenyUsers:
625 while ((arg = strdelim(&cp)) && *arg != '\0') { 625 while ((arg = strdelim(&cp)) && *arg != '\0') {
626 if (options->num_deny_users >= MAX_DENY_USERS) 626 if (options->num_deny_users >= MAX_DENY_USERS)
627 fatal( "%s line %d: too many deny users.\n", 627 fatal( "%s line %d: too many deny users.",
628 filename, linenum); 628 filename, linenum);
629 options->deny_users[options->num_deny_users++] = xstrdup(arg); 629 options->deny_users[options->num_deny_users++] = xstrdup(arg);
630 } 630 }
@@ -633,7 +633,7 @@ parse_flag:
633 case sAllowGroups: 633 case sAllowGroups:
634 while ((arg = strdelim(&cp)) && *arg != '\0') { 634 while ((arg = strdelim(&cp)) && *arg != '\0') {
635 if (options->num_allow_groups >= MAX_ALLOW_GROUPS) 635 if (options->num_allow_groups >= MAX_ALLOW_GROUPS)
636 fatal("%s line %d: too many allow groups.\n", 636 fatal("%s line %d: too many allow groups.",
637 filename, linenum); 637 filename, linenum);
638 options->allow_groups[options->num_allow_groups++] = xstrdup(arg); 638 options->allow_groups[options->num_allow_groups++] = xstrdup(arg);
639 } 639 }
@@ -642,7 +642,7 @@ parse_flag:
642 case sDenyGroups: 642 case sDenyGroups:
643 while ((arg = strdelim(&cp)) && *arg != '\0') { 643 while ((arg = strdelim(&cp)) && *arg != '\0') {
644 if (options->num_deny_groups >= MAX_DENY_GROUPS) 644 if (options->num_deny_groups >= MAX_DENY_GROUPS)
645 fatal("%s line %d: too many deny groups.\n", 645 fatal("%s line %d: too many deny groups.",
646 filename, linenum); 646 filename, linenum);
647 options->deny_groups[options->num_deny_groups++] = xstrdup(arg); 647 options->deny_groups[options->num_deny_groups++] = xstrdup(arg);
648 } 648 }
diff --git a/sftp-int.c b/sftp-int.c
index 95e54a65f..53136be07 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -28,7 +28,7 @@
28/* XXX: recursive operations */ 28/* XXX: recursive operations */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$OpenBSD: sftp-int.c,v 1.23 2001/03/01 02:18:04 deraadt Exp $"); 31RCSID("$OpenBSD: sftp-int.c,v 1.24 2001/03/04 17:42:28 millert Exp $");
32 32
33#include "buffer.h" 33#include "buffer.h"
34#include "xmalloc.h" 34#include "xmalloc.h"
@@ -579,7 +579,7 @@ parse_dispatch_command(int in, int out, const char *cmd, char **pwd)
579 break; 579 break;
580 case I_LPWD: 580 case I_LPWD:
581 if (!getcwd(path_buf, sizeof(path_buf))) 581 if (!getcwd(path_buf, sizeof(path_buf)))
582 error("Couldn't get local cwd: %s\n", 582 error("Couldn't get local cwd: %s",
583 strerror(errno)); 583 strerror(errno));
584 else 584 else
585 printf("Local working directory: %s\n", 585 printf("Local working directory: %s\n",
diff --git a/ssh.c b/ssh.c
index c22002bd4..631900f15 100644
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: ssh.c,v 1.102 2001/03/04 10:57:53 stevesk Exp $"); 42RCSID("$OpenBSD: ssh.c,v 1.103 2001/03/04 17:42:28 millert Exp $");
43 43
44#include <openssl/evp.h> 44#include <openssl/evp.h>
45#include <openssl/err.h> 45#include <openssl/err.h>
@@ -388,7 +388,7 @@ main(int ac, char **av)
388 options.log_level++; 388 options.log_level++;
389 break; 389 break;
390 } else { 390 } else {
391 fatal("Too high debugging level.\n"); 391 fatal("Too high debugging level.");
392 } 392 }
393 /* fallthrough */ 393 /* fallthrough */
394 case 'V': 394 case 'V':
@@ -544,14 +544,14 @@ main(int ac, char **av)
544 /* Do not allocate a tty if stdin is not a tty. */ 544 /* Do not allocate a tty if stdin is not a tty. */
545 if (!isatty(fileno(stdin)) && !force_tty_flag) { 545 if (!isatty(fileno(stdin)) && !force_tty_flag) {
546 if (tty_flag) 546 if (tty_flag)
547 log("Pseudo-terminal will not be allocated because stdin is not a terminal.\n"); 547 log("Pseudo-terminal will not be allocated because stdin is not a terminal.");
548 tty_flag = 0; 548 tty_flag = 0;
549 } 549 }
550 550
551 /* Get user data. */ 551 /* Get user data. */
552 pw = getpwuid(original_real_uid); 552 pw = getpwuid(original_real_uid);
553 if (!pw) { 553 if (!pw) {
554 log("You don't exist, go away!\n"); 554 log("You don't exist, go away!");
555 exit(1); 555 exit(1);
556 } 556 }
557 /* Take a copy of the returned structure. */ 557 /* Take a copy of the returned structure. */
diff --git a/sshconnect.c b/sshconnect.c
index 623caed73..9962d49bd 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.97 2001/02/15 23:19:59 markus Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -618,7 +618,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
618 "Are you sure you want to continue connecting (yes/no)? ", 618 "Are you sure you want to continue connecting (yes/no)? ",
619 host, ip, type, key_fingerprint(host_key)); 619 host, ip, type, key_fingerprint(host_key));
620 if (!read_yes_or_no(prompt, -1)) 620 if (!read_yes_or_no(prompt, -1))
621 fatal("Aborted by user!\n"); 621 fatal("Aborted by user!");
622 } 622 }
623 if (options.check_host_ip && ip_status == HOST_NEW) { 623 if (options.check_host_ip && ip_status == HOST_NEW) {
624 snprintf(hostline, sizeof(hostline), "%s,%s", host, ip); 624 snprintf(hostline, sizeof(hostline), "%s,%s", host, ip);
@@ -719,7 +719,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
719 } else if (options.strict_host_key_checking == 2) { 719 } else if (options.strict_host_key_checking == 2) {
720 if (!read_yes_or_no("Are you sure you want " \ 720 if (!read_yes_or_no("Are you sure you want " \
721 "to continue connecting (yes/no)? ", -1)) 721 "to continue connecting (yes/no)? ", -1))
722 fatal("Aborted by user!\n"); 722 fatal("Aborted by user!");
723 } 723 }
724 } 724 }
725 725
diff --git a/sshd.c b/sshd.c
index 7b9b1420b..838ac0d73 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.171 2001/03/04 01:46:30 djm Exp $"); 43RCSID("$OpenBSD: sshd.c,v 1.172 2001/03/04 17:42:28 millert Exp $");
44 44
45#include <openssl/dh.h> 45#include <openssl/dh.h>
46#include <openssl/bn.h> 46#include <openssl/bn.h>
@@ -738,7 +738,7 @@ main(int ac, char **av)
738 options.protocol &= ~SSH_PROTO_2; 738 options.protocol &= ~SSH_PROTO_2;
739 } 739 }
740 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { 740 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
741 log("sshd: no hostkeys available -- exiting.\n"); 741 log("sshd: no hostkeys available -- exiting.");
742 exit(1); 742 exit(1);
743 } 743 }
744 744