diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-09-11 17:41:38 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-09-11 17:41:38 +0200 |
commit | c0a863b6f35315a748fa3bb4ae4e4e7c48ad2102 (patch) | |
tree | a03797ac414c71c685247b8650d84b189c245c93 | |
parent | ea3f21dff6c28dc26a3cf9223da84ff4c545b22c (diff) | |
download | samba-c0a863b6f35315a748fa3bb4ae4e4e7c48ad2102.tar.gz samba-c0a863b6f35315a748fa3bb4ae4e4e7c48ad2102.tar.bz2 samba-c0a863b6f35315a748fa3bb4ae4e4e7c48ad2102.zip |
s4:ldb_register_samba_handlers - fix up and convert result codes to LDB/LDAP results
-rw-r--r-- | source4/dsdb/common/tests/dsdb_dn.c | 6 | ||||
-rw-r--r-- | source4/lib/ldb-samba/ldb_wrap.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb-samba/ldif_handlers.c | 2 | ||||
-rw-r--r-- | source4/lib/ldb/tools/cmdline.c | 2 | ||||
-rw-r--r-- | source4/torture/drs/rpc/dssync.c | 2 | ||||
-rw-r--r-- | source4/torture/ldb/ldb.c | 10 |
6 files changed, 12 insertions, 12 deletions
diff --git a/source4/dsdb/common/tests/dsdb_dn.c b/source4/dsdb/common/tests/dsdb_dn.c index 183bce28d0..d01e858a0d 100644 --- a/source4/dsdb/common/tests/dsdb_dn.c +++ b/source4/dsdb/common/tests/dsdb_dn.c @@ -44,7 +44,7 @@ static bool torture_dsdb_dn_attrs(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -127,7 +127,7 @@ static bool torture_dsdb_dn_valid(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -249,7 +249,7 @@ static bool torture_dsdb_dn_invalid(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); diff --git a/source4/lib/ldb-samba/ldb_wrap.c b/source4/lib/ldb-samba/ldb_wrap.c index 13ab3edefe..ebc1818c76 100644 --- a/source4/lib/ldb-samba/ldb_wrap.c +++ b/source4/lib/ldb-samba/ldb_wrap.c @@ -192,7 +192,7 @@ static int ldb_wrap_destructor(struct ldb_wrap *w) * precedence over the 'binary attribute' declaration in the * schema */ ret = ldb_register_samba_handlers(ldb); - if (ret == -1) { + if (ret != LDB_SUCCESS) { talloc_free(ldb); return NULL; } diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c index 0ff6d32dee..1c366104c0 100644 --- a/source4/lib/ldb-samba/ldif_handlers.c +++ b/source4/lib/ldb-samba/ldif_handlers.c @@ -1278,7 +1278,7 @@ int ldb_register_samba_handlers(struct ldb_context *ldb) } if (!s) { - return -1; + return LDB_ERR_OPERATIONS_ERROR; } ret = ldb_schema_attribute_add_with_syntax(ldb, samba_attributes[i].name, LDB_ATTR_FLAG_FIXED, s); diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index c2b595f329..9984766278 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -122,7 +122,7 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, #if (_SAMBA_BUILD_ >= 4) r = ldb_register_samba_handlers(ldb); - if (r != 0) { + if (r != LDB_SUCCESS) { goto failed; } diff --git a/source4/torture/drs/rpc/dssync.c b/source4/torture/drs/rpc/dssync.c index c7b67081cb..aaae85be3d 100644 --- a/source4/torture/drs/rpc/dssync.c +++ b/source4/torture/drs/rpc/dssync.c @@ -265,7 +265,7 @@ static bool test_LDAPBind(struct torture_context *tctx, struct DsSyncTest *ctx, /* Despite us loading the schema from the AD server, we need * the samba handlers to get the extended DN syntax stuff */ ret = ldb_register_samba_handlers(ldb); - if (ret == -1) { + if (ret != LDB_SUCCESS) { talloc_free(ldb); return NULL; } diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c index 8bc6357e3d..8a5a3f309e 100644 --- a/source4/torture/ldb/ldb.c +++ b/source4/torture/ldb/ldb.c @@ -57,7 +57,7 @@ static bool torture_ldb_attrs(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -216,7 +216,7 @@ static bool torture_ldb_dn_attrs(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -334,7 +334,7 @@ static bool torture_ldb_dn_extended(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -595,7 +595,7 @@ static bool torture_ldb_dn(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); @@ -707,7 +707,7 @@ static bool torture_ldb_dn_invalid_extended(struct torture_context *torture) "Failed to init ldb"); torture_assert_int_equal(torture, - ldb_register_samba_handlers(ldb), 0, + ldb_register_samba_handlers(ldb), LDB_SUCCESS, "Failed to register Samba handlers"); ldb_set_utf8_fns(ldb, NULL, wrap_casefold); |