summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-05-12 13:40:44 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-05-12 13:40:44 +0800
commit99b2798415929b6406c738ee233c9e030ff8edaa (patch)
treef4fc6bb40088a51280d4aa67f2cf99fde3d8e37f
parent6ae358d4397f2f4cf0d85b1c625f63a7dfb86823 (diff)
downloadpttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar.gz
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar.bz2
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar.lz
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar.xz
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.tar.zst
pttbbs-99b2798415929b6406c738ee233c9e030ff8edaa.zip
Disable host alias when using FROMD.
Buffer size off by 1. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4301 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/mbbsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 0958988d..b2a49c8e 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -972,7 +972,7 @@ setup_utmp(int mode)
if ( (fd = toconnect(FROMD_ADDR)) >= 0 ) {
write(fd, fromhost, strlen(fromhost));
// uinfo.from is zerod, so we don't care about read length
- read(fd, uinfo.from, sizeof(uinfo.from));
+ read(fd, uinfo.from, sizeof(uinfo.from) - 1);
close(fd);
}
else {
@@ -1005,7 +1005,7 @@ setup_utmp(int mode)
uinfo.withme = cuser.withme & ~WITHME_ALLFLAG;
memcpy(uinfo.mind, cuser.mind, 4);
strip_nonebig5((unsigned char *)uinfo.mind, 4);
-#ifdef WHERE
+#if defined(WHERE) && !defined(FROMD)
uinfo.from_alias = where(fromhost);
#endif
#ifndef FAST_LOGIN