From bacf65519d0abc2f789fa94970cde4327b3e03d8 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 1 Sep 2003 03:33:06 +0000 Subject: mbbsd.c for SSH_CLIENT user.c for passwd_update when changing the habit git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1146 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 15 ++++++++++++++- mbbsd/user.c | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'mbbsd') 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(); } -- cgit v1.2.3