diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-15 04:33:47 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-15 04:33:47 +0800 |
commit | 026329f85c6ebcbec743d526a0c46bd1c0aab8bb (patch) | |
tree | 6f76835cc10bfa49f943a50f5c3db9d36c6c2459 /util | |
parent | b26fbc65ed9d7cbca50f8758712a9b9b6b2bf853 (diff) | |
download | pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar.gz pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar.bz2 pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar.lz pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar.xz pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.tar.zst pttbbs-026329f85c6ebcbec743d526a0c46bd1c0aab8bb.zip |
warning: searchuser() getuser() API change, don't change query string implicitly.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2627 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/BM_money.c | 2 | ||||
-rw-r--r-- | util/angel.c | 2 | ||||
-rw-r--r-- | util/chesscountry.c | 4 | ||||
-rw-r--r-- | util/chkhbf.c | 2 | ||||
-rw-r--r-- | util/deluserfile.c | 2 | ||||
-rw-r--r-- | util/expire.c | 1 | ||||
-rw-r--r-- | util/openticket.c | 2 | ||||
-rw-r--r-- | util/reaper.c | 2 | ||||
-rw-r--r-- | util/shmctl.c | 2 | ||||
-rw-r--r-- | util/xchatd.c | 4 |
10 files changed, 11 insertions, 12 deletions
diff --git a/util/BM_money.c b/util/BM_money.c index 7a8021e9..8421f8cf 100644 --- a/util/BM_money.c +++ b/util/BM_money.c @@ -86,7 +86,7 @@ int main(int argc, char **argv) char *ch1,uid ; if((ch1 = strchr(ch, '/'))) *ch1 = 0; - if ((uid=searchuser(ch))!=0) + if ((uid=searchuser(ch, ch))!=0) { char genbuf[200]; diff --git a/util/angel.c b/util/angel.c index 247f4f02..9e1f3880 100644 --- a/util/angel.c +++ b/util/angel.c @@ -57,7 +57,7 @@ void readData(){ while (fread(&user, sizeof(userec_t), 1, fp) == 1) { ++j; /* j == uid */ if (user.myangel[0]) { - i = searchuser(user.myangel); + i = searchuser(user.myangel, NULL); if (i) ++total[i]; } diff --git a/util/chesscountry.c b/util/chesscountry.c index 605efdf3..478db07f 100644 --- a/util/chesscountry.c +++ b/util/chesscountry.c @@ -109,9 +109,8 @@ main(void) strcpy(str, buf); p = strtok(buf, " "); name[0] = '\0'; - if (p && *p != '#' && searchuser(p)) + if (p && *p != '#' && searchuser(p, userid)) { - strlcpy(userid, p, sizeof(userid)); i = 1; if ((p = strtok(NULL, " "))) @@ -131,7 +130,6 @@ main(void) } if (!strcmp("除名", name)) { - // XXX if userid="../../......." sethomefile(buf, userid, photo_fname); unlink(buf); continue; diff --git a/util/chkhbf.c b/util/chkhbf.c index df3dc048..d4ad5e24 100644 --- a/util/chkhbf.c +++ b/util/chkhbf.c @@ -33,7 +33,7 @@ void informBM(char *userid, boardheader_t *bptr, int nEXP) char filename[256], buf[64]; fileheader_t mymail; FILE *fp; - if( !(uid = searchuser(userid)) ) + if( !(uid = searchuser(userid, userid)) ) return; sprintf(filename, BBSHOME "/home/%c/%s", userid[0], userid); stampfile(filename, &mymail); diff --git a/util/deluserfile.c b/util/deluserfile.c index 83849b6c..0fa33192 100644 --- a/util/deluserfile.c +++ b/util/deluserfile.c @@ -127,7 +127,7 @@ int main(int argc, char **argv) { if (!(count++ % 300)) printf(".\n"); - if (!searchuser(ptr)) + if (!searchuser(ptr, ptr)) mv_user_home(ptr); else del_file(ptr); diff --git a/util/expire.c b/util/expire.c index 7268b64f..7acb735a 100644 --- a/util/expire.c +++ b/util/expire.c @@ -77,6 +77,7 @@ void expire(life_t *brd) total = state.st_size / sizeof(head); sprintf(tmpfile, "%s.new", index); unlink(tmpfile); + // TODO use fread/fwrite to reduce system calls if ((fdw = open(tmpfile, O_WRONLY | O_CREAT | O_EXCL, 0644)) > 0) { while (read(fdr, &head, sizeof head) == sizeof head) diff --git a/util/openticket.c b/util/openticket.c index 4bd761a3..2257911b 100644 --- a/util/openticket.c +++ b/util/openticket.c @@ -157,7 +157,7 @@ int main(int argc, char **argv) { printf("恭喜 %-15s買了%9d 張 %s, 獲得 %d 枚P幣\n" ,userid, num, betname[mybet], money * num); - if((uid=searchuser(userid))==0) continue; + if((uid=searchuser(userid, userid))==0) continue; deumoney(uid, money * num); sprintf(genbuf, BBSHOME "/home/%c/%s", userid[0], userid); stampfile(genbuf, &mymail); diff --git a/util/reaper.c b/util/reaper.c index 5c065a71..348224e9 100644 --- a/util/reaper.c +++ b/util/reaper.c @@ -31,7 +31,7 @@ int check(int n, userec_t *u) { /* expired */ int unum; - unum = searchuser(u->userid); + unum = searchuser(u->userid, u->userid); strcpy(buf, ctime4(&u->lastlogin)); syslog(LOG_NOTICE, "kill user(%d): %s %s", unum, u->userid, buf); sprintf(buf, "mv home/%c/%s tmp/", u->userid[0], u->userid); diff --git a/util/shmctl.c b/util/shmctl.c index 51f560c8..c4cb6870 100644 --- a/util/shmctl.c +++ b/util/shmctl.c @@ -195,7 +195,7 @@ int utmpfix(int argc, char **argv) clean = "too many/less friend"; addkilllist(which); } - else if( searchuser(SHM->uinfo[which].userid) == 0 ){ + else if( searchuser(SHM->uinfo[which].userid, NULL) == 0 ){ clean = "user not exist"; addkilllist(which); } diff --git a/util/xchatd.c b/util/xchatd.c index df91ccb6..4051b3d0 100644 --- a/util/xchatd.c +++ b/util/xchatd.c @@ -165,7 +165,7 @@ acct_load(ACCT *acct, char *userid) if(random()%8==0) acct->userlevel |= PERM_SYSOP; return atoi(userid); #endif - if((id=searchuser(userid))<0) + if((id=searchuser(userid, NULL))<0) return -1; return get_record(FN_PASSWD, acct, sizeof(ACCT), id); } @@ -1559,7 +1559,7 @@ login_user(ChatUser *cu, char *msg) #ifdef SELFTEST utent = atoi(userid)+1; #else - utent = searchuser(acct.userid); + utent = searchuser(acct.userid, NULL); #endif assert(utent); |