summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-aix.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/port-aix.c')
-rw-r--r--openbsd-compat/port-aix.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index cddc0907f..7a42810e9 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -46,14 +46,18 @@ void
46aix_usrinfo(struct passwd *pw) 46aix_usrinfo(struct passwd *pw)
47{ 47{
48 u_int i; 48 u_int i;
49 size_t len;
49 char *cp; 50 char *cp;
50 51
51 cp = xmalloc(16 + 2 * strlen(pw->pw_name)); 52 len = sizeof("LOGNAME= NAME= ") + (2 * strlen(pw->pw_name));
52 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, 0, 53 cp = xmalloc(len);
53 pw->pw_name, 0); 54
55 i = snprintf(cp, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, '\0',
56 pw->pw_name, '\0', len);
54 if (usrinfo(SETUINFO, cp, i) == -1) 57 if (usrinfo(SETUINFO, cp, i) == -1)
55 fatal("Couldn't set usrinfo: %s", strerror(errno)); 58 fatal("Couldn't set usrinfo: %s", strerror(errno));
56 debug3("AIX/UsrInfo: set len %d", i); 59 debug3("AIX/UsrInfo: set len %d", i);
60
57 xfree(cp); 61 xfree(cp);
58} 62}
59 63
@@ -64,8 +68,9 @@ aix_usrinfo(struct passwd *pw)
64void 68void
65record_failed_login(const char *user, const char *ttyname) 69record_failed_login(const char *user, const char *ttyname)
66{ 70{
67 loginfailed(user, 71 char *hostname = get_canonical_hostname(options.verify_reverse_mapping);
68 get_canonical_hostname(options.verify_reverse_mapping), ttyname); 72
73 loginfailed(user, hostname, ttyname);
69} 74}
70# endif /* CUSTOM_FAILED_LOGIN */ 75# endif /* CUSTOM_FAILED_LOGIN */
71#endif /* _AIX */ 76#endif /* _AIX */