diff options
Diffstat (limited to 'openbsd-compat/port-aix.c')
| -rw-r--r-- | openbsd-compat/port-aix.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 79c8689669968..943177c708c9b 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c @@ -27,8 +27,9 @@ #include "includes.h" #include "xmalloc.h" -#include "buffer.h" -#include "key.h" +#include "sshbuf.h" +#include "ssherr.h" +#include "sshkey.h" #include "hostfile.h" #include "auth.h" #include "ssh.h" @@ -176,7 +177,7 @@ sys_auth_passwd(struct ssh *ssh, const char *password) { Authctxt *ctxt = ssh->authctxt; char *authmsg = NULL, *msg = NULL, *name = ctxt->pw->pw_name; - int authsuccess = 0, expired, reenter, result; + int r, authsuccess = 0, expired, reenter, result; do { result = authenticate((char *)name, (char *)password, &reenter, @@ -203,7 +204,10 @@ sys_auth_passwd(struct ssh *ssh, const char *password) */ expired = passwdexpired(name, &msg); if (msg && *msg) { - buffer_append(ctxt->loginmsg, msg, strlen(msg)); + if ((r = sshbuf_put(ctxt->loginmsg, + msg, strlen(msg))) != 0) + fatal("%s: buffer error: %s", + __func__, ssh_err(r)); aix_remove_embedded_newlines(msg); } debug3("AIX/passwdexpired returned %d msg %.100s", expired, msg); @@ -234,10 +238,10 @@ sys_auth_passwd(struct ssh *ssh, const char *password) * Returns 1 if login is allowed, 0 if not allowed. */ int -sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) +sys_auth_allowed_user(struct passwd *pw, struct sshbuf *loginmsg) { char *msg = NULL; - int result, permitted = 0; + int r, result, permitted = 0; struct stat st; /* @@ -260,8 +264,10 @@ sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) */ if (result == -1 && errno == EPERM && stat(_PATH_NOLOGIN, &st) == 0) permitted = 1; - else if (msg != NULL) - buffer_append(loginmsg, msg, strlen(msg)); + else if (msg != NULL) { + if ((r = sshbuf_put(loginmsg, msg, strlen(msg))) != 0) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); + } if (msg == NULL) msg = xstrdup("(none)"); aix_remove_embedded_newlines(msg); @@ -275,7 +281,7 @@ sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) int sys_auth_record_login(const char *user, const char *host, const char *ttynm, - Buffer *loginmsg) + struct sshbuf *loginmsg) { char *msg = NULL; int success = 0; |
