summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-12 20:22:07 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-06-12 20:22:07 +0800
commit2f6959aecaaaed4980f7c8740f2fae2c8fc326ca (patch)
treed3d59847cadac9939bc0e9945530cfd1b7a5caeb /util
parentc5f8e88cde8ad8120fd5e2bdaddd2f5591502aa8 (diff)
downloadpttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.gz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.bz2
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.lz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.xz
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.tar.zst
pttbbs-2f6959aecaaaed4980f7c8740f2fae2c8fc326ca.zip
* refine cmbbs: move util_passwd.o to cmbbs/passwd.c.
* note: in order to workaround the buggy/dirty synchronization hacks, changed 'passwd_query' and 'passwd_update' to passwd_sync_*. * util/* and daemon/* use directly passwd_query/update, and mbbsd should use passwd_sync_*. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4574 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r--util/Makefile4
-rw-r--r--util/bbsmail.c2
-rw-r--r--util/chkhbf.c2
-rw-r--r--util/toplazyBM.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/util/Makefile b/util/Makefile
index 0bbfc0bd..f6f9fb99 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -7,9 +7,9 @@ CFLAGS+= -DPTTBBS_UTIL
BBSBASE= $(SRCROOT)/include/var.h
-UTIL_OBJS= util_passwd.o util_var.o
+UTIL_OBJS= util_var.o
-MBBSD_OBJS= record passwd var
+MBBSD_OBJS= record var
# 下面這些程式, 會被 compile 並且和 $(UTIL_OBJS) 聯結
CPROG_WITH_UTIL= \
diff --git a/util/bbsmail.c b/util/bbsmail.c
index fa14b493..c2cc732d 100644
--- a/util/bbsmail.c
+++ b/util/bbsmail.c
@@ -52,7 +52,7 @@ int mail2bbs(char *userid)
userec_t xuser;
/* check if the userid is in our bbs now */
- if( !(uid = getuser(userid, &xuser)) ){
+ if( (uid = passwd_load_user(userid, &xuser)) < 1 ){
sprintf(genbuf, "BBS user <%s> not existed", userid);
puts(genbuf);
mailog(genbuf);
diff --git a/util/chkhbf.c b/util/chkhbf.c
index 90c28d56..3574fe1a 100644
--- a/util/chkhbf.c
+++ b/util/chkhbf.c
@@ -94,7 +94,7 @@ void chkhbf(boardheader_t *bptr)
chkuser[i] = 0;
break;
}
- if( !getuser(chkuser, &xuser) || strcmp(chkuser, "guest") == 0 ){
+ if( passwd_load_user(chkuser, &xuser) < 1 || strcasecmp(chkuser, STR_GUEST) == 0 ){
strcpy(explist[nEXP].userid, chkuser);
explist[nEXP].expire = -1;
++nEXP;
diff --git a/util/toplazyBM.c b/util/toplazyBM.c
index b9a66c26..e2bc0a6b 100644
--- a/util/toplazyBM.c
+++ b/util/toplazyBM.c
@@ -86,12 +86,12 @@ int main(int argc, char *argv[])
p = strtok(p,"/ ]");
for(index=0; p && index<5; index++) {
int diff;
- if(!p[0]) {
+ // XXX what if bmid is invalid?
+ if(!p[0] || (bmid = passwd_load_user(p, &xuser)) < 1) {
index--;
p=strtok(NULL,"/ ]");
continue;
}
- bmid=getuser(p, &xuser);
strlcpy(bms[index].bmname, p, sizeof(bms[index].bmname));
bms[index].flag = 0;