]> git.sur5r.net Git - bacula/bacula/commitdiff
Write PID, then drop privileges
authorDan Langille <dan@langille.org>
Fri, 2 Jan 2004 17:21:21 +0000 (17:21 +0000)
committerDan Langille <dan@langille.org>
Fri, 2 Jan 2004 17:21:21 +0000 (17:21 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@982 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/dird.c
bacula/src/filed/filed.c
bacula/src/stored/stored.c

index f68da92bd2fd68e1f0c352f89aeddcbc6fed0d6a..f47e5a959c2f8bf122b48f3eba070fac5318d685 100644 (file)
@@ -206,11 +206,11 @@ int main (int argc, char *argv[])
       init_stack_dump();             /* grab new pid */
    }
 
-   drop(uid, gid);                   /* reduce priveleges if requested */
-
    /* Create pid must come after we are a daemon -- so we have our final pid */
    create_pid_file(director->pid_directory, "bacula-dir", director->DIRport);
 
+   drop(uid, gid);                   /* reduce priveleges if requested */
+
 /* signal(SIGHUP, reload_config); */
 
    init_console_msg(working_directory);
index 61c6ea2f3d2d4c011e323908e179e1d526db0709..02165f8a251deda43035a53dbaad3c9ec6bf8018 100644 (file)
@@ -211,11 +211,11 @@ Without that I don't know who I am :-(\n"), configfile);
       init_stack_dump();             /* set new pid */
    }
 
-   drop(uid, gid);
-
    /* Maximum 1 daemon at a time */
    create_pid_file(me->pid_directory, "bacula-fd", me->FDport);
 
+   drop(uid, gid);
+
 #ifdef BOMB
    me += 1000000;
 #endif
index c3690464dcf198a8436e3d91d41d51ed3acded04..0c81761050b24064b329461cdc0ad6fccddb89da 100644 (file)
@@ -185,10 +185,10 @@ int main (int argc, char *argv[])
       init_stack_dump();             /* pick up new pid */
    }
 
-   drop(uid, gid);
-
    create_pid_file(me->pid_directory, "bacula-sd", me->SDport);
 
+   drop(uid, gid);
+
    /* Ensure that Volume Session Time and Id are both
     * set and are both non-zero.
     */