|
Lines 32-37
Link Here
|
| 32 |
|
32 |
|
| 33 |
#include <uinfo.h> |
33 |
#include <uinfo.h> |
| 34 |
#include <../xmalloc.h> |
34 |
#include <../xmalloc.h> |
|
|
35 |
#include "port-aix.h" |
| 35 |
|
36 |
|
| 36 |
extern ServerOptions options; |
37 |
extern ServerOptions options; |
| 37 |
|
38 |
|
|
Lines 92-101
Link Here
|
| 92 |
{ |
93 |
{ |
| 93 |
char *hostname = get_canonical_hostname(options.use_dns); |
94 |
char *hostname = get_canonical_hostname(options.use_dns); |
| 94 |
|
95 |
|
|
|
96 |
if (geteuid() != 0) |
| 97 |
return; |
| 98 |
|
| 99 |
aix_setauthdb(user); |
| 95 |
# ifdef AIX_LOGINFAILED_3ARG |
100 |
# ifdef AIX_LOGINFAILED_3ARG |
| 96 |
loginfailed((char *)user, hostname, (char *)ttyname); |
101 |
loginfailed((char *)user, hostname, (char *)ttyname); |
| 97 |
# else |
102 |
# else |
| 98 |
loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH); |
103 |
loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH); |
|
|
104 |
# endif |
| 105 |
} |
| 106 |
|
| 107 |
/* |
| 108 |
* If we have setauthdb, retrieve the password registry for the user's |
| 109 |
* account then feed it to setauthdb. This may load registry-specific method |
| 110 |
* code. If we don't have setauthdb or have already called it this is a no-op. |
| 111 |
*/ |
| 112 |
void |
| 113 |
aix_setauthdb(const char *user) |
| 114 |
{ |
| 115 |
# ifdef HAVE_SETAUTHDB |
| 116 |
static char *registry = NULL; |
| 117 |
|
| 118 |
if (registry != NULL) /* have already done setauthdb */ |
| 119 |
return; |
| 120 |
|
| 121 |
if (setuserdb(S_READ) == -1) { |
| 122 |
debug3("%s: Could not open userdb to read", __func__); |
| 123 |
return; |
| 124 |
} |
| 125 |
|
| 126 |
if (getuserattr((char *)user, S_REGISTRY, ®istry, SEC_CHAR) == 0) { |
| 127 |
if (setauthdb(registry, NULL) == 0) |
| 128 |
debug3("%s: AIX/setauthdb set registry %s", __func__, |
| 129 |
registry); |
| 130 |
else |
| 131 |
debug3("%s: AIX/setauthdb set registry %s failed: %s", |
| 132 |
__func__, registry, strerror(errno)); |
| 133 |
} else |
| 134 |
debug3("%s: Could not read S_REGISTRY for user: %s", __func__, |
| 135 |
strerror(errno)); |
| 136 |
enduserdb(); |
| 99 |
# endif |
137 |
# endif |
| 100 |
} |
138 |
} |
| 101 |
# endif /* CUSTOM_FAILED_LOGIN */ |
139 |
# endif /* CUSTOM_FAILED_LOGIN */ |