From e52f6fc409c05c184abdfcdab1204882b4b8be72 Mon Sep 17 00:00:00 2001 From: Giovanni Giacobbi Date: Wed, 17 Apr 2002 20:10:33 +0000 Subject: [PATCH] Fixed a bug in the pid writing function, which couldn't be written in a root-owned directory. --- CHANGES | 5 +++++ apps/silcd/silcd.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index d7d67dc1..316fbf2e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Wed Apr 17 22:07:59 CEST 2002 Johnny Mnemonic + + * Fixed a bug in the pid writing function, which couldn't be + written in a root-owned directory. + Tue Apr 16 09:34:40 EEST 2002 Pekka Riikonen * Defined that channel message to unknown Channel ID must diff --git a/apps/silcd/silcd.c b/apps/silcd/silcd.c index 8915ab1b..bb8dc0d4 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); -- 2.24.0