diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-08-29 15:57:26 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2002-08-29 15:57:26 +0000 |
commit | 9ecbedf1c5f75dfb13f767122db82e46bc61c811 (patch) | |
tree | f02998f219a0da6a2783b305efaceb86b7d998bb /usr.bin/ssh | |
parent | 38cd9549ee028d678964014c56d5b95a1efc10a7 (diff) |
pass addrlen with sockaddr *; from Hajimu UMEMOTO <ume@FreeBSD.org>
NOTE: there are also p-specific parts to this patch. ok markus@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/monitor.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/session.c | 6 | ||||
-rw-r--r-- | usr.bin/ssh/sshlogin.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/sshlogin.h | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index e25360f941b..6c7c69c57a3 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor.c,v 1.23 2002/08/02 14:43:15 millert Exp $"); +RCSID("$OpenBSD: monitor.c,v 1.24 2002/08/29 15:57:25 stevesk Exp $"); #include <openssl/dh.h> @@ -967,8 +967,8 @@ mm_record_login(Session *s, struct passwd *pw) * 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)); @@ -978,7 +978,7 @@ mm_record_login(Session *s, struct passwd *pw) /* Record that there was a login on that tty from the remote host. */ record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid, get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), - (struct sockaddr *)&from); + (struct sockaddr *)&from, fromlen); } static void diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index b628daca748..fb0df415c65 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.147 2002/08/22 21:45:41 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.148 2002/08/29 15:57:25 stevesk Exp $"); #include "ssh.h" #include "ssh1.h" @@ -647,8 +647,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)); @@ -661,7 +661,7 @@ do_login(Session *s, const char *command) record_login(pid, s->tty, pw->pw_name, pw->pw_uid, get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), - (struct sockaddr *)&from); + (struct sockaddr *)&from, fromlen); if (check_quietlogin(s, command)) return; diff --git a/usr.bin/ssh/sshlogin.c b/usr.bin/ssh/sshlogin.c index 9e9841cec9a..0dd8802da7b 100644 --- a/usr.bin/ssh/sshlogin.c +++ b/usr.bin/ssh/sshlogin.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshlogin.c,v 1.4 2002/06/23 03:30:17 deraadt Exp $"); +RCSID("$OpenBSD: sshlogin.c,v 1.5 2002/08/29 15:57:25 stevesk Exp $"); #include <util.h> #include <utmp.h> @@ -84,7 +84,7 @@ get_last_login_time(uid_t uid, const char *logname, */ void record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid, - const char *host, struct sockaddr * addr) + const char *host, struct sockaddr * addr, socklen_t addrlen) { int fd; struct lastlog ll; diff --git a/usr.bin/ssh/sshlogin.h b/usr.bin/ssh/sshlogin.h index 27a838646a9..10e7e6ea8cc 100644 --- a/usr.bin/ssh/sshlogin.h +++ b/usr.bin/ssh/sshlogin.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sshlogin.h,v 1.3 2001/06/26 17:27:25 markus Exp $ */ +/* $OpenBSD: sshlogin.h,v 1.4 2002/08/29 15:57:25 stevesk Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -16,7 +16,7 @@ void record_login(pid_t, const char *, const char *, uid_t, - const char *, struct sockaddr *); + const char *, struct sockaddr *, socklen_t); void record_logout(pid_t, const char *); u_long get_last_login_time(uid_t, const char *, char *, u_int); |