+1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
+ * setup.c: create citadel.config with mode 0600
+
Wed Dec 2 20:37:05 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* msgbase.c: modified AddMessageToRoom() and all functions that call it
to use a more reliable/accurate method to set quickroom.QRhighest
*/
void write_config_to_disk(void) {
FILE *fp;
+ int fd;
- fp=fopen("citadel.config","wb");
+ if ((fd = creat("citadel.config", S_IRUSR | S_IWUSR)) == -1) {
+ display_error("setup: cannot open citadel.config");
+ cleanup(1);
+ }
+
+ fp=fdopen(fd,"wb");
if (fp==NULL) {
display_error("setup: cannot open citadel.config");
cleanup(1);
* completely new copy. (Neat, eh?)
*/
- fp=fopen("citadel.config","ab");
+ if ((a = open("citadel.config", O_WRONLY | O_CREAT | O_APPEND,
+ S_IRUSR | S_IWUSR)) == -1) {
+ display_error("setup: cannot append citadel.config");
+ cleanup(errno);
+ }
+
+ fp=fdopen(a,"ab");
if (fp==NULL) {
display_error("setup: cannot append citadel.config");
cleanup(errno);