]> code.citadel.org Git - citadel.git/commitdiff
* control.c: chown citadel.control to bbsuid when opening/creating as root
authorArt Cancro <ajc@citadel.org>
Fri, 1 Sep 2000 13:37:16 +0000 (13:37 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Sep 2000 13:37:16 +0000 (13:37 +0000)
citadel/ChangeLog
citadel/control.c

index 2ae6e53979e282f82dfc88b4cc28f23da385f048..dce8b3c484b94a6b374a89851a984a309a8f32c6 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 572.36  2000/09/01 13:37:16  ajc
+ * control.c: chown citadel.control to bbsuid when opening/creating as root
+
  Revision 572.35  2000/09/01 03:55:44  ajc
  * Fixed a few more references to the deprecated uncnsrd.mt-kisco.ny.us name
 
@@ -2027,4 +2030,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index e9452d4e498c9df8825e9f8aac59b37bc842cc95..950df391ddd42f52d12809a0492da030b1905c4e 100644 (file)
@@ -17,6 +17,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <syslog.h>
+#include <sys/types.h>
 #include "citadel.h"
 #include "server.h"
 #include "control.h"
@@ -41,11 +42,14 @@ void get_control(void) {
         * to zero.
         */
        memset(&CitControl, 0, sizeof(struct CitControl));
-       if (control_fp == NULL)
+       if (control_fp == NULL) {
                control_fp = fopen("citadel.control", "rb+");
+               fchown(fileno(control_fp), config.c_bbsuid, -1);
+       }
        if (control_fp == NULL) {
                control_fp = fopen("citadel.control", "wb+");
                if (control_fp != NULL) {
+                       fchown(fileno(control_fp), config.c_bbsuid, -1);
                        memset(&CitControl, 0, sizeof(struct CitControl));
                        fwrite(&CitControl, sizeof(struct CitControl),
                                1, control_fp);