summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-08 14:06:18 +0100
committerGünther Deschner <gd@samba.org>2008-01-08 14:07:18 +0100
commit62c91987d902d4dfe27023ff2ec2fb73e602105b (patch)
tree485090d2f68fd4e4a99f48263d253658a4b6c088 /source3/utils
parent697208406cd5b669d76265f753097faa761df9c8 (diff)
downloadsamba-62c91987d902d4dfe27023ff2ec2fb73e602105b.tar.gz
samba-62c91987d902d4dfe27023ff2ec2fb73e602105b.tar.bz2
samba-62c91987d902d4dfe27023ff2ec2fb73e602105b.zip
Use ads_get_upn() in net_derive_salting_principal().
Guenther (This used to be commit a3b348b113f248d2eccffd6073560619a97a2976)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 141031dacb..310af82beb 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1255,7 +1255,6 @@ static bool net_derive_salting_principal( TALLOC_CTX *ctx, ADS_STRUCT *ads )
ADS_STATUS status;
fstring salt;
char *std_salt;
- LDAPMessage *res = NULL;
const char *machine_name = global_myname();
status = ads_domain_func_level( ads, &domain_func );
@@ -1278,24 +1277,11 @@ static bool net_derive_salting_principal( TALLOC_CTX *ctx, ADS_STRUCT *ads )
if ( domain_func == DS_DOMAIN_FUNCTION_2000 ) {
char *upn;
- int count;
-
- status = ads_find_machine_acct(ads, &res, machine_name);
- if (!ADS_ERR_OK(status)) {
- return False;
- }
- if ( (count = ads_count_replies(ads, res)) != 1 ) {
- DEBUG(1,("net_set_machine_spn: %d entries returned!\n", count));
- return False;
- }
-
- upn = ads_pull_string(ads, ctx, res, "userPrincipalName");
+ upn = ads_get_upn(ads, ctx, machine_name);
if ( upn ) {
fstrcpy( salt, upn );
}
-
- ads_msgfree(ads, res);
}
return kerberos_secrets_store_des_salt( salt );