From 0c53b0ab722ffd8bac7157274b14f56f4c4a31e8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Aug 2006 08:05:52 +0000 Subject: r17550: Fix a few bugs in the tdb_multikey code. Thanks to tridge for pointing them out. Volker (This used to be commit 6bf5e7080a51c416d1d1466b1ca84c8f23a6bf2c) --- source3/groupdb/mapping.c | 8 ++++---- source3/lib/tdb_multikey.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index f688de38ed..b617e34565 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -95,10 +95,10 @@ static char **group_mapping_keys(TALLOC_CTX *mem_ctx, TDB_DATA data, return NULL; } - result[KEYNUM_SID] = talloc_strdup(mem_ctx, + result[KEYNUM_SID] = talloc_strdup(result, sid_string_static(&mapp->sid)); - result[KEYNUM_NAME] = talloc_strdup(mem_ctx, mapp->nt_name); - result[KEYNUM_GID] = talloc_asprintf(mem_ctx, "%d", (int)mapp->gid); + result[KEYNUM_NAME] = talloc_strdup(result, mapp->nt_name); + result[KEYNUM_GID] = talloc_asprintf(result, "%d", (int)mapp->gid); result[3] = NULL; if ((result[0] == NULL) || (result[1] == NULL) || @@ -109,7 +109,7 @@ static char **group_mapping_keys(TALLOC_CTX *mem_ctx, TDB_DATA data, } /* name lookups are case insensitive, store the key in upper case */ - strupper_m(result[1]); + strupper_m(result[KEYNUM_NAME]); return result; } diff --git a/source3/lib/tdb_multikey.c b/source3/lib/tdb_multikey.c index 7701845a9e..7a4c8e1d5c 100644 --- a/source3/lib/tdb_multikey.c +++ b/source3/lib/tdb_multikey.c @@ -159,7 +159,7 @@ NTSTATUS tdb_find_keyed(TALLOC_CTX *ctx, struct tdb_context *tdb, if (data.dptr == NULL) { DEBUG(1, ("Did not find record %s for key %s\n", prim.dptr, key.dptr)); - status = NT_STATUS_INTERNAL_DB_CORRUPTION; + status = NT_STATUS_NOT_FOUND; goto fail; } -- cgit