diff options
author | Darren Tucker <dtucker@zip.com.au> | 2003-07-08 14:59:59 +0200 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2003-07-08 14:59:59 +0200 |
commit | b9aa0a0baa33efb06a773de18f2b45c12c15cbaf (patch) | |
tree | 88e63239d15bca8deb7fee0bda994b7f0cb746fa /openbsd-compat | |
parent | - (dtucker) Check return value of setpcred(). (diff) | |
download | openssh-b9aa0a0baa33efb06a773de18f2b45c12c15cbaf.tar.xz openssh-b9aa0a0baa33efb06a773de18f2b45c12c15cbaf.zip |
- (dtucker) [auth-passwd.c auth.c session.c sshd.c port-aix.c port-aix.h]
Convert aixloginmsg into platform-independant Buffer loginmsg.
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/port-aix.c | 22 | ||||
-rw-r--r-- | openbsd-compat/port-aix.h | 1 |
2 files changed, 23 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) xfree(cp); } +#ifdef WITH_AIXAUTHENTICATE +/* + * Remove embedded newlines in string (if any). + * Used before logging messages returned by AIX authentication functions + * so the message is logged on one line. + */ +void +aix_remove_embedded_newlines(char *p) +{ + if (p == NULL) + return; + + for (; *p; p++) { + if (*p == '\n') + *p = ' '; + } + /* Remove trailing whitespace */ + if (*--p == ' ') + *p = '\0'; +} +#endif /* WITH_AIXAUTHENTICATE */ + # ifdef CUSTOM_FAILED_LOGIN /* * record_failed_login: generic "login failed" interface function diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index 2787d919d..4627a82f0 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h @@ -51,4 +51,5 @@ void record_failed_login(const char *user, const char *ttyname); #endif void aix_usrinfo(struct passwd *pw); +void aix_remove_embedded_newlines(char *); #endif /* _AIX */ |