diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-23 10:10:06 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-04-23 10:10:06 +0800 |
commit | ec531a47c5f3680d8d9013c804d8a1f8c8b33498 (patch) | |
tree | df14651f4a5c9b82d7a622ea0d4aeae1295804e8 | |
parent | 945cf121ce0dfea9c37183eff0b05760bdef3a1d (diff) | |
download | pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar.gz pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar.bz2 pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar.lz pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar.xz pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.tar.zst pttbbs-ec531a47c5f3680d8d9013c804d8a1f8c8b33498.zip |
don't save user data if shm corrupted
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2712 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/mbbsd.c | 4 | ||||
-rw-r--r-- | mbbsd/talk.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 2d71bbd6..c63ab17a 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -156,6 +156,10 @@ u_exit(const char *mode) close(0); close(1); + assert(strncmp(currutmp->userid,cuser.userid, IDLEN)==0); + if(strncmp(currutmp->userid,cuser.userid, IDLEN)!=0) + return; + reload_money(); cuser.goodpost = currutmp->goodpost; cuser.badpost = currutmp->badpost; diff --git a/mbbsd/talk.c b/mbbsd/talk.c index aad4a45c..deaddd9d 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -2693,12 +2693,14 @@ t_users(void) int mode0 = currutmp->mode; int stat0 = currstat; - if( cuser.userid[0] != currutmp->userid[0] ){ + assert(strncmp(cuser.userid, currutmp->userid, IDLEN)==0); + if( strncmp(cuser.userid , currutmp->userid, IDLEN) != 0 ){ if( HAS_PERM(PERM_SYSOP) ) vmsg("warning: currutmp userid is changed"); else abort_bbs(0); } + setutmpmode(LUSERS); userlist(); currutmp->mode = mode0; |