summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-30 05:40:04 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-30 05:40:04 +0800
commit9d8cb6cc4563c4c9a7f571b29725670cbebb8d32 (patch)
treec5d542c1793a56801d062dd0dc4159d6f73781af
parent276338a1b2991abcbedf5dffc743e3e5b498f762 (diff)
downloadpttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar.gz
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar.bz2
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar.lz
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar.xz
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.tar.zst
pttbbs-9d8cb6cc4563c4c9a7f571b29725670cbebb8d32.zip
passwd debug of permission
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1629 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/passwd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index 3bb26273..7cf4e110 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -60,7 +60,7 @@ passwd_update_money(int num) /* update money only */
sethomefile(path, getuserid(num), ".passwd");
- if ((pwdfd = open(path, O_WRONLY)) < 0)
+ if ((pwdfd = open(path, O_WRONLY, 0600)) < 0)
{
if(passwd_index_query(num, &user)<0) // tempory code, will be removed
exit(1);
@@ -83,7 +83,7 @@ passwd_index_update(int num, userec_t * buf)
if (num < 1 || num > MAX_USERS)
return -1;
buf->money = moneyof(num);
- if ((pwdfd = open(fn_passwd, O_RDWR)) < 0)
+ if ((pwdfd = open(fn_passwd, O_WRONLY)) < 0)
exit(1);
lseek(pwdfd, sizeof(userec_t) * (num - 1), SEEK_SET);
write(pwdfd, buf, sizeof(userec_t));
@@ -99,7 +99,7 @@ passwd_update(int num, userec_t * buf)
sethomefile(path, getuserid(num), ".passwd");
buf->money = moneyof(num);
- if ((pwdfd = open(path, O_WRONLY | O_CREAT)) < 0)
+ if ((pwdfd = open(path, O_WRONLY, 0600)) < 0)
exit(1);
write(pwdfd, buf, sizeof(userec_t));
close(pwdfd);