diff options
author | Michael Adam <obnox@samba.org> | 2010-06-16 22:02:54 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-08-14 02:10:45 +0200 |
commit | 39079acc5770c23f4c1428be60202f48882eeef3 (patch) | |
tree | 7337bfd6b177396a603d60537382f1777f9e4775 /source3/winbindd | |
parent | 1a52e0d25b2d32e336f1bac4d41039e290311a6b (diff) | |
download | samba-39079acc5770c23f4c1428be60202f48882eeef3.tar.gz samba-39079acc5770c23f4c1428be60202f48882eeef3.tar.bz2 samba-39079acc5770c23f4c1428be60202f48882eeef3.zip |
s3:idmap_tdb2: don't check whether sid is already mapped in idmap_tdb2_new_mapping().
idmap_tdb2_new_mapping() is called from inside a transaction only
with sids, that have been verified not to be mapped directly before
that in the same transaction.
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/idmap_tdb2.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/source3/winbindd/idmap_tdb2.c b/source3/winbindd/idmap_tdb2.c index 78dc801914..f386ec3402 100644 --- a/source3/winbindd/idmap_tdb2.c +++ b/source3/winbindd/idmap_tdb2.c @@ -848,12 +848,6 @@ done: static NTSTATUS idmap_tdb2_new_mapping(struct idmap_domain *dom, struct id_map *map) { NTSTATUS ret; - char *sidstr; - TDB_DATA data; - TALLOC_CTX *mem_ctx = talloc_stackframe(); - struct idmap_tdb2_context *ctx; - - ctx = talloc_get_type(dom->private_data, struct idmap_tdb2_context); if (map == NULL) { ret = NT_STATUS_INVALID_PARAMETER; @@ -870,21 +864,6 @@ static NTSTATUS idmap_tdb2_new_mapping(struct idmap_domain *dom, struct id_map * goto done; } - /* check wheter the SID is already mapped in the db */ - sidstr = sid_string_talloc(mem_ctx, map->sid); - if (sidstr == NULL) { - DEBUG(0, ("Out of memory!\n")); - ret = NT_STATUS_NO_MEMORY; - goto done; - } - - data = dbwrap_fetch_bystring(ctx->db, mem_ctx, sidstr); - if (data.dptr) { - ret = NT_STATUS_OBJECT_NAME_COLLISION; - goto done; - } - - /* unmapped - get a new id */ ret = idmap_tdb2_get_new_id(dom, &map->xid); if (!NT_STATUS_IS_OK(ret)) { DEBUG(3, ("Could not allocate id: %s\n", nt_errstr(ret))); @@ -906,7 +885,6 @@ static NTSTATUS idmap_tdb2_new_mapping(struct idmap_domain *dom, struct id_map * } done: - talloc_free(mem_ctx); return ret; } |