[PATCH] Fix joining specific ou (regression from #13861)

Günther Deschner gd at samba.org
Wed Sep 4 11:44:43 UTC 2019


Hi Alexander,

On 04/09/2019 13:40, Alexander Bokovoy wrote:

>> @@ -2122,7 +2122,7 @@ ADS_STATUS ads_create_machine_acct(ADS_STRUCT *ads,
>>  
>>  	ret = ads_find_machine_acct(ads, &res, machine_escaped);
>>  	ads_msgfree(ads, res);
>> -	if (ADS_ERR_OK(ret)) {
>> +	if (ADS_ERR_OK(ret) && ads_count_replies(ads, res) == 1) {
>>  		DBG_DEBUG("Host account for %s already exists.\n",
>>  				machine_escaped);
> I wonder if the check has to be ads_count_replies(ads, res) > 0 ?
> Technically, there could be a unique name but there might be names in
> multiple OUs.

The LDAP query looks for the specific samaccountname of that machine
which will be unique in the entire domain namespace.

> Other than that, RB+, please push.

Thanks!
Guenther

-- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190904/dc2c35f0/signature.sig>


More information about the samba-technical mailing list