diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-16 09:42:57 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-16 09:42:57 +0800 |
commit | ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8 (patch) | |
tree | c4a1c091c7e3d1055e7a5c8ca269b419f1a71d7d | |
parent | 39e89de3c447236d6ea5df7295816947ab7b457f (diff) | |
download | pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar.gz pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar.bz2 pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar.lz pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar.xz pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.tar.zst pttbbs-ecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8.zip |
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
-rw-r--r-- | mbbsd/stuff.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |