diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-29 17:11:21 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-03-29 17:11:21 +0800 |
commit | aa420a10ffe8e81567c16b780acb32962851053e (patch) | |
tree | 5bf7db3381e49ab85f6886bd3dfeb853bfc0bccb /mbbsd/mbbsd.c | |
parent | dae5bcd0ce2aa49b654f76fcc6038667d40511bc (diff) | |
download | pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar.gz pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar.bz2 pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar.lz pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar.xz pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.tar.zst pttbbs-aa420a10ffe8e81567c16b780acb32962851053e.zip |
- (experimental) mask ip(fromhost): USE_MASKED_FROMHOST
- board: make 'w' (save_brc) more user friendly.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4039 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r-- | mbbsd/mbbsd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 0c561ed1..a8e6e453 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -983,8 +983,8 @@ setup_utmp(int mode) #ifndef FAST_LOGIN setuserfile(buf, "remoteuser"); - strlcpy(remotebuf, fromhost, sizeof(fromhost)); - strcat(remotebuf, ctime4(&now)); + strlcpy(remotebuf, fromhost, sizeof(remotebuf)); + strlcat(remotebuf, ctime4(&now), sizeof(remotebuf)); chomp(remotebuf); add_distinct(buf, remotebuf); #endif @@ -1147,6 +1147,10 @@ user_login(void) lasttime = *localtime4(&cuser.lastlogin); redrawwin(); + /* mask fromhost a.b.c.d to a.b.c.* */ + strlcpy(fromhost_masked, fromhost, sizeof(fromhost_masked)); + obfuscate_ipstr(fromhost_masked); + /* show welcome_login */ if( (ifbirth = (ptime.tm_mday == cuser.day && ptime.tm_mon + 1 == cuser.month)) ){ @@ -1584,7 +1588,7 @@ shell_login(int argc, char *argv[], char *envp[]) * original "bbs" */ if (argc > 1) { - strcpy(fromhost, argv[1]); + strlcpy(fromhost, argv[1], sizeof(fromhost)); if (argc > 3) strlcpy(remoteusername, argv[3], sizeof(remoteusername)); } |