Skip to content

Commit

Permalink
krb5_wrap: Rename kerberos_get_principal_from_service_hostname()
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
cryptomilk authored and abartlet committed Aug 31, 2016
1 parent a110ab8 commit 2454374
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/krb5_wrap/krb5_samba.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,7 @@ static char *smb_krb5_get_realm_from_hostname(TALLOC_CTX *mem_ctx,
return realm;
}

char *kerberos_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
char *smb_krb5_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
const char *service,
const char *remote_name,
const char *default_realm)
Expand All @@ -2706,8 +2706,7 @@ char *kerberos_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
if (!realm) {
return NULL;
}
DEBUG(3,("kerberos_get_principal_from_service_hostname: "
"cannot get realm from, "
DEBUG(3,("Cannot get realm from, "
"desthost %s or default ccache. Using default "
"smb.conf realm %s\n",
remote_name,
Expand Down
2 changes: 1 addition & 1 deletion lib/krb5_wrap/krb5_samba.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ krb5_error_code smb_krb5_principal_set_realm(krb5_context context,
krb5_principal principal,
const char *realm);

char *kerberos_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
char *smb_krb5_get_principal_from_service_hostname(TALLOC_CTX *mem_ctx,
const char *service,
const char *remote_name,
const char *default_realm);
Expand Down
7 changes: 5 additions & 2 deletions source3/librpc/crypto/gse.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,11 @@ static NTSTATUS gse_init_client(TALLOC_CTX *mem_ctx,
realm in particular), possibly falling back to
GSS_C_NT_HOSTBASED_SERVICE
*/
name_buffer.value = kerberos_get_principal_from_service_hostname(
gse_ctx, service, server, lp_realm());
name_buffer.value =
smb_krb5_get_principal_from_service_hostname(gse_ctx,
service,
server,
lp_realm());
if (!name_buffer.value) {
status = NT_STATUS_NO_MEMORY;
goto err_out;
Expand Down
7 changes: 5 additions & 2 deletions source3/libsmb/cliconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,8 +1750,11 @@ static char *cli_session_setup_get_principal(
remote_name, realm);
TALLOC_FREE(realm);
} else {
principal = kerberos_get_principal_from_service_hostname(
talloc_tos(), "cifs", remote_name, lp_realm());
principal =
smb_krb5_get_principal_from_service_hostname(talloc_tos(),
"cifs",
remote_name,
lp_realm());
}
DEBUG(3, ("cli_session_setup_spnego: guessed server principal=%s\n",
principal ? principal : "<null>"));
Expand Down

0 comments on commit 2454374

Please sign in to comment.