IDMAP_BOTH support in smbd

Andrew Bartlett abartlet at
Wed Mar 14 02:07:26 MDT 2012

I've been working to slowly move to supporting IDMAP_BOTH in smbd, so as
to allow s3fs to function in all circumstances. 

Attached are my first two (untested at this time) patches, reworking the
in-memory cache and sids_to_unix_ids routine. 

>From here, I plan to:
 - change the passdb pdb_sid_to_id() call to return a struct unixid
(from idmap.idl)
 - change struct wbcUnixId users (including those I've just added) to
struct unixid, avoiding the union in the libwbclient structure
 - consolidate legacy_sid_to_uid and legacy_sid_to_gid into a single
legacy_sid_to_id() call
 - consolidate sid_to_uid() and sid_to_gid() into a sid_to_id(), which
will be a wrapper around sids_to_unix_ids()
 - consolidate the caching layer in such a way that IDMAP_BOTH can be

To do this, I will need to determine if the winbindd idmap code is
dependent on the type of ID asked for:  That is, if we move from
wbcSidToUid() to wbcSidsToUnixIds(), will the returned values change at


Andrew Bartlett
Andrew Bartlett                      
Authentication Developer, Samba Team 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-idmap-handle-negative-mappings-in-sids_to_unix_id.patch
Type: text/x-patch
Size: 1153 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-passdb-Change-in-memory-idmap-cache-to-cope-with-.patch
Type: text/x-patch
Size: 17743 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list