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, 14 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 69b84742..80428bef 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -5,7 +5,8 @@
#define TH_LOW 100
#define TH_HIGH 120
-static void do_aloha(char *hello);
+static void do_aloha(char *hello);
+static void getremotename(struct sockaddr_in * from, char *rhost, char *rname);
#if 0
static jmp_buf byebye;
@@ -798,6 +799,18 @@ user_login()
resolve_boards();
memset(&water[0], 0, sizeof(water_t) * 6);
strlcpy(water[0].userid, " ¥þ³¡ ", sizeof(water[0].userid));
+
+ if(getenv("SSH_CLIENT") == NULL)
+ strcpy(fromhost, "localhost");
+ else {
+ char frombuf[50];
+ sscanf(getenv("SSH_CLIENT"), "%s", frombuf);
+ xsin.sin_family = AF_INET;
+ xsin.sin_port = htons(23);
+ inet_pton(AF_INET, frombuf, &xsin.sin_addr);
+ getremotename(&xsin, fromhost, remoteusername); /* FC931 */
+ }
+
/* ªì©l¤Æ uinfo¡Bflag¡Bmode */
setup_utmp(LOGIN);
currmode = MODE_STARTED;