X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fsilcd.c;fp=apps%2Fsilcd%2Fsilcd.c;h=af9d6172b14144ce8e401f53f8a3743089cebe41;hb=568b60188d2e056df49091d653fdf55448ac7a31;hp=35693a717f1f5421c4b81c6b5baa65754a2af79c;hpb=9bfbf02a677ca6f8f1ca9d2e97aed02d308d7506;p=silc.git diff --git a/apps/silcd/silcd.c b/apps/silcd/silcd.c index 35693a71..af9d6172 100644 --- a/apps/silcd/silcd.c +++ b/apps/silcd/silcd.c @@ -402,11 +402,6 @@ int main(int argc, char **argv) silc_schedule_signal_register(silcd->schedule, SIGTERM, stop_server, NULL); silc_schedule_signal_register(silcd->schedule, SIGINT, stop_server, NULL); - /* Drop root if we are not in debug mode, so you don't need to bother about - file writing permissions and so on */ - if (!silc_debug) - silc_server_drop_privs(silcd); - if (!foreground) { /* Before running the server, fork to background. */ silc_server_daemonise(silcd); @@ -420,6 +415,11 @@ int main(int argc, char **argv) } } + /* Drop root if we are not in debug mode, so you don't need to bother about + file writing permissions and so on */ + if (!silc_debug) + silc_server_drop_privs(silcd); + /* Run the server. When this returns the server has been stopped and we will exit. */ silc_server_run(silcd);