|
Lines 52-57
Link Here
|
| 52 |
#include <string.h> |
52 |
#include <string.h> |
| 53 |
#include <krb5.h> |
53 |
#include <krb5.h> |
| 54 |
|
54 |
|
|
|
55 |
#ifdef _AIX |
| 56 |
#include <usersec.h> |
| 57 |
#endif /* _AIX */ |
| 58 |
|
| 55 |
extern ServerOptions options; |
59 |
extern ServerOptions options; |
| 56 |
|
60 |
|
| 57 |
static int |
61 |
static int |
|
Lines 79-92
auth_krb5_password(Authctxt *authctxt, c
Link Here
|
| 79 |
krb5_ccache ccache = NULL; |
83 |
krb5_ccache ccache = NULL; |
| 80 |
int len; |
84 |
int len; |
| 81 |
|
85 |
|
|
|
86 |
#ifdef _AIX |
| 87 |
len = 1; |
| 88 |
char *authdomain = NULL; |
| 89 |
char *authname = NULL; |
| 90 |
setuserdb(S_READ); |
| 91 |
getuserattr(authctxt->pw->pw_name, S_AUTHDOMAIN, &authdomain, SEC_CHAR); |
| 92 |
getuserattr(authctxt->pw->pw_name, S_AUTHNAME, &authname, SEC_CHAR); |
| 93 |
|
| 94 |
if (authname) |
| 95 |
len += strlen(authname); |
| 96 |
else |
| 97 |
len += strlen(authctxt->pw->pw_name); |
| 98 |
|
| 99 |
if (authdomain) |
| 100 |
len += (strlen(authdomain) + 1); |
| 101 |
|
| 102 |
char *client = xmalloc(len); |
| 103 |
if (authname) |
| 104 |
strcpy(client,authname); |
| 105 |
else |
| 106 |
strcpy(client,authctxt->pw->pw_name); |
| 107 |
|
| 108 |
if (authdomain) { |
| 109 |
strcat(client,"@"); |
| 110 |
strcat(client,authdomain); |
| 111 |
} |
| 112 |
#endif /* _AIX */ |
| 82 |
temporarily_use_uid(authctxt->pw); |
113 |
temporarily_use_uid(authctxt->pw); |
| 83 |
|
114 |
|
| 84 |
problem = krb5_init(authctxt); |
115 |
problem = krb5_init(authctxt); |
| 85 |
if (problem) |
116 |
if (problem) |
| 86 |
goto out; |
117 |
goto out; |
| 87 |
|
118 |
|
|
|
119 |
#ifdef _AIX |
| 120 |
problem = krb5_parse_name(authctxt->krb5_ctx, client, |
| 121 |
&authctxt->krb5_user); |
| 122 |
xfree(client); |
| 123 |
enduserdb(); |
| 124 |
#else |
| 88 |
problem = krb5_parse_name(authctxt->krb5_ctx, authctxt->pw->pw_name, |
125 |
problem = krb5_parse_name(authctxt->krb5_ctx, authctxt->pw->pw_name, |
| 89 |
&authctxt->krb5_user); |
126 |
&authctxt->krb5_user); |
|
|
127 |
#endif /* _AIX */ |
| 90 |
if (problem) |
128 |
if (problem) |
| 91 |
goto out; |
129 |
goto out; |
| 92 |
|
130 |
|