summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-29 01:25:29 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-10-29 01:25:29 +0800
commit83096a0eb381652a5a36c054d01ec693eab906d9 (patch)
treecf6e81ac02c198324c71f4ba6d0c014869ed71f3
parent8f49f93720332c7218e281f38d1cf28b6e86d26b (diff)
downloadpttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar.gz
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar.bz2
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar.lz
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar.xz
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.tar.zst
pttbbs-83096a0eb381652a5a36c054d01ec693eab906d9.zip
unify file and directory creation mode.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5176 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/common/sys/file.c12
-rw-r--r--pttbbs/common/sys/log.c2
-rw-r--r--pttbbs/innbbsd/bbslib.c2
-rw-r--r--pttbbs/innbbsd/bbsnnrp.c4
-rw-r--r--pttbbs/innbbsd/echobbslib.c2
-rw-r--r--pttbbs/innbbsd/receive_article.c2
-rw-r--r--pttbbs/mbbsd/bbs.c2
-rw-r--r--pttbbs/mbbsd/chicken.c2
-rw-r--r--pttbbs/mbbsd/edit.c2
-rw-r--r--pttbbs/mbbsd/fav.c2
-rw-r--r--pttbbs/mbbsd/pmore.c2
-rw-r--r--pttbbs/mbbsd/read.c2
-rw-r--r--pttbbs/mbbsd/register.c6
-rw-r--r--pttbbs/mbbsd/vote.c4
-rw-r--r--pttbbs/trans/itoc_trans.c2
-rw-r--r--pttbbs/trans/sob_trans.c2
-rw-r--r--pttbbs/upgrade/merge_sob.c2
-rw-r--r--pttbbs/upgrade/r2014_angel.c4
-rw-r--r--pttbbs/upgrade/r2275_passwd.c2
-rw-r--r--pttbbs/upgrade/r2342_limits.c2
-rw-r--r--pttbbs/upgrade/r4194_passwd.c2
-rw-r--r--pttbbs/upgrade/r4826_numlogin.c2
-rw-r--r--pttbbs/upgrade/r4848_watermode.c2
-rw-r--r--pttbbs/upgrade/r4856_adbanner.c2
-rw-r--r--pttbbs/upgrade/r4871_uflag.c2
-rw-r--r--pttbbs/util/buildAnnounce.c4
-rw-r--r--pttbbs/util/cleanpasswd.c2
-rw-r--r--pttbbs/util/inndBM.c2
-rw-r--r--pttbbs/util/tunepasswd.c2
-rw-r--r--pttbbs/util/xchatd.c2
30 files changed, 41 insertions, 41 deletions
diff --git a/pttbbs/common/sys/file.c b/pttbbs/common/sys/file.c
index 2165e7b5..e42b8c62 100644
--- a/pttbbs/common/sys/file.c
+++ b/pttbbs/common/sys/file.c
@@ -112,7 +112,7 @@ int copy_file_to_file(const char *src, const char *dst)
if ((fdr = open(src, O_RDONLY)) < 0)
return -1;
- if ((fdw = open(dst, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0) {
+ if ((fdw = open(dst, O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0) {
close(fdr);
return -1;
}
@@ -151,7 +151,7 @@ int copy_dir_to_dir(const char *src, const char *dst)
char buf[PATH_MAX], buf2[PATH_MAX];
if (stat(dst, &st) < 0)
- if (mkdir(dst, 0700) < 0)
+ if (mkdir(dst, 0755) < 0)
return -1;
if ((dir = opendir(src)) == NULL)
@@ -166,7 +166,7 @@ int copy_dir_to_dir(const char *src, const char *dst)
if (stat(buf, &st) < 0)
continue;
if (S_ISDIR(st.st_mode))
- mkdir(buf2, 0700);
+ mkdir(buf2, 0755);
copy_file(buf, buf2);
}
@@ -236,7 +236,7 @@ Copy(const char *src, const char *dst)
char buf[8192];
fi=open(src, O_RDONLY);
if(fi<0) return -1;
- fo=open(dst, O_WRONLY | O_TRUNC | O_CREAT, 0600);
+ fo=open(dst, O_WRONLY | O_TRUNC | O_CREAT, 0644);
if(fo<0) {close(fi); return -1;}
while((bytes=read(fi, buf, sizeof(buf)))>0)
write(fo, buf, bytes);
@@ -254,7 +254,7 @@ CopyN(const char *src, const char *dst, int n)
fi=open(src, O_RDONLY);
if(fi<0) return -1;
- fo=open(dst, O_WRONLY | O_TRUNC | O_CREAT, 0600);
+ fo=open(dst, O_WRONLY | O_TRUNC | O_CREAT, 0644);
if(fo<0) {close(fi); return -1;}
while(n > 0 && (bytes=read(fi, buf, sizeof(buf)))>0)
@@ -279,7 +279,7 @@ AppendTail(const char *src, const char *dst, int off)
fi=open(src, O_RDONLY);
if(fi<0) return -1;
- fo=open(dst, O_WRONLY | O_APPEND | O_CREAT, 0600);
+ fo=open(dst, O_WRONLY | O_APPEND | O_CREAT, 0644);
if(fo<0) {close(fi); return -1;}
// flock(dst, LOCK_SH);
diff --git a/pttbbs/common/sys/log.c b/pttbbs/common/sys/log.c
index bfaf2e13..7fa94d77 100644
--- a/pttbbs/common/sys/log.c
+++ b/pttbbs/common/sys/log.c
@@ -24,7 +24,7 @@ log_file(const char *fn, int log_flag, const char *msg)
{
int fd;
int flag = O_APPEND | O_WRONLY;
- int mode = 0664;
+ int mode = 0644;
if (log_flag & LOG_CREAT)
flag |= O_CREAT;
diff --git a/pttbbs/innbbsd/bbslib.c b/pttbbs/innbbsd/bbslib.c
index 1bc0db3c..7d45734b 100644
--- a/pttbbs/innbbsd/bbslib.c
+++ b/pttbbs/innbbsd/bbslib.c
@@ -244,7 +244,7 @@ initial_bbs(char *outgoing)
while (fscanf(FN, "%s", MYBBSID) != EOF);
fclose(FN);
if (!dashd(fileglue("%s/out.going", BBSHOME))) {
- mkdir((char *)fileglue("%s/out.going", BBSHOME), 0750);
+ mkdir((char *)fileglue("%s/out.going", BBSHOME), 0755);
}
if (NONENEWSFEEDS == 0)
readnffile(INNDHOME);
diff --git a/pttbbs/innbbsd/bbsnnrp.c b/pttbbs/innbbsd/bbsnnrp.c
index 2ecd8b77..84b05b48 100644
--- a/pttbbs/innbbsd/bbsnnrp.c
+++ b/pttbbs/innbbsd/bbsnnrp.c
@@ -592,10 +592,10 @@ flushrc(bbsnnrp)
myrename(bak1, (char *)fileglue("%s.BAK.OLD", bbsnnrp->activefile));
}
#ifdef USE_MMAP
- if ((backfd = open((char *)fileglue("%s.BAK", bbsnnrp->activefile), O_WRONLY | O_TRUNC | O_CREAT, 0664)) < 0 || write(backfd, bbsnnrp->actpointer, bbsnnrp->actsize) < bbsnnrp->actsize)
+ if ((backfd = open((char *)fileglue("%s.BAK", bbsnnrp->activefile), O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0 || write(backfd, bbsnnrp->actpointer, bbsnnrp->actsize) < bbsnnrp->actsize)
#else
myrename(bbsnnrp->activefile, bak1);
- if ((backfd = open(bbsnnrp->activefile, O_WRONLY | O_TRUNC | O_CREAT, 0664)) < 0 || write(backfd, bbsnnrp->actpointer, bbsnnrp->actsize) < bbsnnrp->actsize)
+ if ((backfd = open(bbsnnrp->activefile, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0 || write(backfd, bbsnnrp->actpointer, bbsnnrp->actsize) < bbsnnrp->actsize)
#endif
{
char emergent[128];
diff --git a/pttbbs/innbbsd/echobbslib.c b/pttbbs/innbbsd/echobbslib.c
index 7a82f417..ca93ef51 100644
--- a/pttbbs/innbbsd/echobbslib.c
+++ b/pttbbs/innbbsd/echobbslib.c
@@ -244,7 +244,7 @@ initial_bbs(char *outgoing)
while (fscanf(FN, "%s", MYBBSID) != EOF);
fclose(FN);
if (!dashd(fileglue("%s/out.going", BBSHOME))) {
- mkdir((char *)fileglue("%s/out.going", BBSHOME), 0750);
+ mkdir((char *)fileglue("%s/out.going", BBSHOME), 0755);
}
if (NONENEWSFEEDS == 0)
readnffile(INNDHOME);
diff --git a/pttbbs/innbbsd/receive_article.c b/pttbbs/innbbsd/receive_article.c
index f79096b6..1ece1c51 100644
--- a/pttbbs/innbbsd/receive_article.c
+++ b/pttbbs/innbbsd/receive_article.c
@@ -1070,7 +1070,7 @@ post_article(homepath, userid, board, writebody, pathname, firstpath)
break;
}
oumask = umask(0);
- fh = open(msgfile, O_CREAT | O_EXCL | O_WRONLY, 0664);
+ fh = open(msgfile, O_CREAT | O_EXCL | O_WRONLY, 0644);
umask(oumask);
if (writebody) {
if ((*writebody) (fh, board, pathname) < 0)
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index 3c878cd1..5a328667 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -2344,7 +2344,7 @@ b_man(void)
char genbuf[128];
int fd;
snprintf(genbuf, sizeof(genbuf), "%s/.rebuild", buf);
- if ((fd = open(genbuf, O_CREAT, 0640)) > 0)
+ if ((fd = open(genbuf, O_CREAT, 0644)) > 0)
close(fd);
}
return a_menu(currboard, buf, HasUserPerm(PERM_ALLBOARD) ? 2 :
diff --git a/pttbbs/mbbsd/chicken.c b/pttbbs/mbbsd/chicken.c
index 78f30b4d..590f523a 100644
--- a/pttbbs/mbbsd/chicken.c
+++ b/pttbbs/mbbsd/chicken.c
@@ -231,7 +231,7 @@ new_chicken(void)
// flush it
setuserfile(fn, FN_CHICKEN);
- fd = open(fn, O_WRONLY|O_CREAT, 0666);
+ fd = open(fn, O_WRONLY|O_CREAT, 0644);
if (fd < 0)
{
vmsg("系統錯誤: 無法建立資料,請至 " BN_BUGREPORT " 報告。");
diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c
index ac91137f..3a38ddb8 100644
--- a/pttbbs/mbbsd/edit.c
+++ b/pttbbs/mbbsd/edit.c
@@ -1580,7 +1580,7 @@ read_file(const char *fpath, int splitSig)
if ((fp = fopen(fpath, "r")) == NULL) {
int fd;
- if ((fd = creat(fpath, 0600)) >= 0) {
+ if ((fd = creat(fpath, 0644)) >= 0) {
close(fd);
return 0;
}
diff --git a/pttbbs/mbbsd/fav.c b/pttbbs/mbbsd/fav.c
index e34cc2b6..2c673b7d 100644
--- a/pttbbs/mbbsd/fav.c
+++ b/pttbbs/mbbsd/fav.c
@@ -1141,7 +1141,7 @@ int updatenewfav(int mode)
setuserfile(fname, FAVNB);
- if( (fd = open(fname, O_RDWR | O_CREAT, 0600)) != -1 ){
+ if( (fd = open(fname, O_RDWR | O_CREAT, 0644)) != -1 ){
assert(numboards>=0);
brdnum = numboards; /* avoid race */
diff --git a/pttbbs/mbbsd/pmore.c b/pttbbs/mbbsd/pmore.c
index c06def91..aaa7f2b5 100644
--- a/pttbbs/mbbsd/pmore.c
+++ b/pttbbs/mbbsd/pmore.c
@@ -815,7 +815,7 @@ MFPROTO int
mf_attach(const char *fn)
{
struct stat st;
- int fd = open(fn, O_RDONLY, 0600);
+ int fd = open(fn, O_RDONLY);
#ifdef PMORE_GUNZIP_CMD
fd = mf_gunzip(fn, fd);
diff --git a/pttbbs/mbbsd/read.c b/pttbbs/mbbsd/read.c
index b2bfd380..857e869d 100644
--- a/pttbbs/mbbsd/read.c
+++ b/pttbbs/mbbsd/read.c
@@ -698,7 +698,7 @@ select_read(const keeploc_t * locmem, int sr_mode)
reference = 0;
}
- if( (fd = open(newdirect, filemode, 0600)) == -1 ) {
+ if( (fd = open(newdirect, filemode, 0644)) == -1 ) {
close(fr);
return READ_REDRAW;
}
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c
index 70c3a4ae..315b34db 100644
--- a/pttbbs/mbbsd/register.c
+++ b/pttbbs/mbbsd/register.c
@@ -302,7 +302,7 @@ makeregcode(char *buf)
buf[i] = alphabet[random() % strlen(alphabet)];
getregfile(fpath);
- if( (fd = open(fpath, O_WRONLY | O_CREAT, 0600)) == -1 ){
+ if( (fd = open(fpath, O_WRONLY | O_CREAT, 0644)) == -1 ){
perror("open");
exit(1);
}
@@ -565,7 +565,7 @@ setupnewuser(const userec_t *user)
if ((uid = dosearchuser("", NULL)) == 0) {
/* 每 1 個小時,清理 user 帳號一次 */
if ((stat(fn_fresh, &st) == -1) || (st.st_mtime < clock - 3600)) {
- if ((fd = open(fn_fresh, O_RDWR | O_CREAT, 0600)) == -1)
+ if ((fd = open(fn_fresh, O_RDWR | O_CREAT, 0644)) == -1)
return -1;
write(fd, ctime(&clock), 25);
close(fd);
@@ -573,7 +573,7 @@ setupnewuser(const userec_t *user)
fprintf(stdout, "尋找新帳號中, 請稍待片刻...\n\r");
- if ((fd = open(fn_passwd, O_RDWR | O_CREAT, 0600)) == -1)
+ if ((fd = open(fn_passwd, O_RDWR | O_CREAT, 0644)) == -1)
return -1;
/* 不曉得為什麼要從 2 開始... Ptt:因為SYSOP在1 */
diff --git a/pttbbs/mbbsd/vote.c b/pttbbs/mbbsd/vote.c
index 6e40ce29..e604e454 100644
--- a/pttbbs/mbbsd/vote.c
+++ b/pttbbs/mbbsd/vote.c
@@ -732,7 +732,7 @@ vote_flag(const vote_buffer_t *vbuf, const char *bname, char val)
num = usernum - 1;
setbfile(buf, bname, vbuf->flags);
- if ((fd = open(buf, O_RDWR | O_CREAT, 0600)) == -1)
+ if ((fd = open(buf, O_RDWR | O_CREAT, 0644)) == -1)
return -1;
size = lseek(fd, 0, SEEK_END);
memset(buf, 0, sizeof(buf));
@@ -913,7 +913,7 @@ user_vote_one(const vote_buffer_t *vbuf, const char *bname)
outs("重複投票! 不予計票。");
else {
setbfile(buf, bname, vbuf->ballots);
- if ((fd = open(buf, O_WRONLY | O_CREAT | O_APPEND, 0600)) == 0)
+ if ((fd = open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) == 0)
outs("無法投入票匭\n");
else {
struct stat statb;
diff --git a/pttbbs/trans/itoc_trans.c b/pttbbs/trans/itoc_trans.c
index 56410113..8537cd51 100644
--- a/pttbbs/trans/itoc_trans.c
+++ b/pttbbs/trans/itoc_trans.c
@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
if (trans_man) {
strlcat(buf, "/.rebuild", sizeof(buf));
- if ((opt = open(buf, O_CREAT, 0640)) > 0)
+ if ((opt = open(buf, O_CREAT, 0644)) > 0)
close(opt);
}
else
diff --git a/pttbbs/trans/sob_trans.c b/pttbbs/trans/sob_trans.c
index a33bc6d6..7006d6d1 100644
--- a/pttbbs/trans/sob_trans.c
+++ b/pttbbs/trans/sob_trans.c
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
if (trans_man) {
strlcat(buf, "/.rebuild", sizeof(buf));
- if ((opt = open(buf, O_CREAT, 0640)) > 0)
+ if ((opt = open(buf, O_CREAT, 0644)) > 0)
close(opt);
}
else
diff --git a/pttbbs/upgrade/merge_sob.c b/pttbbs/upgrade/merge_sob.c
index 4a78f112..b0fa9767 100644
--- a/pttbbs/upgrade/merge_sob.c
+++ b/pttbbs/upgrade/merge_sob.c
@@ -142,7 +142,7 @@ m_sob(void)
passwd_update(usernum, &cuser);
}
sethomeman(genbuf, cuser.userid);
- mkdir(genbuf, 0600);
+ mkdir(genbuf, 0755);
sprintf(buf, "tar zxvf %c/%s.tar.gz>/dev/null",
userid[0], userid);
chdir("sob/home");
diff --git a/pttbbs/upgrade/r2014_angel.c b/pttbbs/upgrade/r2014_angel.c
index 14de742b..fc74c955 100644
--- a/pttbbs/upgrade/r2014_angel.c
+++ b/pttbbs/upgrade/r2014_angel.c
@@ -5,7 +5,7 @@ int main(){
userec_t u;
int count = 0;
- orig_fd = open(BBSHOME "/.AngelTrans", O_WRONLY | O_CREAT | O_EXCL, 0600);
+ orig_fd = open(BBSHOME "/.AngelTrans", O_WRONLY | O_CREAT | O_EXCL, 0644);
if (orig_fd == -1) {
if (errno == EEXIST) {
char c;
@@ -32,7 +32,7 @@ int main(){
}
printf("Reading from " BBSHOME "/.PASSWDS\n");
- new_fd = open(BBSHOME "/.PASSWDS.NEW", O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ new_fd = open(BBSHOME "/.PASSWDS.NEW", O_WRONLY | O_CREAT | O_TRUNC, 0644);
if( new_fd < 0 ){
perror("opening " BBSHOME "/.PASSWDS.NEW for writing");
return 1;
diff --git a/pttbbs/upgrade/r2275_passwd.c b/pttbbs/upgrade/r2275_passwd.c
index 2361b787..a205dc08 100644
--- a/pttbbs/upgrade/r2275_passwd.c
+++ b/pttbbs/upgrade/r2275_passwd.c
@@ -130,7 +130,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r2342_limits.c b/pttbbs/upgrade/r2342_limits.c
index 435ed0a3..2784c224 100644
--- a/pttbbs/upgrade/r2342_limits.c
+++ b/pttbbs/upgrade/r2342_limits.c
@@ -35,7 +35,7 @@ int main(void)
}
if ((fd = open(FN_BOARD, O_RDONLY)) < 0 ||
- (fdw = open(FN_BOARD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_BOARD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r4194_passwd.c b/pttbbs/upgrade/r4194_passwd.c
index fe555c43..6bf4d1ee 100644
--- a/pttbbs/upgrade/r4194_passwd.c
+++ b/pttbbs/upgrade/r4194_passwd.c
@@ -244,7 +244,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r4826_numlogin.c b/pttbbs/upgrade/r4826_numlogin.c
index 32c5d3ce..2c087738 100644
--- a/pttbbs/upgrade/r4826_numlogin.c
+++ b/pttbbs/upgrade/r4826_numlogin.c
@@ -59,7 +59,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r4848_watermode.c b/pttbbs/upgrade/r4848_watermode.c
index e9db7fc5..b0310e1a 100644
--- a/pttbbs/upgrade/r4848_watermode.c
+++ b/pttbbs/upgrade/r4848_watermode.c
@@ -39,7 +39,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r4856_adbanner.c b/pttbbs/upgrade/r4856_adbanner.c
index bc14c20c..a9fa8f6d 100644
--- a/pttbbs/upgrade/r4856_adbanner.c
+++ b/pttbbs/upgrade/r4856_adbanner.c
@@ -36,7 +36,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/upgrade/r4871_uflag.c b/pttbbs/upgrade/r4871_uflag.c
index 5d5283ad..2178ff81 100644
--- a/pttbbs/upgrade/r4871_uflag.c
+++ b/pttbbs/upgrade/r4871_uflag.c
@@ -88,7 +88,7 @@ int main(void)
}
if ((fd = open(FN_PASSWD, O_RDONLY)) < 0 ||
- (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0 ) {
+ (fdw = open(FN_PASSWD".trans.tmp", O_WRONLY | O_CREAT | O_TRUNC, 0644)) < 0 ) {
perror("open");
exit(-1);
}
diff --git a/pttbbs/util/buildAnnounce.c b/pttbbs/util/buildAnnounce.c
index 0754206a..d1333c4a 100644
--- a/pttbbs/util/buildAnnounce.c
+++ b/pttbbs/util/buildAnnounce.c
@@ -49,7 +49,7 @@ void buildchilds(int level,char *path,int gid)
if(ptr->brdattr & BRD_GROUPBOARD){
snprintf(newpath,sizeof(newpath),"%s/%s",path,ptr->brdname);
- mkdir(newpath,0766);
+ mkdir(newpath,0755);
buildchilds(level+1,newpath,ptr-bcache+1);
}
else{
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
setsid();
strcpy(path,GROUPROOT);
system("rm -rf "GROUPROOT);
- mkdir(GROUPROOT,0766);
+ mkdir(GROUPROOT,0755);
attach_SHM();
resolve_boards();
buildchilds(0,path,1);
diff --git a/pttbbs/util/cleanpasswd.c b/pttbbs/util/cleanpasswd.c
index ffb13393..e2769d12 100644
--- a/pttbbs/util/cleanpasswd.c
+++ b/pttbbs/util/cleanpasswd.c
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
exit(-1);
}
- if ((fdw = open(BBSHOME"/.PASSWDS.new", O_WRONLY | O_TRUNC | O_CREAT, 0600)) < 0){
+ if ((fdw = open(BBSHOME"/.PASSWDS.new", O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0){
perror("open .PASSWDS.new error");
exit(-1);
}
diff --git a/pttbbs/util/inndBM.c b/pttbbs/util/inndBM.c
index 9e9de37a..535608b3 100644
--- a/pttbbs/util/inndBM.c
+++ b/pttbbs/util/inndBM.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
if(fpscript)
{
fclose(fpscript);
- chmod(INND_SCRIPT,0700);
+ chmod(INND_SCRIPT,0744);
}
// 重設轉信與不轉信板標記
diff --git a/pttbbs/util/tunepasswd.c b/pttbbs/util/tunepasswd.c
index b617fb77..0cf03046 100644
--- a/pttbbs/util/tunepasswd.c
+++ b/pttbbs/util/tunepasswd.c
@@ -13,7 +13,7 @@ int tune(int num) {
printf("Lock failed!\n");
return 1;
}
- if((fout = open(FN_PASSWD ".tune" , O_WRONLY | O_CREAT, 0600)) == -1) {
+ if((fout = open(FN_PASSWD ".tune" , O_WRONLY | O_CREAT, 0644)) == -1) {
perror(FN_PASSWD ".tune");
flock(fin, LOCK_UN);
close(fin);
diff --git a/pttbbs/util/xchatd.c b/pttbbs/util/xchatd.c
index e61869ff..2e03d1ce 100644
--- a/pttbbs/util/xchatd.c
+++ b/pttbbs/util/xchatd.c
@@ -2667,7 +2667,7 @@ start_daemon()
#endif
- fd = open(CHAT_PIDFILE, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ fd = open(CHAT_PIDFILE, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd >= 0)
{
/* sprintf(buf, "%5d\n", value); */