diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-03-24 23:04:20 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-03-24 23:04:20 +0800 |
commit | 1a5e708f9699a641cb5cd6c24aa920a024e17691 (patch) | |
tree | a49fb6149d4ba4919421673c69b189f253562583 | |
parent | eec7ae23db8b72fec3129e828628292dc6bd7ce3 (diff) | |
download | pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar.gz pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar.bz2 pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar.lz pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar.xz pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.tar.zst pttbbs-1a5e708f9699a641cb5cd6c24aa920a024e17691.zip |
Make sure data won't be accidentally preserved.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5587 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/mbbsd/register.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pttbbs/mbbsd/register.c b/pttbbs/mbbsd/register.c index 08d1b228..170ad6eb 100644 --- a/pttbbs/mbbsd/register.c +++ b/pttbbs/mbbsd/register.c @@ -737,6 +737,23 @@ new_register(void) exit(1); } log_usies("REGISTER", fromhost); + + // 確實的把舊資料清掉 + { + char home[PATHLEN], tmp[PATHLEN]; + syncnow(); + sethomepath(home, newuser.userid); + sprintf(tmp, "tmp/%s.%d", newuser.userid, now); + if (dashd(home) && Rename(home, tmp) != 0) { + // failed to active account. + pwcuBitDisableLevel(PERM_BASIC); + log_filef("log/home_fail.log", LOG_CREAT, + "%s: failed to remove.\n", newuser.userid); + vmsg("抱歉,系統出錯,此帳號已鎖定。"); + exit(0); + } + } + #ifdef USE_REMOVEBM_ON_NEWREG { char buf[PATHLEN]; |