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
commit93fba89d94468d5b23fd482063db063bbb7d3c20 (patch)
treea69b518531646b83d9942334ae71b240882f3354
parentb0a1274c6ce8aad89a44c1024eb9e5c5935fc2c0 (diff)
downloadpttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar.gz
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar.bz2
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar.lz
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar.xz
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.tar.zst
pttbbs-93fba89d94468d5b23fd482063db063bbb7d3c20.zip
mbbsd.c for SSH_CLIENT
user.c for passwd_update when changing the habit git-svn-id: http://opensvn.csie.org/pttbbs/trunk@1146 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/mbbsd.c15
-rw-r--r--pttbbs/mbbsd/user.c1
2 files changed, 15 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/mbbsd.c b/pttbbs/mbbsd/mbbsd.c
index 69b84742..80428bef 100644
--- a/pttbbs/mbbsd/mbbsd.c
+++ b/pttbbs/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/pttbbs/mbbsd/user.c b/pttbbs/mbbsd/user.c
index aac88c47..8849b9ff 100644
--- a/pttbbs/mbbsd/user.c
+++ b/pttbbs/mbbsd/user.c
@@ -266,6 +266,7 @@ static void Customize(void)
default:
done = 1;
}
+ passwd_update(usernum, &cuser);
}
pressanykey();
}