diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-12-16 11:31:30 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-12-16 20:56:21 +1100 |
commit | 4b970c00ae5a0b89dca4664725ab1fa1650490f0 (patch) | |
tree | cfdb6568d17833319eee16782f43a2a07615a2e3 | |
parent | cd4574ff847439ffe287187971d63a0c31bdc531 (diff) | |
download | samba-4b970c00ae5a0b89dca4664725ab1fa1650490f0.tar.gz samba-4b970c00ae5a0b89dca4664725ab1fa1650490f0.tar.bz2 samba-4b970c00ae5a0b89dca4664725ab1fa1650490f0.zip |
s4-dsdb: fixed dsdb_module_dn_by_guid()
needs to ask for the DN in storage format, plus fix compilation errors
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/util.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index 4c2e418858..1ef69895d4 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -22,6 +22,7 @@ #include "includes.h" #include "ldb.h" #include "ldb_module.h" +#include "librpc/ndr/libndr.h" #include "dsdb/samdb/ldb_modules/util.h" #include "dsdb/samdb/samdb.h" @@ -228,13 +229,16 @@ int dsdb_module_dn_by_guid(struct ldb_module *module, TALLOC_CTX *mem_ctx, } ret = dsdb_module_search(module, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE, - attrs, DSDB_SEARCH_SHOW_DELETED | DSDB_SEARCH_SEARCH_ALL_PARTITIONS, + attrs, + DSDB_SEARCH_SHOW_DELETED | + DSDB_SEARCH_SEARCH_ALL_PARTITIONS | + DSDB_SEARCH_SHOW_DN_IN_STORAGE_FORMAT, expression); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); return ret; } - if (ret->count == 0) { + if (res->count == 0) { talloc_free(tmp_ctx); return LDB_ERR_NO_SUCH_OBJECT; } @@ -245,7 +249,7 @@ int dsdb_module_dn_by_guid(struct ldb_module *module, TALLOC_CTX *mem_ctx, return LDB_ERR_OPERATIONS_ERROR; } - *dn = talloc_steal(mem_ctx, res->msgs[0].dn); + *dn = talloc_steal(mem_ctx, res->msgs[0]->dn); talloc_free(tmp_ctx); return LDB_SUCCESS; |