valgrind error on LSA lookup

Matthieu Patou mat at
Tue Jul 12 16:51:14 MDT 2011

Hello Andrew,

I was trying to push the attached patch but I get errors, after a bit of 
hunting I found that the problem is the unit test that do async 

As I had no clue of why state->access_mask & LSA_POLICY_LOOKUP_NAMES 
returned 1 when the openpolicy didn't set this flag I started to suspect 
an error on state.

Running valgrind on samba4  + ./bin/smbtorture  
ncacn_np:[bigendian] rpc.lsa  -U administrator%totoTATA122 
with my patches yield this:
==2592== Conditional jump or move depends on uninitialised value(s)
==2592==    at 0x125206CF: dcesrv_lsa_LookupSids2 (lsa_lookup.c:571)
==2592==    by 0x12520D43: dcesrv_lsa_LookupSids (lsa_lookup.c:732)
==2592==    by 0x12511762: lsarpc__op_dispatch (ndr_lsa_s.c:233)
==2592==    by 0x124EA510: dcesrv_request (dcerpc_server.c:964)
==2592==    by 0x124EAA7A: dcesrv_process_ncacn_packet 
==2592==    by 0x124EBABF: dcesrv_read_fragment_done (dcerpc_server.c:1487)
==2592==    by 0x71B82DA: _tevent_req_notify_callback (tevent_req.c:101)
==2592==    by 0x71B830C: tevent_req_finish (tevent_req.c:110)
==2592==    by 0x71B8333: _tevent_req_done (tevent_req.c:116)
==2592==    by 0xDB33E19: dcerpc_read_ncacn_packet_done (dcerpc_util.c:295)
==2592==    by 0x71B82DA: _tevent_req_notify_callback (tevent_req.c:101)
==2592==    by 0x71B830C: tevent_req_finish (tevent_req.c:110)

Obviously dcesrv_lsa_get_policy_state is not returning something correct 
... can you have a look because this async madness is more than I can 
understand for the moment.

For the information, the patch is needed for:

1) be conform to MS documentation that is right
2) allow some client to work correctly with openchange

Thanks for your help.


Matthieu Patou
Samba Team
Private repo;a=summary

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s4-lsa-return-access-denied-if-LsarLookupSids-calls-.patch
Type: text/x-patch
Size: 1329 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list