作者itoc.bbs@xeon.tfcis.org (核心動力) 看板: plan
標題Re: 密碼加長
時間動力核心 (Wed, 15 Oct 2003 23:57:48 +0800 (CST)) Updated: 2004/03/15
為了增加密碼長度而不需要轉換 .ACCT
故將密碼從暗碼改成明碼
以下修改,讓 明碼/DES暗碼 都能吃
: lib/str_passwd()
int
chkpasswd(passwd, test)
char *passwd, *test;
{
char *pw;
+ if (!strcmp(passwd, test))
+ return 0;
str_ncpy(pwbuf, test, sizeof(pwbuf));
pw = crypt(pwbuf, passwd);
return (strncmp(pw, passwd, PASSLEN));
}
: bbsd.c:acct_apply()
- str_ncpy(cuser.passwd, genpasswd(buf), PASSLEN + 1);
+ str_ncpy(cuser.passwd, buf, PASSLEN + 1);
: strcut.h
- #define PSWDLEN 8
+ #define PSWDLEN PASSLEN
--
┌┼ Origin: 台南一中˙動力核心 processor.tfcis.org
└┘ Author: itoc 從 itoc.dorm11.nctu.edu.tw 發表