summaryrefslogtreecommitdiff
path: root/source4/torture/ldap
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-10-06 22:28:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:55 -0500
commit2151cde58014ea2e822c13d2f8a369b45dc19ca8 (patch)
treeb0cd4c5b394e636232f417bcf482da87d1e18975 /source4/torture/ldap
parent05e7c481465e3065effaf21b43636d6605d7c313 (diff)
downloadsamba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.gz
samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.tar.bz2
samba-2151cde58014ea2e822c13d2f8a369b45dc19ca8.zip
r25554: Convert last instances of BOOL, True and False to the standard types.
(This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r--source4/torture/ldap/basic.c54
-rw-r--r--source4/torture/ldap/cldap.c10
-rw-r--r--source4/torture/ldap/cldapbench.c2
-rw-r--r--source4/torture/ldap/schema.c52
-rw-r--r--source4/torture/ldap/uptodatevector.c6
5 files changed, 62 insertions, 62 deletions
diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c
index e7d1365c24..3f030c97ba 100644
--- a/source4/torture/ldap/basic.c
+++ b/source4/torture/ldap/basic.c
@@ -27,37 +27,37 @@
#include "torture/torture.h"
#include "torture/ldap/proto.h"
-static BOOL test_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password)
+static bool test_bind_simple(struct ldap_connection *conn, const char *userdn, const char *password)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
status = torture_ldap_bind(conn, userdn, password);
if (!NT_STATUS_IS_OK(status)) {
- ret = False;
+ ret = false;
}
return ret;
}
-static BOOL test_bind_sasl(struct ldap_connection *conn, struct cli_credentials *creds)
+static bool test_bind_sasl(struct ldap_connection *conn, struct cli_credentials *creds)
{
NTSTATUS status;
- BOOL ret = True;
+ bool ret = true;
printf("Testing sasl bind as user\n");
status = torture_ldap_bind_sasl(conn, creds);
if (!NT_STATUS_IS_OK(status)) {
- ret = False;
+ ret = false;
}
return ret;
}
-static BOOL test_multibind(struct ldap_connection *conn, const char *userdn, const char *password)
+static bool test_multibind(struct ldap_connection *conn, const char *userdn, const char *password)
{
- BOOL ret = True;
+ bool ret = true;
printf("Testing multiple binds on a single connnection as anonymous and user\n");
@@ -75,9 +75,9 @@ static BOOL test_multibind(struct ldap_connection *conn, const char *userdn, con
return ret;
}
-static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
+static bool test_search_rootDSE(struct ldap_connection *conn, char **basedn)
{
- BOOL ret = True;
+ bool ret = true;
struct ldap_message *msg, *result;
struct ldap_request *req;
int i;
@@ -90,7 +90,7 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
msg = new_ldap_message(conn);
if (!msg) {
- return False;
+ return false;
}
msg->type = LDAP_TAG_SearchRequest;
@@ -99,7 +99,7 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
msg->r.SearchRequest.deref = LDAP_DEREFERENCE_NEVER;
msg->r.SearchRequest.timelimit = 0;
msg->r.SearchRequest.sizelimit = 0;
- msg->r.SearchRequest.attributesonly = False;
+ msg->r.SearchRequest.attributesonly = false;
msg->r.SearchRequest.tree = ldb_parse_tree(msg, "(objectclass=*)");
msg->r.SearchRequest.num_attributes = 0;
msg->r.SearchRequest.attributes = NULL;
@@ -107,13 +107,13 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
req = ldap_request_send(conn, msg);
if (req == NULL) {
printf("Could not setup ldap search\n");
- return False;
+ return false;
}
status = ldap_result_one(req, &result, LDAP_TAG_SearchResultEntry);
if (!NT_STATUS_IS_OK(status)) {
printf("search failed - %s\n", nt_errstr(status));
- return False;
+ return false;
}
printf("received %d replies\n", req->num_replies);
@@ -142,7 +142,7 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
return ret;
}
-static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
+static bool test_compare_sasl(struct ldap_connection *conn, const char *basedn)
{
struct ldap_message *msg, *rep;
struct ldap_request *req;
@@ -152,12 +152,12 @@ static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
printf("Testing SASL Compare: %s\n", basedn);
if (!basedn) {
- return False;
+ return false;
}
msg = new_ldap_message(conn);
if (!msg) {
- return False;
+ return false;
}
msg->type = LDAP_TAG_CompareRequest;
@@ -168,13 +168,13 @@ static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
req = ldap_request_send(conn, msg);
if (!req) {
- return False;
+ return false;
}
status = ldap_result_one(req, &rep, LDAP_TAG_CompareResponse);
if (!NT_STATUS_IS_OK(status)) {
printf("error in ldap compare request - %s\n", nt_errstr(status));
- return False;
+ return false;
}
DEBUG(5,("Code: %d DN: [%s] ERROR:[%s] REFERRAL:[%s]\n",
@@ -183,16 +183,16 @@ static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
rep->r.CompareResponse.errormessage,
rep->r.CompareResponse.referral));
- return True;
+ return true;
}
-BOOL torture_ldap_basic(struct torture_context *torture)
+bool torture_ldap_basic(struct torture_context *torture)
{
NTSTATUS status;
struct ldap_connection *conn;
TALLOC_CTX *mem_ctx;
- BOOL ret = True;
+ bool ret = true;
const char *host = torture_setting_string(torture, "host", NULL);
const char *userdn = torture_setting_string(torture, "ldap_userdn", NULL);
const char *secret = torture_setting_string(torture, "ldap_secret", NULL);
@@ -205,25 +205,25 @@ BOOL torture_ldap_basic(struct torture_context *torture)
status = torture_ldap_connection(mem_ctx, &conn, url);
if (!NT_STATUS_IS_OK(status)) {
- return False;
+ return false;
}
if (!test_search_rootDSE(conn, &basedn)) {
- ret = False;
+ ret = false;
}
/* other basic tests here */
if (!test_multibind(conn, userdn, secret)) {
- ret = False;
+ ret = false;
}
if (!test_bind_sasl(conn, cmdline_credentials)) {
- ret = False;
+ ret = false;
}
if (!test_compare_sasl(conn, basedn)) {
- ret = False;
+ ret = false;
}
/* no more test we are closing */
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index 585cab9b27..f258a1c32f 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -31,7 +31,7 @@
if (!NT_STATUS_EQUAL(status, correct)) { \
printf("(%s) Incorrect status %s - should be %s\n", \
__location__, nt_errstr(status), nt_errstr(correct)); \
- ret = False; \
+ ret = false; \
goto done; \
} \
} while (0)
@@ -39,7 +39,7 @@
/*
test netlogon operations
*/
-static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
+static bool test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
{
struct cldap_socket *cldap = cldap_socket_init(mem_ctx, NULL);
NTSTATUS status;
@@ -47,7 +47,7 @@ static BOOL test_cldap_netlogon(TALLOC_CTX *mem_ctx, const char *dest)
union nbt_cldap_netlogon n1;
struct GUID guid;
int i;
- BOOL ret = True;
+ bool ret = true;
ZERO_STRUCT(search);
search.in.dest_address = dest;
@@ -203,12 +203,12 @@ static void cldap_dump_results(struct cldap_search *search)
/*
test generic cldap operations
*/
-static BOOL test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
+static bool test_cldap_generic(TALLOC_CTX *mem_ctx, const char *dest)
{
struct cldap_socket *cldap = cldap_socket_init(mem_ctx, NULL);
NTSTATUS status;
struct cldap_search search;
- BOOL ret = True;
+ bool ret = true;
const char *attrs1[] = { "currentTime", "highestCommittedUSN", NULL };
const char *attrs2[] = { "currentTime", "highestCommittedUSN", "netlogon", NULL };
const char *attrs3[] = { "netlogon", NULL };
diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c
index 52d8689927..9f860f98d9 100644
--- a/source4/torture/ldap/cldapbench.c
+++ b/source4/torture/ldap/cldapbench.c
@@ -53,7 +53,7 @@ static bool bench_cldap(struct torture_context *tctx, const char *address)
struct cldap_socket *cldap = cldap_socket_init(tctx, NULL);
int num_sent=0;
struct timeval tv = timeval_current();
- BOOL ret = True;
+ bool ret = true;
int timelimit = torture_setting_int(tctx, "timelimit", 10);
struct cldap_netlogon search;
struct bench_state *state;
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c
index 4da758cac4..30fd9877e6 100644
--- a/source4/torture/ldap/schema.c
+++ b/source4/torture/ldap/schema.c
@@ -43,13 +43,13 @@ struct test_rootDSE {
struct test_schema_ctx {
struct ldb_paged_control *ctrl;
uint32_t count;
- BOOL pending;
+ bool pending;
int (*callback)(void *, struct ldb_context *ldb, struct ldb_message *);
void *private_data;
};
-static BOOL test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *root)
+static bool test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *root)
{
int ret;
struct ldb_message *msg;
@@ -60,10 +60,10 @@ static BOOL test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *ro
ret = ldb_search(ldb, ldb_dn_new(ldb, ldb, NULL), LDB_SCOPE_BASE,
NULL, NULL, &r);
if (ret != LDB_SUCCESS) {
- return False;
+ return false;
} else if (r->count != 1) {
talloc_free(r);
- return False;
+ return false;
}
msg = r->msgs[0];
@@ -79,7 +79,7 @@ static BOOL test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *ro
talloc_free(r);
- return True;
+ return true;
}
static int test_schema_search_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
@@ -115,7 +115,7 @@ static int test_schema_search_callback(struct ldb_context *ldb, void *context, s
actx->ctrl->cookie_len = ctrl->cookie_len;
if (actx->ctrl->cookie_len > 0) {
- actx->pending = True;
+ actx->pending = true;
}
}
break;
@@ -138,7 +138,7 @@ static int test_schema_search_callback(struct ldb_context *ldb, void *context, s
return LDB_SUCCESS;
}
-static BOOL test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE *root,
+static bool test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE *root,
const char *filter,
int (*callback)(void *, struct ldb_context *ldb, struct ldb_message *),
void *private_data)
@@ -155,7 +155,7 @@ static BOOL test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE
ctrl = talloc_array(req, struct ldb_control *, 2);
ctrl[0] = talloc(ctrl, struct ldb_control);
ctrl[0]->oid = LDB_CONTROL_PAGED_RESULTS_OID;
- ctrl[0]->critical = True;
+ ctrl[0]->critical = true;
control = talloc(ctrl[0], struct ldb_paged_control);
control->size = 1000;
control->cookie = NULL;
@@ -179,25 +179,25 @@ static BOOL test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE
actx->callback = callback;
actx->private_data = private_data;
again:
- actx->pending = False;
+ actx->pending = false;
ret = ldb_request(ldb, req);
if (ret != LDB_SUCCESS) {
d_printf("search failed - %s\n", ldb_errstring(ldb));
- return False;
+ return false;
}
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
if (ret != LDB_SUCCESS) {
d_printf("search error - %s\n", ldb_errstring(ldb));
- return False;
+ return false;
}
if (actx->pending)
goto again;
d_printf("filter[%s] count[%u]\n", filter, actx->count);
- return True;
+ return true;
}
static int test_add_attribute(void *ptr, struct ldb_context *ldb, struct ldb_message *msg)
@@ -245,9 +245,9 @@ failed:
return LDB_ERR_OTHER;
}
-static BOOL test_create_schema(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema **_schema)
+static bool test_create_schema(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema **_schema)
{
- BOOL ret = True;
+ bool ret = true;
struct dsdb_schema *schema;
schema = talloc_zero(ldb, struct dsdb_schema);
@@ -259,13 +259,13 @@ static BOOL test_create_schema(struct ldb_context *ldb, struct test_rootDSE *roo
ret &= test_create_schema_type(ldb, root, "(objectClass=classSchema)",
test_add_class, schema);
- if (ret == True) {
+ if (ret == true) {
*_schema = schema;
}
return ret;
}
-static BOOL test_dump_not_replicated(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
+static bool test_dump_not_replicated(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
{
struct dsdb_attribute *a;
uint32_t a_i = 1;
@@ -278,10 +278,10 @@ static BOOL test_dump_not_replicated(struct ldb_context *ldb, struct test_rootDS
a->lDAPDisplayName);
}
- return True;
+ return true;
}
-static BOOL test_dump_partial(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
+static bool test_dump_partial(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
{
struct dsdb_attribute *a;
uint32_t a_i = 1;
@@ -295,10 +295,10 @@ static BOOL test_dump_partial(struct ldb_context *ldb, struct test_rootDSE *root
a->lDAPDisplayName);
}
- return True;
+ return true;
}
-static BOOL test_dump_contructed(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
+static bool test_dump_contructed(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
{
struct dsdb_attribute *a;
uint32_t a_i = 1;
@@ -311,10 +311,10 @@ static BOOL test_dump_contructed(struct ldb_context *ldb, struct test_rootDSE *r
a->lDAPDisplayName);
}
- return True;
+ return true;
}
-static BOOL test_dump_sorted_syntax(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
+static bool test_dump_sorted_syntax(struct ldb_context *ldb, struct test_rootDSE *root, struct dsdb_schema *schema)
{
struct dsdb_attribute *a;
uint32_t a_i = 1;
@@ -350,7 +350,7 @@ static BOOL test_dump_sorted_syntax(struct ldb_context *ldb, struct test_rootDSE
om_hex = data_blob_hex_string(ldb, &a->oMObjectClass);
if (!om_hex) {
- return False;
+ return false;
}
d_printf("attr[%4u]: %s %u '%s' '%s'\n", a_i++,
@@ -360,13 +360,13 @@ static BOOL test_dump_sorted_syntax(struct ldb_context *ldb, struct test_rootDSE
}
}
- return True;
+ return true;
}
-BOOL torture_ldap_schema(struct torture_context *torture)
+bool torture_ldap_schema(struct torture_context *torture)
{
struct ldb_context *ldb;
- BOOL ret = True;
+ bool ret = true;
const char *host = torture_setting_string(torture, "host", NULL);
char *url;
struct test_rootDSE rootDSE;
diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c
index f8d00eaa4d..b3c6e8d555 100644
--- a/source4/torture/ldap/uptodatevector.c
+++ b/source4/torture/ldap/uptodatevector.c
@@ -150,10 +150,10 @@ static bool test_check_uptodatevector(struct torture_context *torture,
return ok;
}
-BOOL torture_ldap_uptodatevector(struct torture_context *torture)
+bool torture_ldap_uptodatevector(struct torture_context *torture)
{
struct ldb_context *ldb;
- BOOL ret = True;
+ bool ret = true;
const char *host = torture_setting_string(torture, "host", NULL);
char *url;
@@ -172,5 +172,5 @@ BOOL torture_ldap_uptodatevector(struct torture_context *torture)
return ret;
failed:
- return False;
+ return false;
}