diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.134 2000/11/12 19:50:38 markus Exp $"); | 43 | RCSID("$OpenBSD: sshd.c,v 1.135 2000/11/29 21:11:59 markus Exp $"); |
44 | 44 | ||
45 | #include "xmalloc.h" | 45 | #include "xmalloc.h" |
46 | #include "rsa.h" | 46 | #include "rsa.h" |
@@ -111,6 +111,9 @@ int debug_flag = 0; | |||
111 | /* Flag indicating that the daemon is being started from inetd. */ | 111 | /* Flag indicating that the daemon is being started from inetd. */ |
112 | int inetd_flag = 0; | 112 | int inetd_flag = 0; |
113 | 113 | ||
114 | /* Flag indicating that sshd should not detach and become a daemon. */ | ||
115 | int no_daemon_flag = 0; | ||
116 | |||
114 | /* debug goes to stderr unless inetd_flag is set */ | 117 | /* debug goes to stderr unless inetd_flag is set */ |
115 | int log_stderr = 0; | 118 | int log_stderr = 0; |
116 | 119 | ||
@@ -583,7 +586,7 @@ main(int ac, char **av) | |||
583 | initialize_server_options(&options); | 586 | initialize_server_options(&options); |
584 | 587 | ||
585 | /* Parse command-line arguments. */ | 588 | /* Parse command-line arguments. */ |
586 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:diqQ46")) != EOF) { | 589 | while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:dDiqQ46")) != EOF) { |
587 | switch (opt) { | 590 | switch (opt) { |
588 | case '4': | 591 | case '4': |
589 | IPv4or6 = AF_INET; | 592 | IPv4or6 = AF_INET; |
@@ -605,6 +608,9 @@ main(int ac, char **av) | |||
605 | exit(1); | 608 | exit(1); |
606 | } | 609 | } |
607 | break; | 610 | break; |
611 | case 'D': | ||
612 | no_daemon_flag = 1; | ||
613 | break; | ||
608 | case 'i': | 614 | case 'i': |
609 | inetd_flag = 1; | 615 | inetd_flag = 1; |
610 | break; | 616 | break; |
@@ -769,7 +775,7 @@ main(int ac, char **av) | |||
769 | * from the controlling terminal, and fork. The original process | 775 | * from the controlling terminal, and fork. The original process |
770 | * exits. | 776 | * exits. |
771 | */ | 777 | */ |
772 | if (!debug_flag && !inetd_flag) { | 778 | if (!(debug_flag || inetd_flag || no_daemon_flag)) { |
773 | #ifdef TIOCNOTTY | 779 | #ifdef TIOCNOTTY |
774 | int fd; | 780 | int fd; |
775 | #endif /* TIOCNOTTY */ | 781 | #endif /* TIOCNOTTY */ |