diff --git a/include/misc.h b/include/misc.h index b5d252bd..fad6dae5 100644 --- a/include/misc.h +++ b/include/misc.h @@ -42,10 +42,6 @@ #include "w32misc.h" #endif /* _WIN32 */ -#ifndef S_IRWUG -#define S_IRWUG S_IRGRP | S_IWGRP | S_IRUSR | S_IWUSR -#endif - #ifdef __GNUC__ #define ATTRIBUTE(attrs) __attribute__ (attrs) #else diff --git a/src/lib/common/file.c b/src/lib/common/file.c index 908b024b..eee28cef 100644 --- a/src/lib/common/file.c +++ b/src/lib/common/file.c @@ -87,7 +87,8 @@ ef_open(int type, int how, int nelt) #if defined(_WIN32) oflags |= O_BINARY; #endif - if ((fd = open(ep->file, oflags, S_IRWUG)) < 0) { + fd = open(ep->file, oflags, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + if (fd < 0) { logerror("Can't open %s (%s)", ep->file, strerror(errno)); return 0; } diff --git a/src/lib/gen/log.c b/src/lib/gen/log.c index cc525b53..de06528c 100644 --- a/src/lib/gen/log.c +++ b/src/lib/gen/log.c @@ -69,7 +69,8 @@ logopen(void) { int fd; - fd = open(logfile, O_WRONLY | O_CREAT | O_APPEND, S_IRWUG); + fd = open(logfile, O_WRONLY | O_CREAT | O_APPEND, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); if (fd < 0) logerror("Can't open %s (%s)", logfile, strerror(errno)); return fd; diff --git a/src/lib/subs/natsub.c b/src/lib/subs/natsub.c index ad4a0def..44f42d36 100644 --- a/src/lib/subs/natsub.c +++ b/src/lib/subs/natsub.c @@ -91,7 +91,8 @@ nat_reset(struct natstr *natp, enum nat_status stat, coord x, coord y) natp->nat_update = 0; natp->nat_tgms = 0; - close(creat(mailbox(buf, natp->nat_cnum), S_IRWUG)); + close(creat(mailbox(buf, natp->nat_cnum), + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)); natp->nat_ann = 0; /* FIXME number of annos */ natp->nat_btu = stat == STAT_SANCT ? max_btus : 0; diff --git a/src/util/files.c b/src/util/files.c index c247bc9f..bdb33e21 100644 --- a/src/util/files.c +++ b/src/util/files.c @@ -176,9 +176,9 @@ main(int argc, char *argv[]) } for (i = 0; i < MAXNOC; i++) { filename = mailbox(buf, i); - close(creat(filename, S_IRWUG)); + close(creat(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)); } - close(creat(annfil, S_IRWUG)); + close(creat(annfil, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)); /* create a zero-filled sector file */ memset(&sct, 0, sizeof(sct));