when not forking, we fail to drop rood privileges in advance before writing netconfig...
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 5 Jun 2011 21:20:17 +0000 (21:20 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 5 Jun 2011 21:20:17 +0000 (21:20 +0000)
citadel/modules/network/serv_network.c

index b9451547e4bc5bcb275334dc599cd87f9bb8ea04..5dd3a9523a0706a22df38d1c09e168e690aa6bdc 100644 (file)
@@ -1137,13 +1137,14 @@ int writenfree_spoolcontrol_file(SpoolControl **scc, char *filename)
                unlink(tempfilename);
        }
        else {
+               fchown(TmpFD, config.c_ctdluid, 0);
                StrBufAppendPrintf(Cfg, "lastsent|%ld\n", sc->lastsent);
-
+               
                /* Write out the listrecps while freeing from memory at the
                 * same time.  Am I clever or what?  :)
                 */
                while (sc->listrecps != NULL) {
-                       StrBufAppendPrintf(Cfg, "listrecp|%s\n", sc->listrecps->name);
+                   StrBufAppendPrintf(Cfg, "listrecp|%s\n", sc->listrecps->name);
                        nptr = sc->listrecps->next;
                        free(sc->listrecps);
                        sc->listrecps = nptr;
@@ -1287,7 +1288,7 @@ void network_spoolout_room(char *room_to_spool) {
        }
 
        /* Now rewrite the config file */
-       writenfree_spoolcontrol_file (&sc, filename);
+       writenfree_spoolcontrol_file(&sc, filename);
        end_critical_section(S_NETCONFIGS);
 }