summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/mbbsd.c15
-rw-r--r--mbbsd/user.c1
2 files changed, 15 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;
diff --git a/mbbsd/user.c b/mbbsd/user.c
index aac88c47..8849b9ff 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -266,6 +266,7 @@ static void Customize(void)
default:
done = 1;
}
+ passwd_update(usernum, &cuser);
}
pressanykey();
}