diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-12-06 18:22:17 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-12-06 18:22:17 +0000 |
commit | ade03f6bad77faf80441396eb41134489454e1c1 (patch) | |
tree | 2d49b6124b798fba1a52482a228017fde6f7118b /sshd.c | |
parent | 9eab262f1ce2e54f7e5d2b75477a606c33e8bc0a (diff) |
- markus@cvs.openbsd.org 2001/12/06 13:30:06
[servconf.c servconf.h sshd.8 sshd.c]
add -o to sshd, too. ok deraadt@
- (bal) Minor white space fix up in servconf.c
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 55 |
1 files changed, 34 insertions, 21 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.214 2001/12/05 10:06:13 deraadt Exp $"); | 43 | RCSID("$OpenBSD: sshd.c,v 1.215 2001/12/06 13:30:06 markus Exp $"); |
44 | 44 | ||
45 | #include <openssl/dh.h> | 45 | #include <openssl/dh.h> |
46 | #include <openssl/bn.h> | 46 | #include <openssl/bn.h> |
@@ -543,6 +543,31 @@ drop_connection(int startups) | |||
543 | return (r < p) ? 1 : 0; | 543 | return (r < p) ? 1 : 0; |
544 | } | 544 | } |
545 | 545 | ||
546 | static void | ||
547 | usage(void) | ||
548 | { | ||
549 | fprintf(stderr, "sshd version %s\n", SSH_VERSION); | ||
550 | fprintf(stderr, "Usage: %s [options]\n", __progname); | ||
551 | fprintf(stderr, "Options:\n"); | ||
552 | fprintf(stderr, " -f file Configuration file (default %s)\n", _PATH_SERVER_CONFIG_FILE); | ||
553 | fprintf(stderr, " -d Debugging mode (multiple -d means more debugging)\n"); | ||
554 | fprintf(stderr, " -i Started from inetd\n"); | ||
555 | fprintf(stderr, " -D Do not fork into daemon mode\n"); | ||
556 | fprintf(stderr, " -t Only test configuration file and keys\n"); | ||
557 | fprintf(stderr, " -q Quiet (no logging)\n"); | ||
558 | fprintf(stderr, " -p port Listen on the specified port (default: 22)\n"); | ||
559 | fprintf(stderr, " -k seconds Regenerate server key every this many seconds (default: 3600)\n"); | ||
560 | fprintf(stderr, " -g seconds Grace period for authentication (default: 600)\n"); | ||
561 | fprintf(stderr, " -b bits Size of server RSA key (default: 768 bits)\n"); | ||
562 | fprintf(stderr, " -h file File from which to read host key (default: %s)\n", | ||
563 | _PATH_HOST_KEY_FILE); | ||
564 | fprintf(stderr, " -u len Maximum hostname length for utmp recording\n"); | ||
565 | fprintf(stderr, " -4 Use IPv4 only\n"); | ||
566 | fprintf(stderr, " -6 Use IPv6 only\n"); | ||
567 | fprintf(stderr, " -o option Process the option as if it was read from a configuration file.\n"); | ||
568 | exit(1); | ||
569 | } | ||
570 | |||
546 | /* | 571 | /* |
547 | * Main program for the daemon. | 572 | * Main program for the daemon. |
548 | */ | 573 | */ |
@@ -579,7 +604,7 @@ main(int ac, char **av) | |||
579 | initialize_server_options(&options); | 604 | initialize_server_options(&options); |
580 | 605 | ||
581 | /* Parse command-line arguments. */ | 606 | /* Parse command-line arguments. */ |
582 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:dDeiqtQ46")) != -1) { | 607 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:o:dDeiqtQ46")) != -1) { |
583 | switch (opt) { | 608 | switch (opt) { |
584 | case '4': | 609 | case '4': |
585 | IPv4or6 = AF_INET; | 610 | IPv4or6 = AF_INET; |
@@ -661,27 +686,15 @@ main(int ac, char **av) | |||
661 | case 'u': | 686 | case 'u': |
662 | utmp_len = atoi(optarg); | 687 | utmp_len = atoi(optarg); |
663 | break; | 688 | break; |
689 | case 'o': | ||
690 | if (process_server_config_line(&options, optarg, | ||
691 | "command-line", 0) != 0) | ||
692 | exit(1); | ||
693 | break; | ||
664 | case '?': | 694 | case '?': |
665 | default: | 695 | default: |
666 | fprintf(stderr, "sshd version %s\n", SSH_VERSION); | 696 | usage(); |
667 | fprintf(stderr, "Usage: %s [options]\n", __progname); | 697 | break; |
668 | fprintf(stderr, "Options:\n"); | ||
669 | fprintf(stderr, " -f file Configuration file (default %s)\n", _PATH_SERVER_CONFIG_FILE); | ||
670 | fprintf(stderr, " -d Debugging mode (multiple -d means more debugging)\n"); | ||
671 | fprintf(stderr, " -i Started from inetd\n"); | ||
672 | fprintf(stderr, " -D Do not fork into daemon mode\n"); | ||
673 | fprintf(stderr, " -t Only test configuration file and keys\n"); | ||
674 | fprintf(stderr, " -q Quiet (no logging)\n"); | ||
675 | fprintf(stderr, " -p port Listen on the specified port (default: 22)\n"); | ||
676 | fprintf(stderr, " -k seconds Regenerate server key every this many seconds (default: 3600)\n"); | ||
677 | fprintf(stderr, " -g seconds Grace period for authentication (default: 600)\n"); | ||
678 | fprintf(stderr, " -b bits Size of server RSA key (default: 768 bits)\n"); | ||
679 | fprintf(stderr, " -h file File from which to read host key (default: %s)\n", | ||
680 | _PATH_HOST_KEY_FILE); | ||
681 | fprintf(stderr, " -u len Maximum hostname length for utmp recording\n"); | ||
682 | fprintf(stderr, " -4 Use IPv4 only\n"); | ||
683 | fprintf(stderr, " -6 Use IPv6 only\n"); | ||
684 | exit(1); | ||
685 | } | 698 | } |
686 | } | 699 | } |
687 | SSLeay_add_all_algorithms(); | 700 | SSLeay_add_all_algorithms(); |