summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--session.c4
-rw-r--r--sshlogin.c6
-rw-r--r--sshlogin.h2
4 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bac6b2f2..84adce11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20030101
+ - (stevesk) [session.c sshlogin.c sshlogin.h] complete portable
+ parts of pass addrlen with sockaddr * fix.
+ from Hajimu UMEMOTO <ume@FreeBSD.org>
+
20021222
- (bal) OpenBSD CVS Sync
- fgsch@cvs.openbsd.org 2002/11/15 10:03:09
@@ -912,4 +917,4 @@
save auth method before monitor_reset_key_state(); bugzilla bug #284;
ok provos@
-$Id: ChangeLog,v 1.2536 2002/12/23 02:58:17 mouring Exp $
+$Id: ChangeLog,v 1.2537 2003/01/01 23:43:55 stevesk Exp $
diff --git a/session.c b/session.c
index dfff9c6b..90d59513 100644
--- a/session.c
+++ b/session.c
@@ -689,7 +689,7 @@ do_pre_login(Session *s)
record_utmp_only(pid, s->tty, s->pw->pw_name,
get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping),
- (struct sockaddr *)&from);
+ (struct sockaddr *)&from, fromlen);
}
#endif
@@ -730,8 +730,8 @@ do_login(Session *s, const char *command)
* the address be 0.0.0.0.
*/
memset(&from, 0, sizeof(from));
+ fromlen = sizeof(from);
if (packet_connection_is_on_socket()) {
- fromlen = sizeof(from);
if (getpeername(packet_get_connection_in(),
(struct sockaddr *) & from, &fromlen) < 0) {
debug("getpeername: %.100s", strerror(errno));
diff --git a/sshlogin.c b/sshlogin.c
index 4cd1c005..12555d63 100644
--- a/sshlogin.c
+++ b/sshlogin.c
@@ -70,7 +70,7 @@ record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
struct logininfo *li;
li = login_alloc_entry(pid, user, host, ttyname);
- login_set_addr(li, addr, sizeof(struct sockaddr));
+ login_set_addr(li, addr, addrlen);
login_login(li);
login_free_entry(li);
}
@@ -78,12 +78,12 @@ record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
#ifdef LOGIN_NEEDS_UTMPX
void
record_utmp_only(pid_t pid, const char *ttyname, const char *user,
- const char *host, struct sockaddr * addr)
+ const char *host, struct sockaddr * addr, socklen_t addrlen)
{
struct logininfo *li;
li = login_alloc_entry(pid, user, host, ttyname);
- login_set_addr(li, addr, sizeof(struct sockaddr));
+ login_set_addr(li, addr, addrlen);
login_utmp_only(li);
login_free_entry(li);
}
diff --git a/sshlogin.h b/sshlogin.h
index 287c0d9f..1c8bfad3 100644
--- a/sshlogin.h
+++ b/sshlogin.h
@@ -22,7 +22,7 @@ u_long get_last_login_time(uid_t, const char *, char *, u_int);
#ifdef LOGIN_NEEDS_UTMPX
void record_utmp_only(pid_t, const char *, const char *, const char *,
- struct sockaddr *);
+ struct sockaddr *, socklen_t);
#endif
#endif