diff options
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)); } |