summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-19 20:58:00 +1100
committerAndrew Tridgell <tridge@samba.org>2009-12-21 23:41:06 +1100
commit47560bfda9932efa6b225a223aba662a4d72e637 (patch)
treeb3df56c7c6d8a6848d9d79a8eb7bcf6da2be7031 /source4/dsdb/samdb
parenta070119de34274e6122461d9cc0e9829b5fb6865 (diff)
downloadsamba-47560bfda9932efa6b225a223aba662a4d72e637.tar.gz
samba-47560bfda9932efa6b225a223aba662a4d72e637.tar.bz2
samba-47560bfda9932efa6b225a223aba662a4d72e637.zip
s4-dsdb: don't use a non-constant format string for a printf format
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/util.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c
index 8503584ea6..b0ccd0341c 100644
--- a/source4/dsdb/samdb/ldb_modules/util.c
+++ b/source4/dsdb/samdb/ldb_modules/util.c
@@ -232,22 +232,15 @@ int dsdb_module_dn_by_guid(struct ldb_module *module, TALLOC_CTX *mem_ctx,
{
struct ldb_result *res;
const char *attrs[] = { NULL };
- char *expression;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
int ret;
- expression = talloc_asprintf(tmp_ctx, "objectGUID=%s", GUID_string(tmp_ctx, guid));
- if (!expression) {
- ldb_module_oom(module);
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
ret = dsdb_module_search(module, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE,
attrs,
DSDB_SEARCH_SHOW_DELETED |
DSDB_SEARCH_SEARCH_ALL_PARTITIONS |
DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT,
- expression);
+ "objectGUID=%s", GUID_string(tmp_ctx, guid));
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
@@ -257,8 +250,8 @@ int dsdb_module_dn_by_guid(struct ldb_module *module, TALLOC_CTX *mem_ctx,
return LDB_ERR_NO_SUCH_OBJECT;
}
if (res->count != 1) {
- ldb_asprintf_errstring(ldb_module_get_ctx(module), "More than one object found matching %s\n",
- expression);
+ ldb_asprintf_errstring(ldb_module_get_ctx(module), "More than one object found matching objectGUID %s\n",
+ GUID_string(tmp_ctx, guid));
talloc_free(tmp_ctx);
return LDB_ERR_OPERATIONS_ERROR;
}