summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sshd.c b/sshd.c
index 4a5f66278..4a01ebec7 100644
--- a/sshd.c
+++ b/sshd.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: sshd.c,v 1.134 2000/11/12 19:50:38 markus Exp $"); 43RCSID("$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. */
112int inetd_flag = 0; 112int inetd_flag = 0;
113 113
114/* Flag indicating that sshd should not detach and become a daemon. */
115int 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 */
115int log_stderr = 0; 118int 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 */