summaryrefslogtreecommitdiffstats
path: root/mbbsd/admin.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-29 22:23:20 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-29 22:23:20 +0800
commit3a5906defc274d40f0e58eec77048cdeb8ad64fa (patch)
tree7bc7ea65a6d7e9103e5b84e55b977269e5382682 /mbbsd/admin.c
parente40b5f174956a652514959e367df348c0ad66d9f (diff)
downloadpttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar.gz
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar.bz2
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar.lz
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar.xz
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.tar.zst
pttbbs-3a5906defc274d40f0e58eec77048cdeb8ad64fa.zip
* (pwcu branch) end support of r2275 version password
git-svn-id: http://opensvn.csie.org/pttbbs/branches/pttbbs.pwcu@4790 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r--mbbsd/admin.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index b1f6f1c7..48ebba94 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -89,13 +89,18 @@ static int retrieve_backup(userec_t *user)
return -1;
}
-void
+int
upgrade_passwd(userec_t *puser)
{
if (puser->version == PASSWD_VERSION)
- return;
+ return 1;
if (!puser->userid[0])
- return;
+ return 1;
+ // unknown version
+ return 0;
+
+#if 0
+ // this is a sample.
if (puser->version == 2275) // chicken change
{
memset(puser->career, 0, sizeof(puser->career));
@@ -104,9 +109,11 @@ upgrade_passwd(userec_t *puser)
memset(puser->chkpad1, 0, sizeof(puser->chkpad1));
memset(puser->chkpad2, 0, sizeof(puser->chkpad2));
puser->numlogindays = 0;
+ puser->lastseen = 0;
puser->version = PASSWD_VERSION;
- return;
+ return ;
}
+#endif
}
static int
@@ -160,7 +167,8 @@ search_key_user(const char *passwdfile, int mode)
}
// XXX 這裡會取舊資料,要小心 PWD 的 upgrade
- upgrade_passwd(&user);
+ if (!upgrade_passwd(&user))
+ continue;
keymatch = NULL;