diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-10-23 22:20:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:11 -0500 |
commit | db4b95827e4e6d13577513946bff4f956c849756 (patch) | |
tree | d87779f6511101d981bf958a90bdaddca92f8744 /source4/kdc | |
parent | 28a3bc645b49ea6e997b3576ba7a8ba55e7caa9c (diff) | |
download | samba-db4b95827e4e6d13577513946bff4f956c849756.tar.gz samba-db4b95827e4e6d13577513946bff4f956c849756.tar.bz2 samba-db4b95827e4e6d13577513946bff4f956c849756.zip |
r11270: Move the core CrackNames code from rpc_server/drsuapi to dsdb/samdb.
I'm sure this will not be the final resting place, but it will do for
now.
Use the cracknames code in auth/ for creating a server_info given a
principal name only (should avoid assumtions about spliting a
user@realm principal).
Andrew Bartlett
(This used to be commit c9d5d8e45dd7b7c99b6cf35b087bc18012f31222)
Diffstat (limited to 'source4/kdc')
-rw-r--r-- | source4/kdc/pac-glue.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 20578a786e..47cd31583e 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -36,15 +36,14 @@ krb5_error_code ret; NTSTATUS nt_status; struct auth_serversupplied_info *server_info; - char *username; - const char *realm; DATA_BLOB tmp_blob; + char *principal_string; TALLOC_CTX *mem_ctx = talloc_named(config, 0, "samba_get_pac context"); if (!mem_ctx) { return ENOMEM; } - ret = krb5_unparse_name_norealm(context, client, &username); + ret = krb5_unparse_name(context, client, &principal_string); if (ret != 0) { krb5_set_error_string(context, "get pac: could not parse principal"); @@ -53,12 +52,9 @@ return ret; } - /* parse the principal name */ - realm = krb5_principal_get_realm(context, client); - - nt_status = sam_get_server_info(mem_ctx, username, realm, - data_blob(NULL, 0), data_blob(NULL, 0), - &server_info); + nt_status = sam_get_server_info_principal(mem_ctx, principal_string, + &server_info); + free(principal_string); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0, ("Getting user info for PAC failed: %s\n", nt_errstr(nt_status))); |