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

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


On 04/09/2019 14:56, Stefan Metzmacher via samba-technical wrote:
> Am 04.09.19 um 14:54 schrieb Stefan Metzmacher via samba-technical:
>> Am 04.09.19 um 14:03 schrieb Alexander Bokovoy via samba-technical:
>>> On ke, 04 syys 2019, Günther Deschner via samba-technical wrote:
>>>> 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.
>>>
>>> Ok, discussed it more on IRC and since GC search will not be done here,
>>> '== 1' is OK.
>>>
>>> RB+, please push.
>>
>> Please add
>>
>> BUG: https://bugzilla.samba.org/show_bug.cgi?id=14007
>>
>> As that's the already existing bug for the regression.
>> And I think is has a similar patch attached.
> 
> Actually please take the patch from the bug
> as it also moves ads_msgfree(ads, res);
> 
> Thanks!
> metze

Will do and close the new bug, I was looking and looking a regression
bug but did not find it earlier.

Thanks for checking!

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/e3a5b40d/signature.sig>


More information about the samba-technical mailing list