diff options
author | Michael Adam <obnox@samba.org> | 2010-06-16 16:02:07 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-08-14 02:10:43 +0200 |
commit | 863212ad0e5ae59a218d9960553ec1e946f17826 (patch) | |
tree | bdb9a06946845ae98e08f90710728525b44f0875 /source3/winbindd | |
parent | bb8a4415c86bd23909d7fc34b933d8214b3e1846 (diff) | |
download | samba-863212ad0e5ae59a218d9960553ec1e946f17826.tar.gz samba-863212ad0e5ae59a218d9960553ec1e946f17826.tar.bz2 samba-863212ad0e5ae59a218d9960553ec1e946f17826.zip |
s3:idmap_tdb2: pass idmap_domain instead of idmap_tdb2_context to idmap_tdb2_unixids_to_sids
The reason for this will become apparent later: The ranges are being moved to
the idmap_domain: They are universal.
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/idmap_tdb2.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 6fe0480939..288e89b929 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -532,20 +532,24 @@ static NTSTATUS idmap_tdb2_script(struct idmap_tdb2_context *ctx, struct id_map /* Single id to sid lookup function. */ -static NTSTATUS idmap_tdb2_id_to_sid(struct idmap_tdb2_context *ctx, struct id_map *map) +static NTSTATUS idmap_tdb2_id_to_sid(struct idmap_domain *dom, struct id_map *map) { NTSTATUS ret; TDB_DATA data; char *keystr; NTSTATUS status; + struct idmap_tdb2_context *ctx; + status = idmap_tdb2_open_db(); NT_STATUS_NOT_OK_RETURN(status); - if (!ctx || !map) { + if (!dom || !map) { return NT_STATUS_INVALID_PARAMETER; } + ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); + /* apply filters before checking */ if ((ctx->filter_low_id && (map->xid.id < ctx->filter_low_id)) || (ctx->filter_high_id && (map->xid.id > ctx->filter_high_id))) { @@ -738,7 +742,6 @@ done: */ static NTSTATUS idmap_tdb2_unixids_to_sids(struct idmap_domain *dom, struct id_map **ids) { - struct idmap_tdb2_context *ctx; NTSTATUS ret; int i; @@ -747,10 +750,8 @@ static NTSTATUS idmap_tdb2_unixids_to_sids(struct idmap_domain *dom, struct id_m ids[i]->status = ID_UNKNOWN; } - ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); - for (i = 0; ids[i]; i++) { - ret = idmap_tdb2_id_to_sid(ctx, ids[i]); + ret = idmap_tdb2_id_to_sid(dom, ids[i]); if ( ! NT_STATUS_IS_OK(ret)) { /* if it is just a failed mapping continue */ |