[PATCH] s4-drs: Synchronous Implementation of generated ParentGUID - ToDo List ParentGUID fix
Matthias Dieter Wallnöfer
mdw at samba.org
Tue Nov 17 13:06:05 MST 2009
Hi Fernando!
+ // if there is no parentGUID for this object, then return
+ if(parent_guid == NULL){
+ return ret;
+ }
I would like to remind you that we aren't using "//" comments per
convention. Please change it in a "/* ... */" one!
Greets,
Matthias
Fernando J V da Silva wrote:
> Hi Tridge!
>
> I'm sending another patch, trying to solve the issues found on the last
> one...
>
>
>
>> The change in operational_search() is not correct. You can see what is
>> wrong by trying the following two searches, which should produce the
>> same result:
>>
>> ldbsearch -H $PREFIX/private/sam.ldb objectclass=user createtimestamp
>> parentguid
>> ldbsearch -H $PREFIX/private/sam.ldb objectclass=user parentguid
>> createtimestamp
>>
>> If you try it with your patch, you'll see that the first search
>> correctly produces both the createtimestamp and parentguid attributes,
>> but the 2nd search only produces the parentguid. The reason is that
>> you are putting a NULL value into the search_attrs[] array, which
>> terminates the array, so the backend never sees the request for the
>> createtimestamp attribute.
>>
>>
>>
> On a try to solve it, I used "" instead of NULL. It doesn't seem to be a
> nice solution, but if I don't replace for anything, it will return the
> stored parentGUID for objects that have it... Another option, I guess, would
> be to save the number of elements on the array, right? ... would it be
> preferred?
>
>
>
>> I also suspect you could remove a bit more code from objectclass.c. If
>> you look in objectclass_rename() then you'll see this comment:
>>
>> /* note that the results of this search are kept and used to
>> update the parentGUID in objectclass_rename_callback() */
>>
>> perhaps we could remove that search completely? You should see if you
>> can, making sure that everything still works (check the code
>> carefully, and also run "make test").
>>
>>
>>
> I made a few tests and it seems that this search for the parent is necessary
> to validate de DN at objectclass_do_rename(), but I could remove the
> objectGUID attribute on this search.
>
>
> I'm going to take a look on the tests scripts to see if I can write
> something more!
>
>
> Best regards,
>
>
More information about the samba-technical
mailing list