Do not ignore provided machine_name in ads_get_upn().
authorGünther Deschner <gd@samba.org>
Tue, 8 Jan 2008 12:46:54 +0000 (13:46 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 8 Jan 2008 13:07:01 +0000 (14:07 +0100)
Guenther
(This used to be commit ddc1307844379f99b3dde48fc351d0326d22a7ce)

source3/libads/ldap.c

index 975e9268649a7f866217000ae648e02c42e08465..28bc7793d726b70bf9d8a3e6914987a542fe19ff 100644 (file)
@@ -3026,26 +3026,26 @@ char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name )
        ADS_STATUS status;
        int count = 0;
        char *name = NULL;
-       
-       status = ads_find_machine_acct(ads, &res, global_myname());
+
+       status = ads_find_machine_acct(ads, &res, machine_name);
        if (!ADS_ERR_OK(status)) {
                DEBUG(0,("ads_get_upn: Failed to find account for %s\n",
                        global_myname()));
                goto out;
        }
-               
+
        if ( (count = ads_count_replies(ads, res)) != 1 ) {
                DEBUG(1,("ads_get_upn: %d entries returned!\n", count));
                goto out;
        }
-               
+
        if ( (name = ads_pull_string(ads, ctx, res, "userPrincipalName")) == NULL ) {
                DEBUG(2,("ads_get_upn: No userPrincipalName attribute!\n"));
        }
 
 out:
        ads_msgfree(ads, res);
-       
+
        return name;
 }