summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-01 11:33:06 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-09-01 11:33:06 +0800
commitbacf65519d0abc2f789fa94970cde4327b3e03d8 (patch)
tree53748067d248f63a9571a2b5334fa6370b8505c4
parentf4799997634a3bf2d64758a37c2b34873dbe7ec5 (diff)
downloadpttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar.gz
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar.bz2
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar.lz
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar.xz
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.tar.zst
pttbbs-bacf65519d0abc2f789fa94970cde4327b3e03d8.zip
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
-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();
}