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.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index c8d9517b6..cc6190cb8 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -61,6 +61,28 @@ aix_usrinfo(struct passwd *pw)
61 xfree(cp); 61 xfree(cp);
62} 62}
63 63
64#ifdef WITH_AIXAUTHENTICATE
65/*
66 * Remove embedded newlines in string (if any).
67 * Used before logging messages returned by AIX authentication functions
68 * so the message is logged on one line.
69 */
70void
71aix_remove_embedded_newlines(char *p)
72{
73 if (p == NULL)
74 return;
75
76 for (; *p; p++) {
77 if (*p == '\n')
78 *p = ' ';
79 }
80 /* Remove trailing whitespace */
81 if (*--p == ' ')
82 *p = '\0';
83}
84#endif /* WITH_AIXAUTHENTICATE */
85
64# ifdef CUSTOM_FAILED_LOGIN 86# ifdef CUSTOM_FAILED_LOGIN
65/* 87/*
66 * record_failed_login: generic "login failed" interface function 88 * record_failed_login: generic "login failed" interface function