From ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8 Mon Sep 17 00:00:00 2001 From: in2 Date: Tue, 16 Dec 2003 01:42:57 +0000 Subject: set file mode to 0664 when O_CREAT in log_file() git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1412 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/stuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 90294609..6e3e5e00 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -603,7 +603,8 @@ printdash(char *mesg) int log_file(char *fn, char *buf, int ifcreate) { int fd; - if( (fd = open(fn, O_APPEND | O_WRONLY | (ifcreate ? O_CREAT : 0))) < 0 ) + if( (fd = open(fn, O_APPEND | O_WRONLY | (ifcreate ? O_CREAT : 0), + (ifcreate ? 0664 : 0))) < 0 ) return -1; if( write(fd, buf, strlen(buf)) < 0 ){ close(fd); -- cgit v1.2.3