summaryrefslogtreecommitdiffstats
path: root/sshd.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-08-06 23:09:07 +0200
committerBen Lindstrom <mouring@eviladmin.org>2001-08-06 23:09:07 +0200
commit794325ac7a490d02c9ce5c0ad3093e1874df59a0 (patch)
treedafbde2bec0ae7b2d1b84e85f685793751ca4f9e /sshd.c
parent - markus@cvs.openbsd.org 2001/07/25 14:35:18 (diff)
downloadopenssh-794325ac7a490d02c9ce5c0ad3093e1874df59a0.tar.xz
openssh-794325ac7a490d02c9ce5c0ad3093e1874df59a0.zip
- stevesk@cvs.openbsd.org 2001/07/26 17:18:22
[sshd.8 sshd.c] add -t option to test configuration file and keys; pekkas@netcore.fi ok markus@
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index dd5d7ab2c..d1c68445d 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.202 2001/06/26 16:15:25 dugsong Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.203 2001/07/26 17:18:22 stevesk Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -113,6 +113,9 @@ int IPv4or6 = AF_UNSPEC;
*/
int debug_flag = 0;
+/* Flag indicating that the daemon should only test the configuration and keys. */
+int test_flag = 0;
+
/* Flag indicating that the daemon is being started from inetd. */
int inetd_flag = 0;
@@ -560,7 +563,7 @@ main(int ac, char **av)
initialize_server_options(&options);
/* Parse command-line arguments. */
- while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:dDeiqQ46")) != -1) {
+ while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:dDeiqtQ46")) != -1) {
switch (opt) {
case '4':
IPv4or6 = AF_INET;
@@ -636,6 +639,9 @@ main(int ac, char **av)
/* only makes sense with inetd_flag, i.e. no listen() */
inetd_flag = 1;
break;
+ case 't':
+ test_flag = 1;
+ break;
case 'u':
utmp_len = atoi(optarg);
break;
@@ -648,6 +654,7 @@ main(int ac, char **av)
fprintf(stderr, " -d Debugging mode (multiple -d means more debugging)\n");
fprintf(stderr, " -i Started from inetd\n");
fprintf(stderr, " -D Do not fork into daemon mode\n");
+ fprintf(stderr, " -t Only test configuration file and keys\n");
fprintf(stderr, " -q Quiet (no logging)\n");
fprintf(stderr, " -p port Listen on the specified port (default: 22)\n");
fprintf(stderr, " -k seconds Regenerate server key every this many seconds (default: 3600)\n");
@@ -755,6 +762,10 @@ main(int ac, char **av)
}
}
+ /* Configuration looks good, so exit if in test mode. */
+ if (test_flag)
+ exit(0);
+
#ifdef HAVE_SCO_PROTECTED_PW
(void) set_auth_parameters(ac, av);
#endif