diff options
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | channels.c | 10 | ||||
-rw-r--r-- | clientloop.c | 6 | ||||
-rw-r--r-- | log.c | 62 | ||||
-rw-r--r-- | packet.c | 22 | ||||
-rw-r--r-- | packet.h | 7 | ||||
-rw-r--r-- | readconf.c | 48 | ||||
-rw-r--r-- | servconf.c | 87 | ||||
-rw-r--r-- | serverloop.c | 8 | ||||
-rw-r--r-- | ssh-agent.c | 4 | ||||
-rw-r--r-- | ssh.h | 6 | ||||
-rw-r--r-- | sshconnect.c | 4 | ||||
-rw-r--r-- | sshd.8 | 8 | ||||
-rw-r--r-- | sshd.c | 11 |
14 files changed, 166 insertions, 135 deletions
@@ -1,3 +1,21 @@ | |||
1 | 19991121 | ||
2 | - OpenBSD CVS Changes | ||
3 | - [channels.c] | ||
4 | make this compile, bad markus | ||
5 | - [log.c readconf.c servconf.c ssh.h] | ||
6 | bugfix: loglevels are per host in clientconfig, | ||
7 | factor out common log-level parsing code. | ||
8 | - [servconf.c] | ||
9 | remove unused index (-Wall) | ||
10 | - [ssh-agent.c] | ||
11 | only one 'extern char *__progname' | ||
12 | - [sshd.8] | ||
13 | document SIGHUP, -Q to synopsis | ||
14 | - [sshconnect.c serverloop.c sshd.c packet.c packet.h] | ||
15 | [channels.c clientloop.c] | ||
16 | SSH_CMSG_MAX_PACKET_SIZE, some clients use this, some need this, niels@ | ||
17 | [hope this time my ISP stays alive during commit] | ||
18 | |||
1 | 19991120 | 19 | 19991120 |
2 | - Merged more Solaris support from Marc G. Fournier | 20 | - Merged more Solaris support from Marc G. Fournier |
3 | <marc.fournier@acadiau.ca> | 21 | <marc.fournier@acadiau.ca> |
diff --git a/channels.c b/channels.c index c5ec1fc87..3e3b5f369 100644 --- a/channels.c +++ b/channels.c | |||
@@ -16,7 +16,7 @@ arbitrary tcp/ip connections, and the authentication agent connection. | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | RCSID("$Id: channels.c,v 1.5 1999/11/12 04:19:27 damien Exp $"); | 19 | RCSID("$Id: channels.c,v 1.6 1999/11/21 02:23:53 damien Exp $"); |
20 | 20 | ||
21 | #include "ssh.h" | 21 | #include "ssh.h" |
22 | #include "packet.h" | 22 | #include "packet.h" |
@@ -208,7 +208,7 @@ void channel_prepare_select(fd_set *readset, fd_set *writeset) | |||
208 | 208 | ||
209 | case SSH_CHANNEL_OPEN: | 209 | case SSH_CHANNEL_OPEN: |
210 | if(compat13){ | 210 | if(compat13){ |
211 | if (buffer_len(&ch->input) < 32768) | 211 | if (buffer_len(&ch->input) < packet_get_maxsize()) |
212 | FD_SET(ch->sock, readset); | 212 | FD_SET(ch->sock, readset); |
213 | if (buffer_len(&ch->output) > 0) | 213 | if (buffer_len(&ch->output) > 0) |
214 | FD_SET(ch->sock, writeset); | 214 | FD_SET(ch->sock, writeset); |
@@ -216,7 +216,7 @@ void channel_prepare_select(fd_set *readset, fd_set *writeset) | |||
216 | } | 216 | } |
217 | /* test whether sockets are 'alive' for read/write */ | 217 | /* test whether sockets are 'alive' for read/write */ |
218 | if (ch->istate == CHAN_INPUT_OPEN) | 218 | if (ch->istate == CHAN_INPUT_OPEN) |
219 | if (buffer_len(&ch->input) < 32768) | 219 | if (buffer_len(&ch->input) < packet_get_maxsize()) |
220 | FD_SET(ch->sock, readset); | 220 | FD_SET(ch->sock, readset); |
221 | if (ch->ostate == CHAN_OUTPUT_OPEN || ch->ostate == CHAN_OUTPUT_WAIT_DRAIN){ | 221 | if (ch->ostate == CHAN_OUTPUT_OPEN || ch->ostate == CHAN_OUTPUT_WAIT_DRAIN){ |
222 | if (buffer_len(&ch->output) > 0){ | 222 | if (buffer_len(&ch->output) > 0){ |
@@ -611,9 +611,9 @@ int channel_not_very_much_buffered_data() | |||
611 | case SSH_CHANNEL_AUTH_SOCKET: | 611 | case SSH_CHANNEL_AUTH_SOCKET: |
612 | continue; | 612 | continue; |
613 | case SSH_CHANNEL_OPEN: | 613 | case SSH_CHANNEL_OPEN: |
614 | if (buffer_len(&ch->input) > 32768) | 614 | if (buffer_len(&ch->input) > packet_get_maxsize()) |
615 | return 0; | 615 | return 0; |
616 | if (buffer_len(&ch->output) > 32768) | 616 | if (buffer_len(&ch->output) > packet_get_maxsize()) |
617 | return 0; | 617 | return 0; |
618 | continue; | 618 | continue; |
619 | case SSH_CHANNEL_INPUT_DRAINING: | 619 | case SSH_CHANNEL_INPUT_DRAINING: |
diff --git a/clientloop.c b/clientloop.c index 410dc54de..8e8d7627d 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -15,7 +15,7 @@ The main loop for the interactive session (client side). | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: clientloop.c,v 1.3 1999/11/12 04:19:27 damien Exp $"); | 18 | RCSID("$Id: clientloop.c,v 1.4 1999/11/21 02:23:53 damien Exp $"); |
19 | 19 | ||
20 | #include "xmalloc.h" | 20 | #include "xmalloc.h" |
21 | #include "ssh.h" | 21 | #include "ssh.h" |
@@ -322,8 +322,8 @@ void client_make_packets_from_stdin_data() | |||
322 | packet_not_very_much_data_to_write()) | 322 | packet_not_very_much_data_to_write()) |
323 | { | 323 | { |
324 | len = buffer_len(&stdin_buffer); | 324 | len = buffer_len(&stdin_buffer); |
325 | if (len > 32768) | 325 | if (len > packet_get_maxsize()) |
326 | len = 32768; /* Keep the packets at reasonable size. */ | 326 | len = packet_get_maxsize(); /* Keep the packets at reasonable size. */ |
327 | packet_start(SSH_CMSG_STDIN_DATA); | 327 | packet_start(SSH_CMSG_STDIN_DATA); |
328 | packet_put_string(buffer_ptr(&stdin_buffer), len); | 328 | packet_put_string(buffer_ptr(&stdin_buffer), len); |
329 | packet_send(); | 329 | packet_send(); |
@@ -5,7 +5,7 @@ Shared versions of debug(), log(), etc. | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "includes.h" | 7 | #include "includes.h" |
8 | RCSID("$OpenBSD: log.c,v 1.1 1999/11/10 23:36:44 markus Exp $"); | 8 | RCSID("$OpenBSD: log.c,v 1.2 1999/11/19 16:04:17 markus Exp $"); |
9 | 9 | ||
10 | #include "ssh.h" | 10 | #include "ssh.h" |
11 | #include "xmalloc.h" | 11 | #include "xmalloc.h" |
@@ -133,3 +133,63 @@ fatal_cleanup(void) | |||
133 | 133 | ||
134 | exit(255); | 134 | exit(255); |
135 | } | 135 | } |
136 | |||
137 | /* textual representation of log-facilities/levels */ | ||
138 | |||
139 | |||
140 | static struct | ||
141 | { | ||
142 | const char *name; | ||
143 | SyslogFacility val; | ||
144 | } log_facilities[] = | ||
145 | { | ||
146 | { "DAEMON", SYSLOG_FACILITY_DAEMON }, | ||
147 | { "USER", SYSLOG_FACILITY_USER }, | ||
148 | { "AUTH", SYSLOG_FACILITY_AUTH }, | ||
149 | { "LOCAL0", SYSLOG_FACILITY_LOCAL0 }, | ||
150 | { "LOCAL1", SYSLOG_FACILITY_LOCAL1 }, | ||
151 | { "LOCAL2", SYSLOG_FACILITY_LOCAL2 }, | ||
152 | { "LOCAL3", SYSLOG_FACILITY_LOCAL3 }, | ||
153 | { "LOCAL4", SYSLOG_FACILITY_LOCAL4 }, | ||
154 | { "LOCAL5", SYSLOG_FACILITY_LOCAL5 }, | ||
155 | { "LOCAL6", SYSLOG_FACILITY_LOCAL6 }, | ||
156 | { "LOCAL7", SYSLOG_FACILITY_LOCAL7 }, | ||
157 | { NULL, 0 } | ||
158 | }; | ||
159 | |||
160 | static struct | ||
161 | { | ||
162 | const char *name; | ||
163 | LogLevel val; | ||
164 | } log_levels[] = | ||
165 | { | ||
166 | { "QUIET", SYSLOG_LEVEL_QUIET }, | ||
167 | { "FATAL", SYSLOG_LEVEL_FATAL }, | ||
168 | { "ERROR", SYSLOG_LEVEL_ERROR }, | ||
169 | { "INFO", SYSLOG_LEVEL_INFO }, | ||
170 | { "CHAT", SYSLOG_LEVEL_CHAT }, | ||
171 | { "DEBUG", SYSLOG_LEVEL_DEBUG }, | ||
172 | { NULL, 0 } | ||
173 | }; | ||
174 | |||
175 | SyslogFacility | ||
176 | log_facility_number(char *name) | ||
177 | { | ||
178 | int i; | ||
179 | if (name != NULL) | ||
180 | for (i = 0; log_facilities[i].name; i++) | ||
181 | if (strcasecmp(log_facilities[i].name, name) == 0) | ||
182 | return log_facilities[i].val; | ||
183 | return (SyslogFacility)-1; | ||
184 | } | ||
185 | |||
186 | LogLevel | ||
187 | log_level_number(char *name) | ||
188 | { | ||
189 | int i; | ||
190 | if (name != NULL) | ||
191 | for (i = 0; log_levels[i].name; i++) | ||
192 | if (strcasecmp(log_levels[i].name, name) == 0) | ||
193 | return log_levels[i].val; | ||
194 | return (LogLevel)-1; | ||
195 | } | ||
@@ -15,7 +15,7 @@ with the other side. This same code is used both on client and server side. | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: packet.c,v 1.3 1999/11/16 02:37:16 damien Exp $"); | 18 | RCSID("$Id: packet.c,v 1.4 1999/11/21 02:23:53 damien Exp $"); |
19 | 19 | ||
20 | #include "xmalloc.h" | 20 | #include "xmalloc.h" |
21 | #include "buffer.h" | 21 | #include "buffer.h" |
@@ -66,6 +66,9 @@ static Buffer compression_buffer; | |||
66 | /* Flag indicating whether packet compression/decompression is enabled. */ | 66 | /* Flag indicating whether packet compression/decompression is enabled. */ |
67 | static int packet_compression = 0; | 67 | static int packet_compression = 0; |
68 | 68 | ||
69 | /* default maximum packet size */ | ||
70 | int max_packet_size = 32768; | ||
71 | |||
69 | /* Flag indicating whether this module has been initialized. */ | 72 | /* Flag indicating whether this module has been initialized. */ |
70 | static int initialized = 0; | 73 | static int initialized = 0; |
71 | 74 | ||
@@ -745,3 +748,20 @@ packet_is_interactive() | |||
745 | { | 748 | { |
746 | return interactive_mode; | 749 | return interactive_mode; |
747 | } | 750 | } |
751 | |||
752 | int | ||
753 | packet_set_maxsize(int s) | ||
754 | { | ||
755 | static int called = 0; | ||
756 | if (called) { | ||
757 | log("packet_set_maxsize: called twice: old %d new %d", max_packet_size, s); | ||
758 | return -1; | ||
759 | } | ||
760 | if (s < 4*1024 || s > 1024*1024) { | ||
761 | log("packet_set_maxsize: bad size %d", s); | ||
762 | return -1; | ||
763 | } | ||
764 | log("packet_set_maxsize: setting to %d", s); | ||
765 | max_packet_size = s; | ||
766 | return s; | ||
767 | } | ||
@@ -13,7 +13,7 @@ Interface for the packet protocol functions. | |||
13 | 13 | ||
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* RCSID("$Id: packet.h,v 1.4 1999/11/16 02:37:16 damien Exp $"); */ | 16 | /* RCSID("$Id: packet.h,v 1.5 1999/11/21 02:23:53 damien Exp $"); */ |
17 | 17 | ||
18 | #ifndef PACKET_H | 18 | #ifndef PACKET_H |
19 | #define PACKET_H | 19 | #define PACKET_H |
@@ -154,6 +154,11 @@ int packet_have_data_to_write(void); | |||
154 | /* Returns true if there is not too much data to write to the connection. */ | 154 | /* Returns true if there is not too much data to write to the connection. */ |
155 | int packet_not_very_much_data_to_write(void); | 155 | int packet_not_very_much_data_to_write(void); |
156 | 156 | ||
157 | /* maximum packet size, requested by client with SSH_CMSG_MAX_PACKET_SIZE */ | ||
158 | extern int max_packet_size; | ||
159 | int packet_set_maxsize(int s); | ||
160 | #define packet_get_maxsize() max_packet_size | ||
161 | |||
157 | /* Stores tty modes from the fd into current packet. */ | 162 | /* Stores tty modes from the fd into current packet. */ |
158 | void tty_make_modes(int fd); | 163 | void tty_make_modes(int fd); |
159 | 164 | ||
diff --git a/readconf.c b/readconf.c index b341322c8..d8694b82d 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -14,7 +14,7 @@ Functions for reading the configuration files. | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: readconf.c,v 1.3 1999/11/15 04:25:10 damien Exp $"); | 17 | RCSID("$Id: readconf.c,v 1.4 1999/11/21 02:23:53 damien Exp $"); |
18 | 18 | ||
19 | #include "ssh.h" | 19 | #include "ssh.h" |
20 | #include "cipher.h" | 20 | #include "cipher.h" |
@@ -155,23 +155,6 @@ static struct | |||
155 | { NULL, 0 } | 155 | { NULL, 0 } |
156 | }; | 156 | }; |
157 | 157 | ||
158 | /* textual representation of log-levels */ | ||
159 | |||
160 | static struct | ||
161 | { | ||
162 | const char *name; | ||
163 | LogLevel level; | ||
164 | } log_levels[] = | ||
165 | { | ||
166 | { "QUIET", SYSLOG_LEVEL_QUIET }, | ||
167 | { "FATAL", SYSLOG_LEVEL_FATAL }, | ||
168 | { "ERROR", SYSLOG_LEVEL_ERROR }, | ||
169 | { "INFO", SYSLOG_LEVEL_INFO }, | ||
170 | { "CHAT", SYSLOG_LEVEL_CHAT }, | ||
171 | { "DEBUG", SYSLOG_LEVEL_DEBUG }, | ||
172 | { NULL, 0 } | ||
173 | }; | ||
174 | |||
175 | /* Characters considered whitespace in strtok calls. */ | 158 | /* Characters considered whitespace in strtok calls. */ |
176 | #define WHITESPACE " \t\r\n" | 159 | #define WHITESPACE " \t\r\n" |
177 | 160 | ||
@@ -237,7 +220,7 @@ process_config_line(Options *options, const char *host, | |||
237 | int *activep) | 220 | int *activep) |
238 | { | 221 | { |
239 | char buf[256], *cp, *string, **charptr; | 222 | char buf[256], *cp, *string, **charptr; |
240 | int opcode, *intptr, value, fwd_port, fwd_host_port, i; | 223 | int opcode, *intptr, value, fwd_port, fwd_host_port; |
241 | 224 | ||
242 | /* Skip leading whitespace. */ | 225 | /* Skip leading whitespace. */ |
243 | cp = line + strspn(line, WHITESPACE); | 226 | cp = line + strspn(line, WHITESPACE); |
@@ -462,30 +445,21 @@ process_config_line(Options *options, const char *host, | |||
462 | cp = strtok(NULL, WHITESPACE); | 445 | cp = strtok(NULL, WHITESPACE); |
463 | value = cipher_number(cp); | 446 | value = cipher_number(cp); |
464 | if (value == -1) | 447 | if (value == -1) |
465 | fatal("%.200s line %d: Bad cipher.", filename, linenum); | 448 | fatal("%.200s line %d: Bad cipher '%s'.", |
449 | filename, linenum, cp ? cp : "<NONE>"); | ||
466 | if (*activep && *intptr == -1) | 450 | if (*activep && *intptr == -1) |
467 | *intptr = value; | 451 | *intptr = value; |
468 | break; | 452 | break; |
469 | 453 | ||
470 | case oLogLevel: | 454 | case oLogLevel: |
455 | intptr = (int *)&options->log_level; | ||
471 | cp = strtok(NULL, WHITESPACE); | 456 | cp = strtok(NULL, WHITESPACE); |
472 | if (!cp) | 457 | value = log_level_number(cp); |
473 | { | 458 | if (value == (LogLevel)-1) |
474 | fprintf(stderr, "%s line %d: missing level name.\n", | 459 | fatal("%.200s line %d: unsupported log level '%s'\n", |
475 | filename, linenum); | 460 | filename, linenum, cp ? cp : "<NONE>"); |
476 | exit(1); | 461 | if (*activep && (LogLevel)*intptr == -1) |
477 | } | 462 | *intptr = (LogLevel)value; |
478 | for (i = 0; log_levels[i].name; i++) | ||
479 | if (strcasecmp(log_levels[i].name, cp) == 0) | ||
480 | break; | ||
481 | if (!log_levels[i].name) | ||
482 | { | ||
483 | fprintf(stderr, "%s line %d: unsupported log level %s\n", | ||
484 | filename, linenum, cp); | ||
485 | exit(1); | ||
486 | } | ||
487 | if (options->log_level == (LogLevel)(-1)) | ||
488 | options->log_level = log_levels[i].level; | ||
489 | break; | 463 | break; |
490 | 464 | ||
491 | case oRemoteForward: | 465 | case oRemoteForward: |
diff --git a/servconf.c b/servconf.c index f6d063989..086bc0364 100644 --- a/servconf.c +++ b/servconf.c | |||
@@ -12,7 +12,7 @@ Created: Mon Aug 21 15:48:58 1995 ylo | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$Id: servconf.c,v 1.4 1999/11/12 04:19:27 damien Exp $"); | 15 | RCSID("$Id: servconf.c,v 1.5 1999/11/21 02:23:53 damien Exp $"); |
16 | 16 | ||
17 | #include "ssh.h" | 17 | #include "ssh.h" |
18 | #include "servconf.h" | 18 | #include "servconf.h" |
@@ -214,41 +214,6 @@ static struct | |||
214 | { NULL, 0 } | 214 | { NULL, 0 } |
215 | }; | 215 | }; |
216 | 216 | ||
217 | static struct | ||
218 | { | ||
219 | const char *name; | ||
220 | SyslogFacility facility; | ||
221 | } log_facilities[] = | ||
222 | { | ||
223 | { "DAEMON", SYSLOG_FACILITY_DAEMON }, | ||
224 | { "USER", SYSLOG_FACILITY_USER }, | ||
225 | { "AUTH", SYSLOG_FACILITY_AUTH }, | ||
226 | { "LOCAL0", SYSLOG_FACILITY_LOCAL0 }, | ||
227 | { "LOCAL1", SYSLOG_FACILITY_LOCAL1 }, | ||
228 | { "LOCAL2", SYSLOG_FACILITY_LOCAL2 }, | ||
229 | { "LOCAL3", SYSLOG_FACILITY_LOCAL3 }, | ||
230 | { "LOCAL4", SYSLOG_FACILITY_LOCAL4 }, | ||
231 | { "LOCAL5", SYSLOG_FACILITY_LOCAL5 }, | ||
232 | { "LOCAL6", SYSLOG_FACILITY_LOCAL6 }, | ||
233 | { "LOCAL7", SYSLOG_FACILITY_LOCAL7 }, | ||
234 | { NULL, 0 } | ||
235 | }; | ||
236 | |||
237 | static struct | ||
238 | { | ||
239 | const char *name; | ||
240 | LogLevel level; | ||
241 | } log_levels[] = | ||
242 | { | ||
243 | { "QUIET", SYSLOG_LEVEL_QUIET }, | ||
244 | { "FATAL", SYSLOG_LEVEL_FATAL }, | ||
245 | { "ERROR", SYSLOG_LEVEL_ERROR }, | ||
246 | { "INFO", SYSLOG_LEVEL_INFO }, | ||
247 | { "CHAT", SYSLOG_LEVEL_CHAT }, | ||
248 | { "DEBUG", SYSLOG_LEVEL_DEBUG }, | ||
249 | { NULL, 0 } | ||
250 | }; | ||
251 | |||
252 | /* Returns the number of the token pointed to by cp of length len. | 217 | /* Returns the number of the token pointed to by cp of length len. |
253 | Never returns if the token is not known. */ | 218 | Never returns if the token is not known. */ |
254 | 219 | ||
@@ -273,7 +238,7 @@ void read_server_config(ServerOptions *options, const char *filename) | |||
273 | FILE *f; | 238 | FILE *f; |
274 | char line[1024]; | 239 | char line[1024]; |
275 | char *cp, **charptr; | 240 | char *cp, **charptr; |
276 | int linenum, *intptr, i, value; | 241 | int linenum, *intptr, value; |
277 | int bad_options = 0; | 242 | int bad_options = 0; |
278 | ServerOpCodes opcode; | 243 | ServerOpCodes opcode; |
279 | 244 | ||
@@ -495,45 +460,25 @@ void read_server_config(ServerOptions *options, const char *filename) | |||
495 | goto parse_flag; | 460 | goto parse_flag; |
496 | 461 | ||
497 | case sLogFacility: | 462 | case sLogFacility: |
463 | intptr = (int *)&options->log_facility; | ||
498 | cp = strtok(NULL, WHITESPACE); | 464 | cp = strtok(NULL, WHITESPACE); |
499 | if (!cp) | 465 | value = log_facility_number(cp); |
500 | { | 466 | if (value == (SyslogFacility)-1) |
501 | fprintf(stderr, "%s line %d: missing facility name.\n", | 467 | fatal("%.200s line %d: unsupported log facility '%s'\n", |
502 | filename, linenum); | 468 | filename, linenum, cp ? cp : "<NONE>"); |
503 | exit(1); | 469 | if (*intptr == -1) |
504 | } | 470 | *intptr = (SyslogFacility)value; |
505 | for (i = 0; log_facilities[i].name; i++) | ||
506 | if (strcasecmp(log_facilities[i].name, cp) == 0) | ||
507 | break; | ||
508 | if (!log_facilities[i].name) | ||
509 | { | ||
510 | fprintf(stderr, "%s line %d: unsupported log facility %s\n", | ||
511 | filename, linenum, cp); | ||
512 | exit(1); | ||
513 | } | ||
514 | if (options->log_facility == (SyslogFacility)(-1)) | ||
515 | options->log_facility = log_facilities[i].facility; | ||
516 | break; | 471 | break; |
517 | 472 | ||
518 | case sLogLevel: | 473 | case sLogLevel: |
474 | intptr = (int *)&options->log_level; | ||
519 | cp = strtok(NULL, WHITESPACE); | 475 | cp = strtok(NULL, WHITESPACE); |
520 | if (!cp) | 476 | value = log_level_number(cp); |
521 | { | 477 | if (value == (LogLevel)-1) |
522 | fprintf(stderr, "%s line %d: missing level name.\n", | 478 | fatal("%.200s line %d: unsupported log level '%s'\n", |
523 | filename, linenum); | 479 | filename, linenum, cp ? cp : "<NONE>"); |
524 | exit(1); | 480 | if (*intptr == -1) |
525 | } | 481 | *intptr = (LogLevel)value; |
526 | for (i = 0; log_levels[i].name; i++) | ||
527 | if (strcasecmp(log_levels[i].name, cp) == 0) | ||
528 | break; | ||
529 | if (!log_levels[i].name) | ||
530 | { | ||
531 | fprintf(stderr, "%s line %d: unsupported log level %s\n", | ||
532 | filename, linenum, cp); | ||
533 | exit(1); | ||
534 | } | ||
535 | if (options->log_level == (LogLevel)(-1)) | ||
536 | options->log_level = log_levels[i].level; | ||
537 | break; | 482 | break; |
538 | 483 | ||
539 | case sAllowUsers: | 484 | case sAllowUsers: |
diff --git a/serverloop.c b/serverloop.c index 2aec2cf19..9961170a5 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -176,8 +176,8 @@ void make_packets_from_stderr_data() | |||
176 | } | 176 | } |
177 | else | 177 | else |
178 | { | 178 | { |
179 | if (len > 32768) | 179 | if (len > packet_get_maxsize()) |
180 | len = 32768; /* Keep the packets at reasonable size. */ | 180 | len = packet_get_maxsize(); /* Keep the packets at reasonable size. */ |
181 | } | 181 | } |
182 | packet_start(SSH_SMSG_STDERR_DATA); | 182 | packet_start(SSH_SMSG_STDERR_DATA); |
183 | packet_put_string(buffer_ptr(&stderr_buffer), len); | 183 | packet_put_string(buffer_ptr(&stderr_buffer), len); |
@@ -206,8 +206,8 @@ void make_packets_from_stdout_data() | |||
206 | } | 206 | } |
207 | else | 207 | else |
208 | { | 208 | { |
209 | if (len > 32768) | 209 | if (len > packet_get_maxsize()) |
210 | len = 32768; /* Keep the packets at reasonable size. */ | 210 | len = packet_get_maxsize(); /* Keep the packets at reasonable size. */ |
211 | } | 211 | } |
212 | packet_start(SSH_SMSG_STDOUT_DATA); | 212 | packet_start(SSH_SMSG_STDOUT_DATA); |
213 | packet_put_string(buffer_ptr(&stdout_buffer), len); | 213 | packet_put_string(buffer_ptr(&stdout_buffer), len); |
diff --git a/ssh-agent.c b/ssh-agent.c index 296bb4c76..f1ceb5692 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.19 1999/11/18 14:00:49 markus Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.20 1999/11/19 10:20:51 markus Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | 4 | ||
@@ -16,7 +16,7 @@ The authentication agent program. | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | RCSID("$OpenBSD: ssh-agent.c,v 1.19 1999/11/18 14:00:49 markus Exp $"); | 19 | RCSID("$OpenBSD: ssh-agent.c,v 1.20 1999/11/19 10:20:51 markus Exp $"); |
20 | 20 | ||
21 | #include "ssh.h" | 21 | #include "ssh.h" |
22 | #include "rsa.h" | 22 | #include "rsa.h" |
@@ -13,7 +13,7 @@ Generic header file for ssh. | |||
13 | 13 | ||
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* RCSID("$Id: ssh.h,v 1.13 1999/11/16 02:37:17 damien Exp $"); */ | 16 | /* RCSID("$Id: ssh.h,v 1.14 1999/11/21 02:23:53 damien Exp $"); */ |
17 | 17 | ||
18 | #ifndef SSH_H | 18 | #ifndef SSH_H |
19 | #define SSH_H | 19 | #define SSH_H |
@@ -392,6 +392,10 @@ void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) | |||
392 | /* Logging implementation, depending on server or client */ | 392 | /* Logging implementation, depending on server or client */ |
393 | void do_log(LogLevel level, const char *fmt, va_list args); | 393 | void do_log(LogLevel level, const char *fmt, va_list args); |
394 | 394 | ||
395 | /* name to facility/level */ | ||
396 | SyslogFacility log_facility_number(char *name); | ||
397 | LogLevel log_level_number(char *name); | ||
398 | |||
395 | /* Output a message to syslog or stderr */ | 399 | /* Output a message to syslog or stderr */ |
396 | void fatal(const char *fmt, ...); | 400 | void fatal(const char *fmt, ...); |
397 | void error(const char *fmt, ...); | 401 | void error(const char *fmt, ...); |
diff --git a/sshconnect.c b/sshconnect.c index 8b7737446..fba389d8b 100644 --- a/sshconnect.c +++ b/sshconnect.c | |||
@@ -15,7 +15,7 @@ login (authentication) dialog. | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: sshconnect.c,v 1.12 1999/11/18 21:25:48 damien Exp $"); | 18 | RCSID("$Id: sshconnect.c,v 1.13 1999/11/21 02:23:53 damien Exp $"); |
19 | 19 | ||
20 | #ifdef HAVE_OPENSSL | 20 | #ifdef HAVE_OPENSSL |
21 | #include <openssl/bn.h> | 21 | #include <openssl/bn.h> |
@@ -906,7 +906,7 @@ void ssh_exchange_identification() | |||
906 | for (i = 0; i < sizeof(buf) - 1; i++) | 906 | for (i = 0; i < sizeof(buf) - 1; i++) |
907 | { | 907 | { |
908 | if (read(connection_in, &buf[i], 1) != 1) | 908 | if (read(connection_in, &buf[i], 1) != 1) |
909 | fatal("read: %.100s", strerror(errno)); | 909 | fatal("ssh_exchange_identification: read: %.100s", strerror(errno)); |
910 | if (buf[i] == '\r') | 910 | if (buf[i] == '\r') |
911 | { | 911 | { |
912 | buf[i] = '\n'; | 912 | buf[i] = '\n'; |
@@ -9,7 +9,7 @@ | |||
9 | .\" | 9 | .\" |
10 | .\" Created: Sat Apr 22 21:55:14 1995 ylo | 10 | .\" Created: Sat Apr 22 21:55:14 1995 ylo |
11 | .\" | 11 | .\" |
12 | .\" $Id: sshd.8,v 1.7 1999/11/12 00:33:04 damien Exp $ | 12 | .\" $Id: sshd.8,v 1.8 1999/11/21 02:23:53 damien Exp $ |
13 | .\" | 13 | .\" |
14 | .Dd September 25, 1999 | 14 | .Dd September 25, 1999 |
15 | .Dt SSHD 8 | 15 | .Dt SSHD 8 |
@@ -19,7 +19,7 @@ | |||
19 | .Nd secure shell daemon | 19 | .Nd secure shell daemon |
20 | .Sh SYNOPSIS | 20 | .Sh SYNOPSIS |
21 | .Nm sshd | 21 | .Nm sshd |
22 | .Op Fl diq | 22 | .Op Fl diqQ |
23 | .Op Fl b Ar bits | 23 | .Op Fl b Ar bits |
24 | .Op Fl f Ar config_file | 24 | .Op Fl f Ar config_file |
25 | .Op Fl g Ar login_grace_time | 25 | .Op Fl g Ar login_grace_time |
@@ -106,6 +106,10 @@ can be configured using command-line options or a configuration | |||
106 | file. Command-line options override values specified in the | 106 | file. Command-line options override values specified in the |
107 | configuration file. | 107 | configuration file. |
108 | .Pp | 108 | .Pp |
109 | .Nm | ||
110 | rereads its configuration file when it receives a hangup signal, | ||
111 | .Dv SIGHUP . | ||
112 | .Pp | ||
109 | The options are as follows: | 113 | The options are as follows: |
110 | .Bl -tag -width Ds | 114 | .Bl -tag -width Ds |
111 | .It Fl b Ar bits | 115 | .It Fl b Ar bits |
@@ -18,7 +18,7 @@ agent connections. | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: sshd.c,v 1.25 1999/11/18 21:25:48 damien Exp $"); | 21 | RCSID("$Id: sshd.c,v 1.26 1999/11/21 02:23:53 damien Exp $"); |
22 | 22 | ||
23 | #include "xmalloc.h" | 23 | #include "xmalloc.h" |
24 | #include "rsa.h" | 24 | #include "rsa.h" |
@@ -1753,6 +1753,11 @@ void do_authenticated(struct passwd *pw) | |||
1753 | channel_input_port_forward_request(pw->pw_uid == 0); | 1753 | channel_input_port_forward_request(pw->pw_uid == 0); |
1754 | break; | 1754 | break; |
1755 | 1755 | ||
1756 | case SSH_CMSG_MAX_PACKET_SIZE: | ||
1757 | if (packet_set_maxsize(packet_get_int()) < 0) | ||
1758 | goto fail; | ||
1759 | break; | ||
1760 | |||
1756 | case SSH_CMSG_EXEC_SHELL: | 1761 | case SSH_CMSG_EXEC_SHELL: |
1757 | /* Set interactive/non-interactive mode. */ | 1762 | /* Set interactive/non-interactive mode. */ |
1758 | packet_set_interactive(have_pty || display != NULL, | 1763 | packet_set_interactive(have_pty || display != NULL, |
@@ -1791,10 +1796,6 @@ void do_authenticated(struct passwd *pw) | |||
1791 | xfree(command); | 1796 | xfree(command); |
1792 | return; | 1797 | return; |
1793 | 1798 | ||
1794 | case SSH_CMSG_MAX_PACKET_SIZE: | ||
1795 | debug("The server does not support limiting packet size."); | ||
1796 | goto fail; | ||
1797 | |||
1798 | default: | 1799 | default: |
1799 | /* Any unknown messages in this phase are ignored, and a failure | 1800 | /* Any unknown messages in this phase are ignored, and a failure |
1800 | message is returned. */ | 1801 | message is returned. */ |