[Samba] User's groups issue

Jeremy Allison jra at samba.org
Wed Aug 27 22:25:36 GMT 2008


On Wed, Aug 27, 2008 at 02:41:25PM -0700, Ephi Dror wrote:
> Hi Jerry,
> 
> I'm moving our discussion to technical list.
> 
> I just wanted to point out that I think the code in samlogon_cache.c is incorrect.
> 
> It uses the wrong tdb pointer.
> 
> Here is the right code to my opinion:
> 
> void netsamlogon_clear_cached_user(NET_USER_INFO_3 *user)
> {
>         DOM_SID sid;
>         fstring key_str, sid_string;
> 
>         if (!netsamlogon_cache_init()) {
>                 DEBUG(0,("netsamlogon_clear_cached_user: cannot open %s for write!\n", NETSAMLOGON_TDB));
>                 return;
>         }
>         sid_copy(&sid, &user->dom_sid.sid);
>         sid_append_rid(&sid, user->user_rid);
> 
>         fstr_sprintf(key_str, "%s", sid_to_string(sid_string, &sid));
>         DEBUG(10, ("netsamlogon_clear_cached_user: clearing %s\n", key_str));
> 
>         tdb_delete_bystring(netsamlogon_tdb, key_str);
> }
> 
> I tested it and it works like a Swiss Watch.
> 
> The reason this bug was hidden is because when we store we use TDB_REPLACE
>            tdb_store_bystring(netsamlogon_tdb, keystr, data, TDB_REPLACE)

Yeah, this looks right to me. Looks like the code in
netsamlogon_clear_cached_user() didn't get converted over
when the interface changed. Thanks for the fix.

Jeremy.


More information about the samba-technical mailing list