# HG changeset patch # User Matt Johnston # Date 1167876069 0 # Node ID b66a00272a907763d30b0b4b637a3c234491cfde # Parent a124aff0cbf17ee7dbe85149792dbf6c0ee3737f Load hostkeys before daemon(), since daemon()'s chdir("/") will prevent us finding keys in $PWD. diff -r a124aff0cbf1 -r b66a00272a90 svr-main.c --- a/svr-main.c Wed Dec 06 13:11:41 2006 +0000 +++ b/svr-main.c Thu Jan 04 02:01:09 2007 +0000 @@ -123,6 +123,10 @@ int childsock; int childpipe[2]; + // Note: commonsetup() must happen before we daemon()ise. Otherwise + // daemon() will chdir("/"), and we won't be able to find local-dir hostkeys. + commonsetup(); + /* fork */ if (svr_opts.forkbg) { int closefds = 0; @@ -136,8 +140,6 @@ } } - commonsetup(); - /* should be done after syslog is working */ if (svr_opts.forkbg) { dropbear_log(LOG_INFO, "Running in background");