Simplify idmap.c?

Jeremy Allison jra at samba.org
Mon Jun 30 21:12:09 GMT 2003


On Mon, Jun 30, 2003 at 10:46:15PM +0200, Volker Lendecke wrote:
> Hi!
> 
> In trying to understand a remote idmap, I found a bug in current
> idmap.c. Line 165 needs a 'ret ='...
> 
> Pursuing the idea that given a remote idmap our local tdb one is just a
> cache can simplify idmap.c a lot. See attached patch. As I said, I don't
> like nested if's :-)
> 
> I think even the idmap_set_mapping is sane looking at all the places
> that still call this.

Only problem with this patch I can see is that in idmap_get_id_from_sid()
when the remote map returns a valid map you are calling :

                /* The remote backend gave us a valid mapping, cache it. */
                ret = cache_map->set_mapping(sid, *id, loc_type);

Shouldn't this be :

                /* The remote backend gave us a valid mapping, cache it. */
                ret = cache_map->set_mapping(sid, *id, *id_type);

And the same in idmap_get_sid_from_id() ?

Jeremy.



More information about the samba-technical mailing list