summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
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/lib/ldb
parent349b9b72ec36194a1275eaa42ca145071256b623 (diff)
downloadsamba-ea12adf544ffaf86a7b323c60c7f9dfbede87808.tar.gz
samba-ea12adf544ffaf86a7b323c60c7f9dfbede87808.tar.bz2
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/lib/ldb')
-rw-r--r--source4/lib/ldb/tools/ldbdel.c5
-rw-r--r--source4/lib/ldb/tools/ldbedit.c5
-rw-r--r--source4/lib/ldb/tools/ldbrename.c5
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c5
4 files changed, 8 insertions, 12 deletions
diff --git a/source4/lib/ldb/tools/ldbdel.c b/source4/lib/ldb/tools/ldbdel.c
index 35d0137708..8036d09a70 100644
--- a/source4/lib/ldb/tools/ldbdel.c
+++ b/source4/lib/ldb/tools/ldbdel.c
@@ -110,9 +110,8 @@ int main(int argc, const char **argv)
struct ldb_dn *dn;
dn = ldb_dn_new(ldb, ldb, options->argv[i]);
- if ( ! ldb_dn_validate(dn)) {
- printf("Invalid DN format\n");
- return LDB_ERR_INVALID_DN_SYNTAX;
+ if (dn == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
if (options->recursive) {
ret = ldb_delete_recursive(ldb, dn,req_ctrls);
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index 8df37060c6..36d054e563 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -326,9 +326,8 @@ int main(int argc, const char **argv)
if (options->basedn != NULL) {
basedn = ldb_dn_new(ldb, ldb, options->basedn);
- if ( ! ldb_dn_validate(basedn)) {
- printf("Invalid Base DN format\n");
- return LDB_ERR_INVALID_DN_SYNTAX;
+ if (basedn == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
}
diff --git a/source4/lib/ldb/tools/ldbrename.c b/source4/lib/ldb/tools/ldbrename.c
index e8f67500fc..9bbd1f06b1 100644
--- a/source4/lib/ldb/tools/ldbrename.c
+++ b/source4/lib/ldb/tools/ldbrename.c
@@ -66,9 +66,8 @@ int main(int argc, const char **argv)
dn1 = ldb_dn_new(ldb, ldb, options->argv[0]);
dn2 = ldb_dn_new(ldb, ldb, options->argv[1]);
- if ((!ldb_dn_validate(dn1)) || (!ldb_dn_validate(dn2))) {
- printf("Invalid DN format(s)\n");
- return LDB_ERR_INVALID_DN_SYNTAX;
+ if ((dn1 == NULL) || (dn2 == NULL)) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
ret = ldb_rename(ldb, dn1, dn2);
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index 8c101719a3..d10b9650da 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -297,9 +297,8 @@ int main(int argc, const char **argv)
if (options->basedn != NULL) {
basedn = ldb_dn_new(ldb, ldb, options->basedn);
- if ( ! ldb_dn_validate(basedn)) {
- fprintf(stderr, "Invalid Base DN format\n");
- return LDB_ERR_INVALID_DN_SYNTAX;
+ if (basedn == NULL) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
}