summaryrefslogtreecommitdiff
path: root/svr-main.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2008-09-12 17:23:56 +0000
committerMatt Johnston <matt@ucc.asn.au>2008-09-12 17:23:56 +0000
commit31fa5e605b6d42d670945c1821caf8b887623fa1 (patch)
treeaf6c0d623d5a7c737d4b59c47d58e399c328b988 /svr-main.c
parentc0ce2a6a97af66881675916c504af9caed2f9c2e (diff)
downloaddropbear-31fa5e605b6d42d670945c1821caf8b887623fa1.tar.gz
- Rework pubkey options to be more careful about buffer lengths. Needs review.
--HG-- branch : pubkey-options extra : convert_revision : 537a6ebebb46424b967ffe787f0f8560e5f447e8
Diffstat (limited to 'svr-main.c')
-rw-r--r--svr-main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/svr-main.c b/svr-main.c
index f7ce221..8d57084 100644
--- a/svr-main.c
+++ b/svr-main.c
@@ -266,7 +266,11 @@ void main_noinetd() {
goto out;
}
+#ifdef DEBUG_NOFORK
+ fork_ret = 0;
+#else
fork_ret = fork();
+#endif
if (fork_ret < 0) {
dropbear_log(LOG_WARNING, "error forking: %s", strerror(errno));
goto out;
@@ -292,9 +296,11 @@ void main_noinetd() {
addrstring = getaddrstring(&remoteaddr, 1);
dropbear_log(LOG_INFO, "Child connection from %s", addrstring);
+#ifndef DEBUG_NOFORK
if (setsid() < 0) {
dropbear_exit("setsid: %s", strerror(errno));
}
+#endif
/* make sure we close sockets */
for (i = 0; i < listensockcount; i++) {