> Pierangelo Masarati wrote:
>> On 06/07/2011 12:58 PM, michael(a)stroeder.com wrote:
>>> Any chance this will be fixed?
>>>
>>> It would be very handy for sync processes to get back the entryUUID
>>> generated
>>> by OpenLDAP of a new entry in an AddResponse without having to read the
>>> new
>>> entry once more.
>>
>> If I get things right, what seems to be missing is a
>> LDAP_RES_SEARCH_ENTRY tag
>> right before encoding the search entry, something like
> > [..patch snipped..]
>
> Thanks!
>
> With your patch the response control is now decoded correctly and it
> behaves
> as expected for all operations except Modify DN Operation:
> It returns empty value lists for all attributes no matter how deleteoldrdn
> is
> set. The DN returned is correct.
>
> Here's the trace log from the Python script:
>
> ----------------------------- snip -----------------------------
> *** ldap://localhost:2071/ - SimpleLDAPObject.rename
> (('uid=ablume,ou=Users,ou=schulung,dc=stroeder,dc=local', 'uid=ablume2',
> None,
> 0, [('1.3.6.1.1.13.2', True, '0\x06\x04\x01*\x04\x01+')], None),{})
> => result: 5
> *** ldap://localhost:2071/ - SimpleLDAPObject.result4 ((5, 1, -1, 0, 0,
> 0),{})
> => result: (109, [], 5, [('1.3.6.1.1.13.2', 0,
> 'd\x82\x01N\x045uid=ablume2,ou=Users,ou=schulung,dc=stroeder,dc=local0\x82\x01\x130\x07\x04\x03uid1\x000\x0f\x04\x0bobjectClass1\x000\r\x04\tuidNumber1\x000\r\x04\tgidNumber1\x000\x11\x04\rhomeDirectory1\x000\x06\x04\x02cn1\x000\x19\x04\x15structuralObjectClass1\x000\r\x04\tentryUUID1\x000\x10\x04\x0ccreatorsName1\x000\x13\x04\x0fcreateTimestamp1\x000\x0c\x04\x08entryCSN1\x000\x11\x04\rmodifiersName1\x000\x13\x04\x0fmodifyTimestamp1\x000\x0b\x04\x07entryDN1\x000\x15\x04\x11subschemaSubentry1\x000\x13\x04\x0fhasSubordinates1\x00')])
> resp_ctrls[0].dn: uid=ablume2,ou=Users,ou=schulung,dc=stroeder,dc=local
> resp_ctrls[0].entry:
> {'cn': [],
> 'createTimestamp': [],
> 'creatorsName': [],
> 'entryCSN': [],
> 'entryDN': [],
> 'entryUUID': [],
> 'gidNumber': [],
> 'hasSubordinates': [],
> 'homeDirectory': [],
> 'modifiersName': [],
> 'modifyTimestamp': [],
> 'objectClass': [],
> 'structuralObjectClass': [],
> 'subschemaSubentry': [],
> 'uid': [],
> 'uidNumber': []}
> ----------------------------- snip -----------------------------
I suspect ors_attrsonly is set by mistake. Please try this:
--- a/servers/slapd/result.c
+++ b/servers/slapd/result.c
@@ -1042,7 +1042,8 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
#endif
if ( op->o_res_ber ) {
/* read back control */
- rc = ber_printf( ber, "{O{" /*}}*/, &rs->sr_entry->e_name );
+ rc = ber_printf( ber, "t{O{" /*}}*/,
+ LDAP_RES_SEARCH_ENTRY, &rs->sr_entry->e_name );
} else {
rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid,
LDAP_RES_SEARCH_ENTRY, &rs->sr_entry->e_name );
@@ -1744,6 +1745,7 @@ int slap_read_controls(
myop.o_res_ber = ber;
myop.o_callback = NULL;
myop.ors_slimit = 1;
+ myop.ors_attrsonly = 0;
rc = slap_send_search_entry( &myop, rs );
if( rc ) return rc;