summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index bdcbd0a3..b112b821 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -959,7 +959,22 @@ setup_utmp(int mode)
//strlcpy(uinfo.realname, cuser.realname, sizeof(uinfo.realname));
strlcpy(uinfo.nickname, cuser.nickname, sizeof(uinfo.nickname));
strip_nonebig5((unsigned char *)uinfo.nickname, sizeof(uinfo.nickname));
+#ifdef FROMD
+ {
+ int fd;
+ if ( (fd = toconnect(FROMD_HOST, FROMD_PORT)) >= 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));
+ close(fd);
+ }
+ else {
+ strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+ }
+ }
+#else
strlcpy(uinfo.from, fromhost, sizeof(uinfo.from));
+#endif
uinfo.five_win = cuser.five_win;
uinfo.five_lose = cuser.five_lose;
uinfo.five_tie = cuser.five_tie;