summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-16 13:29:08 +1100
committerDamien Miller <djm@mindrot.org>2000-09-16 13:29:08 +1100
commite4340be5b3ff16f4d9ba5e3ea7e449dc1b6fa7a8 (patch)
treeaba9e2ae234edeb888b922c6a13b755c1248deea /sshd.c
parentf384c366d33cb435627743f7ea0ed3f966543d40 (diff)
- (djm) Merge OpenBSD changes:
- markus@cvs.openbsd.org 2000/09/05 02:59:57 [session.c] print hostname (not hushlogin) - markus@cvs.openbsd.org 2000/09/05 13:18:48 [authfile.c ssh-add.c] enable ssh-add -d for DSA keys - markus@cvs.openbsd.org 2000/09/05 13:20:49 [sftp-server.c] cleanup - markus@cvs.openbsd.org 2000/09/06 03:46:41 [authfile.h] prototype - deraadt@cvs.openbsd.org 2000/09/07 14:27:56 [ALL] cleanup copyright notices on all files. I have attempted to be accurate with the details. everything is now under Tatu's licence (which I copied from his readme), and/or the core-sdi bsd-ish thing for deattack, or various openbsd developers under a 2-term bsd licence. We're not changing any rules, just being accurate. - markus@cvs.openbsd.org 2000/09/07 14:40:30 [channels.c channels.h clientloop.c serverloop.c ssh.c] cleanup window and packet sizes for ssh2 flow control; ok niels - markus@cvs.openbsd.org 2000/09/07 14:53:00 [scp.c] typo - markus@cvs.openbsd.org 2000/09/07 15:13:37 [auth-options.c auth-options.h auth-rh-rsa.c auth-rsa.c auth.c] [authfile.h canohost.c channels.h compat.c hostfile.h log.c match.h] [pty.c readconf.c] some more Copyright fixes - markus@cvs.openbsd.org 2000/09/08 03:02:51 [README.openssh2] bye bye - deraadt@cvs.openbsd.org 2000/09/11 18:38:33 [LICENCE cipher.c] a few more comments about it being ARC4 not RC4 - markus@cvs.openbsd.org 2000/09/12 14:53:11 [log-client.c log-server.c log.c ssh.1 ssh.c ssh.h sshd.8 sshd.c] multiple debug levels - markus@cvs.openbsd.org 2000/09/14 14:25:15 [clientloop.c] typo - deraadt@cvs.openbsd.org 2000/09/15 01:13:51 [ssh-agent.c] check return value for setenv(3) for failure, and deal appropriately
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c61
1 files changed, 48 insertions, 13 deletions
diff --git a/sshd.c b/sshd.c
index f01df902a..e94b5d11d 100644
--- a/sshd.c
+++ b/sshd.c
@@ -2,19 +2,45 @@
2 * Author: Tatu Ylonen <ylo@cs.hut.fi> 2 * Author: Tatu Ylonen <ylo@cs.hut.fi>
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
5 * Created: Fri Mar 17 17:09:28 1995 ylo 5 * This program is the ssh daemon. It listens for connections from clients,
6 * This program is the ssh daemon. It listens for connections from clients, and 6 * and performs authentication, executes use commands or shell, and forwards
7 * performs authentication, executes use commands or shell, and forwards
8 * information to/from the application to the user client over an encrypted 7 * information to/from the application to the user client over an encrypted
9 * connection. This can also handle forwarding of X11, TCP/IP, and authentication 8 * connection. This can also handle forwarding of X11, TCP/IP, and
10 * agent connections. 9 * authentication agent connections.
11 * 10 *
12 * SSH2 implementation, 11 * As far as I am concerned, the code I have written for this software
13 * Copyright (c) 2000 Markus Friedl. All rights reserved. 12 * can be used freely for any purpose. Any derived versions of this
13 * software must be clearly marked as such, and if the derived work is
14 * incompatible with the protocol description in the RFC file, it must be
15 * called by a name other than "ssh" or "Secure Shell".
16 *
17 * SSH2 implementation:
18 *
19 * Copyright (c) 2000 Markus Friedl. All rights reserved.
20 *
21 * Redistribution and use in source and binary forms, with or without
22 * modification, are permitted provided that the following conditions
23 * are met:
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
31 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
34 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
35 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 */ 40 */
15 41
16#include "includes.h" 42#include "includes.h"
17RCSID("$OpenBSD: sshd.c,v 1.125 2000/08/17 20:06:34 markus Exp $"); 43RCSID("$OpenBSD: sshd.c,v 1.127 2000/09/12 20:53:10 markus Exp $");
18 44
19#include "xmalloc.h" 45#include "xmalloc.h"
20#include "rsa.h" 46#include "rsa.h"
@@ -485,8 +511,15 @@ main(int ac, char **av)
485 config_file_name = optarg; 511 config_file_name = optarg;
486 break; 512 break;
487 case 'd': 513 case 'd':
488 debug_flag = 1; 514 if (0 == debug_flag) {
489 options.log_level = SYSLOG_LEVEL_DEBUG; 515 debug_flag = 1;
516 options.log_level = SYSLOG_LEVEL_DEBUG1;
517 } else if (options.log_level < SYSLOG_LEVEL_DEBUG3) {
518 options.log_level++;
519 } else {
520 fprintf(stderr, "Too high debugging level.\n");
521 exit(1);
522 }
490 break; 523 break;
491 case 'i': 524 case 'i':
492 inetd_flag = 1; 525 inetd_flag = 1;
@@ -502,8 +535,10 @@ main(int ac, char **av)
502 break; 535 break;
503 case 'p': 536 case 'p':
504 options.ports_from_cmdline = 1; 537 options.ports_from_cmdline = 1;
505 if (options.num_ports >= MAX_PORTS) 538 if (options.num_ports >= MAX_PORTS) {
506 fatal("too many ports.\n"); 539 fprintf(stderr, "too many ports.\n");
540 exit(1);
541 }
507 options.ports[options.num_ports++] = atoi(optarg); 542 options.ports[options.num_ports++] = atoi(optarg);
508 break; 543 break;
509 case 'g': 544 case 'g':
@@ -529,7 +564,7 @@ main(int ac, char **av)
529 fprintf(stderr, "Usage: %s [options]\n", av0); 564 fprintf(stderr, "Usage: %s [options]\n", av0);
530 fprintf(stderr, "Options:\n"); 565 fprintf(stderr, "Options:\n");
531 fprintf(stderr, " -f file Configuration file (default %s)\n", SERVER_CONFIG_FILE); 566 fprintf(stderr, " -f file Configuration file (default %s)\n", SERVER_CONFIG_FILE);
532 fprintf(stderr, " -d Debugging mode\n"); 567 fprintf(stderr, " -d Debugging mode (multiple -d means more debugging)\n");
533 fprintf(stderr, " -i Started from inetd\n"); 568 fprintf(stderr, " -i Started from inetd\n");
534 fprintf(stderr, " -q Quiet (no logging)\n"); 569 fprintf(stderr, " -q Quiet (no logging)\n");
535 fprintf(stderr, " -p port Listen on the specified port (default: 22)\n"); 570 fprintf(stderr, " -p port Listen on the specified port (default: 22)\n");