From 8d421e4bd6203d87b22a0c72e971ec7c32dfb021 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 1 Sep 2000 13:37:16 +0000 Subject: [PATCH] * control.c: chown citadel.control to bbsuid when opening/creating as root --- citadel/ChangeLog | 4 +++- citadel/control.c | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 2ae6e5397..dce8b3c48 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/control.c b/citadel/control.c index e9452d4e4..950df391d 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -17,6 +17,7 @@ #include #include #include +#include #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); -- 2.39.2