--- siproxd-0.7.1.orig/src/siproxd.c	2008-11-17 11:05:39.000000000 +0000
+++ siproxd-0.7.1/src/siproxd.c	2008-11-17 11:07:18.000000000 +0000
@@ -304,13 +304,13 @@
       if (pidfilename) createpidfile(pidfilename);
    }
 
-   /* change user and group IDs */
-   secure_enviroment();
-
-   /* write PID file of main thread as changed siproxd user and
+   /* write PID file of main thread as root and
     * possibly into the chroot jail file tree  */
    if (pidfilename) createpidfile(pidfilename);
 
+   /* change user and group IDs */
+   secure_enviroment();
+
    /* initialize the RTP proxy */
    sts=rtpproxy_init();
    if (sts != STS_SUCCESS) {
