summaryrefslogtreecommitdiffstats
path: root/mbbsd/passwd.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-01 02:35:19 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-01 02:35:19 +0800
commit516e5aaeddcf3bee92064c42570a67cde94ac8dc (patch)
tree020b103df33f1a6e0331c075426129e97f39cff5 /mbbsd/passwd.c
parent32c410ff238cdc4a576caa4d53921b5d251be1ca (diff)
downloadpttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar.gz
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar.bz2
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar.lz
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar.xz
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.tar.zst
pttbbs-516e5aaeddcf3bee92064c42570a67cde94ac8dc.zip
guest?
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1655 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/passwd.c')
-rw-r--r--mbbsd/passwd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mbbsd/passwd.c b/mbbsd/passwd.c
index 4fb04652..ec4e68ec 100644
--- a/mbbsd/passwd.c
+++ b/mbbsd/passwd.c
@@ -126,8 +126,13 @@ userec_t userecbuf;
int initcuser(char *userid)
{
// Ptt: setup cuser and usernum here
- if(userid[0]=='\0') return -1;
- if(!(usernum = searchuser(userid)) || usernum > MAX_USERS) return -1;
+ if(userid[0]=='\0' ||
+ !(usernum = searchuser(userid)) || usernum > MAX_USERS)
+ {
+ memset(&userecbuf, 0, sizeof(userecbuf));
+ strcpy(userecbuf.userid, STR_GUEST);
+ return -1;
+ }
passwd_query(usernum, &userecbuf);
cuser = &userecbuf;
return usernum;