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
commit234066d1511f733fbecbd6b2dddbd5dc797aa4a9 (patch)
tree207493e35f0db81c0ce61d85271e149e1e590741
parenteea5d50db1a08ad4236e43e8e1a0899cde32df96 (diff)
downloadpttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar.gz
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar.bz2
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar.lz
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar.xz
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.tar.zst
pttbbs-234066d1511f733fbecbd6b2dddbd5dc797aa4a9.zip
Disable host alias when using FROMD.
Buffer size off by 1. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@4301 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/mbbsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index 0958988d..b2a49c8e 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/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