diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 1 | ||||
-rw-r--r-- | openbsd-compat/port-aix.c | 19 | ||||
-rw-r--r-- | openbsd-compat/port-aix.h | 7 | ||||
-rw-r--r-- | openbsd-compat/port-uw.c | 1 |
4 files changed, 17 insertions, 11 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 3daf61071..b6893e171 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <string.h> | 28 | #include <string.h> |
29 | #include <signal.h> | 29 | #include <signal.h> |
30 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | #include <stdio.h> | ||
31 | #include <time.h> | 32 | #include <time.h> |
32 | #include <unistd.h> | 33 | #include <unistd.h> |
33 | 34 | ||
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index 79c868966..f3a84aec8 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c | |||
@@ -27,7 +27,8 @@ | |||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | 28 | ||
29 | #include "xmalloc.h" | 29 | #include "xmalloc.h" |
30 | #include "buffer.h" | 30 | #include "sshbuf.h" |
31 | #include "ssherr.h" | ||
31 | #include "key.h" | 32 | #include "key.h" |
32 | #include "hostfile.h" | 33 | #include "hostfile.h" |
33 | #include "auth.h" | 34 | #include "auth.h" |
@@ -176,7 +177,7 @@ sys_auth_passwd(struct ssh *ssh, const char *password) | |||
176 | { | 177 | { |
177 | Authctxt *ctxt = ssh->authctxt; | 178 | Authctxt *ctxt = ssh->authctxt; |
178 | char *authmsg = NULL, *msg = NULL, *name = ctxt->pw->pw_name; | 179 | char *authmsg = NULL, *msg = NULL, *name = ctxt->pw->pw_name; |
179 | int authsuccess = 0, expired, reenter, result; | 180 | int r, authsuccess = 0, expired, reenter, result; |
180 | 181 | ||
181 | do { | 182 | do { |
182 | result = authenticate((char *)name, (char *)password, &reenter, | 183 | result = authenticate((char *)name, (char *)password, &reenter, |
@@ -203,7 +204,10 @@ sys_auth_passwd(struct ssh *ssh, const char *password) | |||
203 | */ | 204 | */ |
204 | expired = passwdexpired(name, &msg); | 205 | expired = passwdexpired(name, &msg); |
205 | if (msg && *msg) { | 206 | if (msg && *msg) { |
206 | buffer_append(ctxt->loginmsg, msg, strlen(msg)); | 207 | if ((r = sshbuf_put(ctx->loginmsg, |
208 | msg, strlen(msg))) != 0) | ||
209 | fatal("%s: buffer error: %s", | ||
210 | __func__, ssh_err(r)); | ||
207 | aix_remove_embedded_newlines(msg); | 211 | aix_remove_embedded_newlines(msg); |
208 | } | 212 | } |
209 | debug3("AIX/passwdexpired returned %d msg %.100s", expired, msg); | 213 | debug3("AIX/passwdexpired returned %d msg %.100s", expired, msg); |
@@ -234,7 +238,7 @@ sys_auth_passwd(struct ssh *ssh, const char *password) | |||
234 | * Returns 1 if login is allowed, 0 if not allowed. | 238 | * Returns 1 if login is allowed, 0 if not allowed. |
235 | */ | 239 | */ |
236 | int | 240 | int |
237 | sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) | 241 | sys_auth_allowed_user(struct passwd *pw, struct sshbuf *loginmsg) |
238 | { | 242 | { |
239 | char *msg = NULL; | 243 | char *msg = NULL; |
240 | int result, permitted = 0; | 244 | int result, permitted = 0; |
@@ -260,8 +264,9 @@ sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) | |||
260 | */ | 264 | */ |
261 | if (result == -1 && errno == EPERM && stat(_PATH_NOLOGIN, &st) == 0) | 265 | if (result == -1 && errno == EPERM && stat(_PATH_NOLOGIN, &st) == 0) |
262 | permitted = 1; | 266 | permitted = 1; |
263 | else if (msg != NULL) | 267 | else if (msg != NULL) { |
264 | buffer_append(loginmsg, msg, strlen(msg)); | 268 | if ((r = sshbuf_put(loginmsg, msg, strlen(msg))) != 0) |
269 | fatal("%s: buffer error: %s", __func__, ssh_err(r)); | ||
265 | if (msg == NULL) | 270 | if (msg == NULL) |
266 | msg = xstrdup("(none)"); | 271 | msg = xstrdup("(none)"); |
267 | aix_remove_embedded_newlines(msg); | 272 | aix_remove_embedded_newlines(msg); |
@@ -275,7 +280,7 @@ sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) | |||
275 | 280 | ||
276 | int | 281 | int |
277 | sys_auth_record_login(const char *user, const char *host, const char *ttynm, | 282 | sys_auth_record_login(const char *user, const char *host, const char *ttynm, |
278 | Buffer *loginmsg) | 283 | struct sshbuf *loginmsg) |
279 | { | 284 | { |
280 | char *msg = NULL; | 285 | char *msg = NULL; |
281 | int success = 0; | 286 | int success = 0; |
diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index 9c0a4dd3e..748c0e4e3 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h | |||
@@ -30,7 +30,7 @@ | |||
30 | # include <sys/socket.h> | 30 | # include <sys/socket.h> |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #include "buffer.h" | 33 | struct sshbuf; |
34 | 34 | ||
35 | /* These should be in the system headers but are not. */ | 35 | /* These should be in the system headers but are not. */ |
36 | int usrinfo(int, char *, int); | 36 | int usrinfo(int, char *, int); |
@@ -87,9 +87,10 @@ void aix_usrinfo(struct passwd *); | |||
87 | #ifdef WITH_AIXAUTHENTICATE | 87 | #ifdef WITH_AIXAUTHENTICATE |
88 | # define CUSTOM_SYS_AUTH_PASSWD 1 | 88 | # define CUSTOM_SYS_AUTH_PASSWD 1 |
89 | # define CUSTOM_SYS_AUTH_ALLOWED_USER 1 | 89 | # define CUSTOM_SYS_AUTH_ALLOWED_USER 1 |
90 | int sys_auth_allowed_user(struct passwd *, Buffer *); | 90 | int sys_auth_allowed_user(struct passwd *, struct sshbuf *); |
91 | # define CUSTOM_SYS_AUTH_RECORD_LOGIN 1 | 91 | # define CUSTOM_SYS_AUTH_RECORD_LOGIN 1 |
92 | int sys_auth_record_login(const char *, const char *, const char *, Buffer *); | 92 | int sys_auth_record_login(const char *, const char *, |
93 | const char *, struct sshbuf *); | ||
93 | # define CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG | 94 | # define CUSTOM_SYS_AUTH_GET_LASTLOGIN_MSG |
94 | char *sys_auth_get_lastlogin_msg(const char *, uid_t); | 95 | char *sys_auth_get_lastlogin_msg(const char *, uid_t); |
95 | # define CUSTOM_FAILED_LOGIN 1 | 96 | # define CUSTOM_FAILED_LOGIN 1 |
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c index 3028e429a..10dfb9f1c 100644 --- a/openbsd-compat/port-uw.c +++ b/openbsd-compat/port-uw.c | |||
@@ -38,7 +38,6 @@ | |||
38 | 38 | ||
39 | #include "xmalloc.h" | 39 | #include "xmalloc.h" |
40 | #include "packet.h" | 40 | #include "packet.h" |
41 | #include "buffer.h" | ||
42 | #include "key.h" | 41 | #include "key.h" |
43 | #include "auth-options.h" | 42 | #include "auth-options.h" |
44 | #include "log.h" | 43 | #include "log.h" |