From e3ec53ea454c8bc4038ad941cf3a06e79e893448 Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 31 Mar 2004 09:47:27 +0000 Subject: fix if cuser is NULL git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1653 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 8 ++++---- 1 file 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, ' '); -- cgit v1.2.3