|
Lines 29-34
Link Here
|
| 29 |
#include "servconf.h" |
29 |
#include "servconf.h" |
| 30 |
#include "canohost.h" |
30 |
#include "canohost.h" |
| 31 |
#include "xmalloc.h" |
31 |
#include "xmalloc.h" |
|
|
32 |
#include "buffer.h" |
| 32 |
|
33 |
|
| 33 |
#ifdef _AIX |
34 |
#ifdef _AIX |
| 34 |
|
35 |
|
|
Lines 36-41
Link Here
|
| 36 |
#include "port-aix.h" |
37 |
#include "port-aix.h" |
| 37 |
|
38 |
|
| 38 |
extern ServerOptions options; |
39 |
extern ServerOptions options; |
|
|
40 |
extern Buffer loginmsg; |
| 39 |
|
41 |
|
| 40 |
/* |
42 |
/* |
| 41 |
* AIX has a "usrinfo" area where logname and other stuff is stored - |
43 |
* AIX has a "usrinfo" area where logname and other stuff is stored - |
|
Lines 64-69
aix_usrinfo(struct passwd *pw)
Link Here
|
| 64 |
} |
66 |
} |
| 65 |
|
67 |
|
| 66 |
#ifdef WITH_AIXAUTHENTICATE |
68 |
#ifdef WITH_AIXAUTHENTICATE |
|
|
69 |
int |
| 70 |
aix_authenticate(const char *user, const char *password) |
| 71 |
{ |
| 72 |
char *authmsg; |
| 73 |
int success, reenter = 1; |
| 74 |
|
| 75 |
aix_setauthdb(user); |
| 76 |
|
| 77 |
/* XXX: should really loop until reenter == 0 */ |
| 78 |
while (reenter) |
| 79 |
success = (authenticate((char *)user, (char *)password, |
| 80 |
&reenter, &authmsg) == 0); |
| 81 |
aix_remove_embedded_newlines(authmsg); |
| 82 |
debug3("AIX/authenticate %s for user %s, reenter %d: %.100s", |
| 83 |
success ? "succeeded" : "failed", user, reenter, authmsg); |
| 84 |
|
| 85 |
if (success) { |
| 86 |
char *msg, *host; |
| 87 |
|
| 88 |
host = (char *)get_canonical_hostname(options.use_dns); |
| 89 |
|
| 90 |
/* No pty yet, so just label the line as "ssh" */ |
| 91 |
if (loginsuccess((char *)user, host, "ssh", &msg) == 0 && |
| 92 |
msg != NULL) { |
| 93 |
debug3("AIX/loginsuccess: %s", msg); |
| 94 |
buffer_append(&loginmsg, msg, strlen(msg)); |
| 95 |
xfree(msg); |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
if (authmsg != NULL) |
| 100 |
xfree(authmsg); |
| 101 |
|
| 102 |
return (success); |
| 103 |
} |
| 104 |
|
| 67 |
/* |
105 |
/* |
| 68 |
* Remove embedded newlines in string (if any). |
106 |
* Remove embedded newlines in string (if any). |
| 69 |
* Used before logging messages returned by AIX authentication functions |
107 |
* Used before logging messages returned by AIX authentication functions |
|
Lines 84-90
aix_remove_embedded_newlines(char *p)
Link Here
|
| 84 |
*p = '\0'; |
122 |
*p = '\0'; |
| 85 |
} |
123 |
} |
| 86 |
#endif /* WITH_AIXAUTHENTICATE */ |
124 |
#endif /* WITH_AIXAUTHENTICATE */ |
| 87 |
|
125 |
|
| 88 |
# ifdef CUSTOM_FAILED_LOGIN |
126 |
# ifdef CUSTOM_FAILED_LOGIN |
| 89 |
/* |
127 |
/* |
| 90 |
* record_failed_login: generic "login failed" interface function |
128 |
* record_failed_login: generic "login failed" interface function |
|
Lines 92-98
aix_remove_embedded_newlines(char *p)
Link Here
|
| 92 |
void |
130 |
void |
| 93 |
record_failed_login(const char *user, const char *ttyname) |
131 |
record_failed_login(const char *user, const char *ttyname) |
| 94 |
{ |
132 |
{ |
| 95 |
char *hostname = get_canonical_hostname(options.use_dns); |
133 |
char *hostname = (char *)get_canonical_hostname(options.use_dns); |
| 96 |
|
134 |
|
| 97 |
if (geteuid() != 0) |
135 |
if (geteuid() != 0) |
| 98 |
return; |
136 |
return; |