summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 17:47:27 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 17:47:27 +0800
commite3ec53ea454c8bc4038ad941cf3a06e79e893448 (patch)
tree2acbfaf4099bba0500d41a68d05430ce9828cfa4 /mbbsd
parent44fb895b7f5dcedba32697f7de9a79eed48a8e69 (diff)
downloadpttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar.gz
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar.bz2
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar.lz
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar.xz
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.tar.zst
pttbbs-e3ec53ea454c8bc4038ad941cf3a06e79e893448.zip
fix if cuser is NULL
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1653 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 7d414e30..95883f86 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -587,16 +587,16 @@ login_query()
outs("本系統目前無法以 new 註冊, 請用 guest 進入\n");
continue;
#endif
- } else if (uid[0] == '\0' || !initcuser(uid)) {
+ } else if (uid[0] == '\0'){
outs(err_uid);
} else if (strcmp(uid, STR_GUEST)) {
getdata(21, 0, MSG_PASSWD,
passbuf, sizeof(passbuf), NOECHO);
passbuf[8] = '\0';
- if (!checkpasswd(cuser->passwd, passbuf)
- /* || (HAS_PERM(PERM_SYSOP) && !use_shell_login_mode) */ ) {
- logattempt(cuser->userid, '-');
+ if( initcuser(uid) < 1 || cuser == NULL ||
+ !checkpasswd(cuser->passwd, passbuf) ){
+ logattempt(cuser ? cuser->userid : "", '-');
outs(ERR_PASSWD);
} else {
logattempt(cuser->userid, ' ');