diff options
-rw-r--r-- | openbsd-compat/port-aix.c | 10 | ||||
-rw-r--r-- | openbsd-compat/port-aix.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index e1ad3f117..e0d3eba51 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c | |||
@@ -383,12 +383,13 @@ aix_restoreauthdb(void) | |||
383 | 383 | ||
384 | # ifdef USE_AIX_KRB_NAME | 384 | # ifdef USE_AIX_KRB_NAME |
385 | /* | 385 | /* |
386 | * aix_krb5_get_principal_name: returns the user's kerberos client principal name if | 386 | * aix_krb5_get_principal_name: returns the user's kerberos client principal |
387 | * configured, otherwise NULL. Caller must free returned string. | 387 | * name if configured, otherwise NULL. Caller must free returned string. |
388 | */ | 388 | */ |
389 | char * | 389 | char * |
390 | aix_krb5_get_principal_name(char *pw_name) | 390 | aix_krb5_get_principal_name(const char *const_pw_name) |
391 | { | 391 | { |
392 | char *pw_name = (char *)const_pw_name; | ||
392 | char *authname = NULL, *authdomain = NULL, *principal = NULL; | 393 | char *authname = NULL, *authdomain = NULL, *principal = NULL; |
393 | 394 | ||
394 | setuserdb(S_READ); | 395 | setuserdb(S_READ); |
@@ -398,7 +399,8 @@ aix_krb5_get_principal_name(char *pw_name) | |||
398 | debug("AIX getuserattr S_AUTHNAME: %s", strerror(errno)); | 399 | debug("AIX getuserattr S_AUTHNAME: %s", strerror(errno)); |
399 | 400 | ||
400 | if (authdomain != NULL) | 401 | if (authdomain != NULL) |
401 | xasprintf(&principal, "%s@%s", authname ? authname : pw_name, authdomain); | 402 | xasprintf(&principal, "%s@%s", authname ? authname : pw_name, |
403 | authdomain); | ||
402 | else if (authname != NULL) | 404 | else if (authname != NULL) |
403 | principal = xstrdup(authname); | 405 | principal = xstrdup(authname); |
404 | enduserdb(); | 406 | enduserdb(); |
diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index 904de3096..0ee366140 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h | |||
@@ -97,7 +97,7 @@ char *sys_auth_get_lastlogin_msg(const char *, uid_t); | |||
97 | # define CUSTOM_FAILED_LOGIN 1 | 97 | # define CUSTOM_FAILED_LOGIN 1 |
98 | # if defined(S_AUTHDOMAIN) && defined (S_AUTHNAME) | 98 | # if defined(S_AUTHDOMAIN) && defined (S_AUTHNAME) |
99 | # define USE_AIX_KRB_NAME | 99 | # define USE_AIX_KRB_NAME |
100 | char *aix_krb5_get_principal_name(char *); | 100 | char *aix_krb5_get_principal_name(const char *); |
101 | # endif | 101 | # endif |
102 | #endif | 102 | #endif |
103 | 103 | ||