summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-15 08:05:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:38 -0500
commit0c53b0ab722ffd8bac7157274b14f56f4c4a31e8 (patch)
treedf887acff3e2f3f3fe169f15e81261ffd08a9b41
parent6fd4813ece5e03c92334acfa7e168cd7d0248919 (diff)
downloadsamba-0c53b0ab722ffd8bac7157274b14f56f4c4a31e8.tar.gz
samba-0c53b0ab722ffd8bac7157274b14f56f4c4a31e8.tar.bz2
samba-0c53b0ab722ffd8bac7157274b14f56f4c4a31e8.zip
r17550: Fix a few bugs in the tdb_multikey code. Thanks to tridge for pointing them
out. Volker (This used to be commit 6bf5e7080a51c416d1d1466b1ca84c8f23a6bf2c)
-rw-r--r--source3/groupdb/mapping.c8
-rw-r--r--source3/lib/tdb_multikey.c2
2 files changed, 5 insertions, 5 deletions
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;
}