summaryrefslogtreecommitdiffstats
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-04 10:49:47 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-04 22:07:24 +0100
commitea12adf544ffaf86a7b323c60c7f9dfbede87808 (patch)
tree2e2c317f24fee761b89afdd6fc4bf0ff81218834 /source4/dsdb
parent349b9b72ec36194a1275eaa42ca145071256b623 (diff)
downloadsamba-ea12adf544ffaf86a7b323c60c7f9dfbede87808.tar.gz
samba-ea12adf544ffaf86a7b323c60c7f9dfbede87808.tar.xz
samba-ea12adf544ffaf86a7b323c60c7f9dfbede87808.zip
s4/ldb - remove now superflous "ldb_dn_validate" checks
If we immediately afterwards perform an LDB base operation then we don't need an explicit "ldb_dn_validate" check anymore (only OOM makes sense). Reviewed by: Tridge
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/common/util.c4
-rw-r--r--source4/dsdb/common/util_samr.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/rootdse.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index d0efa057e7b..2563b40ebdb 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3761,9 +3761,9 @@ int dsdb_search_by_dn_guid(struct ldb_context *ldb,
int ret;
dn = ldb_dn_new_fmt(tmp_ctx, ldb, "<GUID=%s>", GUID_string(tmp_ctx, guid));
- if (!ldb_dn_validate(dn)) {
+ if (dn == NULL) {
talloc_free(tmp_ctx);
- return LDB_ERR_INVALID_DN_SYNTAX;
+ return ldb_oom(ldb);
}
ret = dsdb_search_dn(ldb, mem_ctx, _res, dn, attrs, dsdb_flags);
diff --git a/source4/dsdb/common/util_samr.c b/source4/dsdb/common/util_samr.c
index deaea2e07fa..7a4f6441236 100644
--- a/source4/dsdb/common/util_samr.c
+++ b/source4/dsdb/common/util_samr.c
@@ -507,7 +507,7 @@ NTSTATUS dsdb_lookup_rids(struct ldb_context *ldb,
dom_sid_string(tmp_ctx,
dom_sid_add_rid(tmp_ctx, domain_sid,
rids[i])));
- if (!dn || !ldb_dn_validate(dn)) {
+ if (dn == NULL) {
talloc_free(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index be60d896387..30fa4d9c519 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -103,7 +103,7 @@ static int expand_dn_in_message(struct ldb_module *module, struct ldb_message *m
}
dn = ldb_dn_new(tmp_ctx, ldb, dn_string);
- if (!ldb_dn_validate(dn)) {
+ if (dn == NULL) {
talloc_free(tmp_ctx);
return ldb_operr(ldb);
}