diff options
author | Michael Adam <obnox@samba.org> | 2012-10-15 16:34:02 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-12-03 08:48:28 +0100 |
commit | a1411a884c5361bb8b090695236724cd25857269 (patch) | |
tree | 683cb0bdf5cf4ca2c0dfc43c8d0bbfe913214343 /source3 | |
parent | 55607f0f334ca5d72f35eb6b259db5283b35e86a (diff) | |
download | samba-a1411a884c5361bb8b090695236724cd25857269.tar.gz samba-a1411a884c5361bb8b090695236724cd25857269.tar.bz2 samba-a1411a884c5361bb8b090695236724cd25857269.zip |
s3:idmap_autorid: force mapping type to ID_TYPE_BOTH for sid->unixid mapping
This is to remove problems with the same unix-id being used both
as a uid and a gid.
The autorid backend will map a given number to the same SID, no matter whether this
is a uid or a gid. This will prime the idmap cache with mappings.
The sid-to-u/gid mapping, when not going through the cache, instead checks for
the type of the sid and only allows unix ids of the corresponding type.
Hence the rid backend will give different results, depending on whether the
cache is filled or not.
This patch lets the autorid backend always create sid->id mappings of type both.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/idmap_autorid.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c index 3f3f649a22..621cae98ef 100644 --- a/source3/winbindd/idmap_autorid.c +++ b/source3/winbindd/idmap_autorid.c @@ -309,6 +309,8 @@ static NTSTATUS idmap_autorid_id_to_sid(struct autorid_global_config *cfg, that is a deficiency in the idmap_rid design. */ map->status = ID_MAPPED; + map->xid.type = ID_TYPE_BOTH; + return NT_STATUS_OK; } @@ -333,6 +335,7 @@ static NTSTATUS idmap_autorid_sid_to_id(struct autorid_global_config *global, } map->xid.id = global->minvalue + (global->rangesize * domain->domainnum)+rid; + map->xid.type = ID_TYPE_BOTH; /* We **really** should have some way of validating the SID exists and is the correct type here. But |