From 6659ac11de986bb29225b87cb891c3b50175d1f9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 23 Jun 2010 12:02:31 +0200 Subject: s3:idmap_tdb: use idmap_rw_new_mapping in idmap_tdb_new_mapping --- source3/winbindd/idmap_tdb.c | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index 66d9701bcf..a41f6e9fe3 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -642,43 +642,12 @@ done: static NTSTATUS idmap_tdb_new_mapping(struct idmap_domain *dom, struct id_map *map) { NTSTATUS ret; + struct idmap_tdb_context *ctx; - if (map == NULL) { - ret = NT_STATUS_INVALID_PARAMETER; - goto done; - } - - if ((map->xid.type != ID_TYPE_UID) && (map->xid.type != ID_TYPE_GID)) { - ret = NT_STATUS_INVALID_PARAMETER; - goto done; - } - - if (map->sid == NULL) { - ret = NT_STATUS_INVALID_PARAMETER; - goto done; - } - - ret = idmap_tdb_get_new_id(dom, &map->xid); - if (!NT_STATUS_IS_OK(ret)) { - DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(ret))); - goto done; - } - - DEBUG(10, ("Setting mapping: %s <-> %s %lu\n", - sid_string_dbg(map->sid), - (map->xid.type == ID_TYPE_UID) ? "UID" : "GID", - (unsigned long)map->xid.id)); - - map->status = ID_MAPPED; + ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context); - /* store the mapping */ - ret = idmap_tdb_set_mapping(dom, map); - if (!NT_STATUS_IS_OK(ret)) { - DEBUG(3, ("Could not store the new mapping: %s\n", - nt_errstr(ret))); - } + ret = idmap_rw_new_mapping(dom, ctx->rw_ops, map); -done: return ret; } -- cgit