summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 09:42:57 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-12-16 09:42:57 +0800
commitecd00f1452bbfe0305ff6ce46e1436ba4b9f2bd8 (patch)
treec4a1c091c7e3d1055e7a5c8ca269b419f1a71d7d
parent39e89de3c447236d6ea5df7295816947ab7b457f (diff)
downloadpttbbs-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.c3
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);