summaryrefslogtreecommitdiff
path: root/source4/libcli/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/libcli/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/libcli/ldap')
-rw-r--r--source4/libcli/ldap/ldap.c30
-rw-r--r--source4/libcli/ldap/ldap_bind.c2
-rw-r--r--source4/libcli/ldap/ldap_client.c6
-rw-r--r--source4/libcli/ldap/ldap_controls.c530
-rw-r--r--source4/libcli/ldap/ldap_ildap.c6
-rw-r--r--source4/libcli/ldap/ldap_msg.c18
6 files changed, 296 insertions, 296 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index 06ff000acf..11689fbd79 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -27,7 +27,7 @@
#include "libcli/ldap/ldap.h"
-static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree)
+static bool ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree)
{
int i;
@@ -37,7 +37,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
asn1_push_tag(data, ASN1_CONTEXT(tree->operation==LDB_OP_AND?0:1));
for (i=0; i<tree->u.list.num_elements; i++) {
if (!ldap_push_filter(data, tree->u.list.elements[i])) {
- return False;
+ return false;
}
}
asn1_pop_tag(data);
@@ -46,7 +46,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
case LDB_OP_NOT:
asn1_push_tag(data, ASN1_CONTEXT(2));
if (!ldap_push_filter(data, tree->u.isnot.child)) {
- return False;
+ return false;
}
asn1_pop_tag(data);
break;
@@ -166,7 +166,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
break;
default:
- return False;
+ return false;
}
return !data->has_error;
}
@@ -187,12 +187,12 @@ static void ldap_encode_response(struct asn1_data *data, struct ldap_Result *res
}
}
-BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx)
+bool ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ctx)
{
struct asn1_data *data = asn1_init(mem_ctx);
int i, j;
- if (!data) return False;
+ if (!data) return false;
asn1_push_tag(data, ASN1_SEQUENCE(0));
asn1_write_Integer(data, msg->messageid);
@@ -225,7 +225,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
asn1_pop_tag(data);
break;
default:
- return False;
+ return false;
}
asn1_pop_tag(data);
@@ -256,7 +256,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
asn1_write_BOOLEAN(data, r->attributesonly);
if (!ldap_push_filter(data, r->tree)) {
- return False;
+ return false;
}
asn1_push_tag(data, ASN1_SEQUENCE(0));
@@ -467,7 +467,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
break;
}
default:
- return False;
+ return false;
}
if (msg->controls != NULL) {
@@ -475,7 +475,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
for (i = 0; msg->controls[i] != NULL; i++) {
if (!ldap_encode_control(mem_ctx, data, msg->controls[i])) {
- return False;
+ return false;
}
}
@@ -486,12 +486,12 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
if (data->has_error) {
asn1_free(data);
- return False;
+ return false;
}
*result = data_blob_talloc(mem_ctx, data->data, data->length);
asn1_free(data);
- return True;
+ return true;
}
static const char *blob2string_talloc(TALLOC_CTX *mem_ctx,
@@ -503,16 +503,16 @@ static const char *blob2string_talloc(TALLOC_CTX *mem_ctx,
return result;
}
-static BOOL asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx,
+static bool asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx,
struct asn1_data *data,
const char **result)
{
DATA_BLOB string;
if (!asn1_read_OctetString(data, mem_ctx, &string))
- return False;
+ return false;
*result = blob2string_talloc(mem_ctx, string);
data_blob_free(&string);
- return True;
+ return true;
}
static void ldap_decode_response(TALLOC_CTX *mem_ctx,
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c
index cbe8772414..d285735d4e 100644
--- a/source4/libcli/ldap/ldap_bind.c
+++ b/source4/libcli/ldap/ldap_bind.c
@@ -258,7 +258,7 @@ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, struct cli_credentials *cr
}
status = ildap_search(conn, "", LDAP_SEARCH_SCOPE_BASE, "", supported_sasl_mech_attrs,
- False, NULL, NULL, &sasl_mechs_msgs);
+ false, NULL, NULL, &sasl_mechs_msgs);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to inquire of target's available sasl mechs in rootdse search: %s\n",
nt_errstr(status)));
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 8476a4977b..aea95de161 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -226,7 +226,7 @@ static void ldap_io_handler(struct event_context *ev, struct fd_event *fde,
parse a ldap URL
*/
static NTSTATUS ldap_parse_basic_url(TALLOC_CTX *mem_ctx, const char *url,
- char **host, uint16_t *port, BOOL *ldaps)
+ char **host, uint16_t *port, bool *ldaps)
{
int tmp_port = 0;
char protocol[11];
@@ -243,10 +243,10 @@ static NTSTATUS ldap_parse_basic_url(TALLOC_CTX *mem_ctx, const char *url,
if (strequal(protocol, "ldap")) {
*port = 389;
- *ldaps = False;
+ *ldaps = false;
} else if (strequal(protocol, "ldaps")) {
*port = 636;
- *ldaps = True;
+ *ldaps = true;
} else {
DEBUG(0, ("unrecognised ldap protocol (%s)!\n", protocol));
return NT_STATUS_PROTOCOL_UNREACHABLE;
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c
index 3a5d14c0c9..b7fd1ce178 100644
--- a/source4/libcli/ldap/ldap_controls.c
+++ b/source4/libcli/ldap/ldap_controls.c
@@ -26,56 +26,56 @@
struct control_handler {
const char *oid;
- BOOL (*decode)(void *mem_ctx, DATA_BLOB in, void **out);
- BOOL (*encode)(void *mem_ctx, void *in, DATA_BLOB *out);
+ bool (*decode)(void *mem_ctx, DATA_BLOB in, void **out);
+ bool (*encode)(void *mem_ctx, void *in, DATA_BLOB *out);
};
-static BOOL decode_server_sort_response(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_server_sort_response(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB attr;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_sort_resp_control *lsrc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lsrc = talloc(mem_ctx, struct ldb_sort_resp_control);
if (!lsrc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_enumerated(data, &(lsrc->result))) {
- return False;
+ return false;
}
lsrc->attr_desc = NULL;
if (asn1_peek_tag(data, ASN1_OCTET_STRING)) {
if (!asn1_read_OctetString(data, mem_ctx, &attr)) {
- return False;
+ return false;
}
lsrc->attr_desc = talloc_strndup(lsrc, (const char *)attr.data, attr.length);
if (!lsrc->attr_desc) {
- return False;
+ return false;
}
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lsrc;
- return True;
+ return true;
}
-static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB attr;
DATA_BLOB rule;
@@ -83,14 +83,14 @@ static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
struct ldb_server_sort_control **lssc;
int num;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
lssc = NULL;
@@ -98,46 +98,46 @@ static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
for (num = 0; asn1_peek_tag(data, ASN1_SEQUENCE(0)); num++) {
lssc = talloc_realloc(mem_ctx, lssc, struct ldb_server_sort_control *, num + 2);
if (!lssc) {
- return False;
+ return false;
}
lssc[num] = talloc_zero(lssc, struct ldb_server_sort_control);
if (!lssc[num]) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_OctetString(data, mem_ctx, &attr)) {
- return False;
+ return false;
}
lssc[num]->attributeName = talloc_strndup(lssc[num], (const char *)attr.data, attr.length);
if (!lssc [num]->attributeName) {
- return False;
+ return false;
}
if (asn1_peek_tag(data, ASN1_OCTET_STRING)) {
if (!asn1_read_OctetString(data, mem_ctx, &rule)) {
- return False;
+ return false;
}
lssc[num]->orderingRule = talloc_strndup(lssc[num], (const char *)rule.data, rule.length);
if (!lssc[num]->orderingRule) {
- return False;
+ return false;
}
}
if (asn1_peek_tag(data, ASN1_BOOLEAN)) {
- BOOL reverse;
+ bool reverse;
if (!asn1_read_BOOLEAN(data, &reverse)) {
- return False;
+ return false;
}
lssc[num]->reverse = reverse;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
}
@@ -146,248 +146,248 @@ static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lssc;
- return True;
+ return true;
}
-static BOOL decode_extended_dn_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_extended_dn_request(void *mem_ctx, DATA_BLOB in, void **out)
{
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_extended_dn_control *ledc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
ledc = talloc(mem_ctx, struct ldb_extended_dn_control);
if (!ledc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(ledc->type))) {
- return False;
+ return false;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = ledc;
- return True;
+ return true;
}
-static BOOL decode_sd_flags_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_sd_flags_request(void *mem_ctx, DATA_BLOB in, void **out)
{
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_sd_flags_control *lsdfc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lsdfc = talloc(mem_ctx, struct ldb_sd_flags_control);
if (!lsdfc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lsdfc->secinfo_flags))) {
- return False;
+ return false;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lsdfc;
- return True;
+ return true;
}
-static BOOL decode_search_options_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_search_options_request(void *mem_ctx, DATA_BLOB in, void **out)
{
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_search_options_control *lsoc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lsoc = talloc(mem_ctx, struct ldb_search_options_control);
if (!lsoc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lsoc->search_options))) {
- return False;
+ return false;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lsoc;
- return True;
+ return true;
}
-static BOOL decode_paged_results_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_paged_results_request(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB cookie;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_paged_control *lprc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lprc = talloc(mem_ctx, struct ldb_paged_control);
if (!lprc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lprc->size))) {
- return False;
+ return false;
}
if (!asn1_read_OctetString(data, mem_ctx, &cookie)) {
- return False;
+ return false;
}
lprc->cookie_len = cookie.length;
if (lprc->cookie_len) {
lprc->cookie = talloc_memdup(lprc, cookie.data, cookie.length);
if (!(lprc->cookie)) {
- return False;
+ return false;
}
} else {
lprc->cookie = NULL;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lprc;
- return True;
+ return true;
}
-static BOOL decode_dirsync_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_dirsync_request(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB cookie;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_dirsync_control *ldc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
ldc = talloc(mem_ctx, struct ldb_dirsync_control);
if (!ldc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(ldc->flags))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(ldc->max_attributes))) {
- return False;
+ return false;
}
if (!asn1_read_OctetString(data, mem_ctx, &cookie)) {
- return False;
+ return false;
}
ldc->cookie_len = cookie.length;
if (ldc->cookie_len) {
ldc->cookie = talloc_memdup(ldc, cookie.data, cookie.length);
if (!(ldc->cookie)) {
- return False;
+ return false;
}
} else {
ldc->cookie = NULL;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = ldc;
- return True;
+ return true;
}
/* seem that this controls has 2 forms one in case it is used with
* a Search Request and another when used ina Search Response
*/
-static BOOL decode_asq_control(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_asq_control(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB source_attribute;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_asq_control *lac;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lac = talloc(mem_ctx, struct ldb_asq_control);
if (!lac) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (asn1_peek_tag(data, ASN1_OCTET_STRING)) {
if (!asn1_read_OctetString(data, mem_ctx, &source_attribute)) {
- return False;
+ return false;
}
lac->src_attr_len = source_attribute.length;
if (lac->src_attr_len) {
lac->source_attribute = talloc_strndup(lac, (const char *)source_attribute.data, source_attribute.length);
if (!(lac->source_attribute)) {
- return False;
+ return false;
}
} else {
lac->source_attribute = NULL;
@@ -398,96 +398,96 @@ static BOOL decode_asq_control(void *mem_ctx, DATA_BLOB in, void **out)
} else if (asn1_peek_tag(data, ASN1_ENUMERATED)) {
if (!asn1_read_enumerated(data, &(lac->result))) {
- return False;
+ return false;
}
lac->request = 0;
} else {
- return False;
+ return false;
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lac;
- return True;
+ return true;
}
-static BOOL decode_domain_scope_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_domain_scope_request(void *mem_ctx, DATA_BLOB in, void **out)
{
if (in.length != 0) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-static BOOL decode_notification_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_notification_request(void *mem_ctx, DATA_BLOB in, void **out)
{
if (in.length != 0) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-static BOOL decode_show_deleted_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_show_deleted_request(void *mem_ctx, DATA_BLOB in, void **out)
{
if (in.length != 0) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-static BOOL decode_permissive_modify_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_permissive_modify_request(void *mem_ctx, DATA_BLOB in, void **out)
{
if (in.length != 0) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-static BOOL decode_manageDSAIT_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_manageDSAIT_request(void *mem_ctx, DATA_BLOB in, void **out)
{
if (in.length != 0) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-static BOOL decode_vlv_request(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_vlv_request(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB assertion_value, context_id;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_vlv_req_control *lvrc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lvrc = talloc(mem_ctx, struct ldb_vlv_req_control);
if (!lvrc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->beforeCount))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->afterCount))) {
- return False;
+ return false;
}
if (asn1_peek_tag(data, ASN1_CONTEXT(0))) {
@@ -495,27 +495,27 @@ static BOOL decode_vlv_request(void *mem_ctx, DATA_BLOB in, void **out)
lvrc->type = 0;
if (!asn1_start_tag(data, ASN1_CONTEXT(0))) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->match.byOffset.offset))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->match.byOffset.contentCount))) {
- return False;
+ return false;
}
if (!asn1_end_tag(data)) { /*SEQUENCE*/
- return False;
+ return false;
}
if (!asn1_end_tag(data)) { /*CONTEXT*/
- return False;
+ return false;
}
} else {
@@ -523,38 +523,38 @@ static BOOL decode_vlv_request(void *mem_ctx, DATA_BLOB in, void **out)
lvrc->type = 1;
if (!asn1_start_tag(data, ASN1_CONTEXT(1))) {
- return False;
+ return false;
}
if (!asn1_read_OctetString(data, mem_ctx, &assertion_value)) {
- return False;
+ return false;
}
lvrc->match.gtOrEq.value_len = assertion_value.length;
if (lvrc->match.gtOrEq.value_len) {
lvrc->match.gtOrEq.value = talloc_memdup(lvrc, assertion_value.data, assertion_value.length);
if (!(lvrc->match.gtOrEq.value)) {
- return False;
+ return false;
}
} else {
lvrc->match.gtOrEq.value = NULL;
}
if (!asn1_end_tag(data)) { /*CONTEXT*/
- return False;
+ return false;
}
}
if (asn1_peek_tag(data, ASN1_OCTET_STRING)) {
if (!asn1_read_OctetString(data, mem_ctx, &context_id)) {
- return False;
+ return false;
}
lvrc->ctxid_len = context_id.length;
if (lvrc->ctxid_len) {
lvrc->contextId = talloc_memdup(lvrc, context_id.data, context_id.length);
if (!(lvrc->contextId)) {
- return False;
+ return false;
}
} else {
lvrc->contextId = NULL;
@@ -565,54 +565,54 @@ static BOOL decode_vlv_request(void *mem_ctx, DATA_BLOB in, void **out)
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lvrc;
- return True;
+ return true;
}
-static BOOL decode_vlv_response(void *mem_ctx, DATA_BLOB in, void **out)
+static bool decode_vlv_response(void *mem_ctx, DATA_BLOB in, void **out)
{
DATA_BLOB context_id;
struct asn1_data *data = asn1_init(mem_ctx);
struct ldb_vlv_resp_control *lvrc;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_load(data, in)) {
- return False;
+ return false;
}
lvrc = talloc(mem_ctx, struct ldb_vlv_resp_control);
if (!lvrc) {
- return False;
+ return false;
}
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->targetPosition))) {
- return False;
+ return false;
}
if (!asn1_read_Integer(data, &(lvrc->contentCount))) {
- return False;
+ return false;
}
if (!asn1_read_enumerated(data, &(lvrc->vlv_result))) {
- return False;
+ return false;
}
if (asn1_peek_tag(data, ASN1_OCTET_STRING)) {
if (!asn1_read_OctetString(data, mem_ctx, &context_id)) {
- return False;
+ return false;
}
lvrc->contextId = talloc_strndup(lvrc, (const char *)context_id.data, context_id.length);
if (!lvrc->contextId) {
- return False;
+ return false;
}
lvrc->ctxid_len = context_id.length;
} else {
@@ -621,455 +621,455 @@ static BOOL decode_vlv_response(void *mem_ctx, DATA_BLOB in, void **out)
}
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
*out = lvrc;
- return True;
+ return true;
}
-static BOOL encode_server_sort_response(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_server_sort_response(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_sort_resp_control *lsrc = talloc_get_type(in, struct ldb_sort_resp_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_enumerated(data, lsrc->result)) {
- return False;
+ return false;
}
if (lsrc->attr_desc) {
if (!asn1_write_OctetString(data, lsrc->attr_desc, strlen(lsrc->attr_desc))) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_server_sort_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_server_sort_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_server_sort_control **lssc = talloc_get_type(in, struct ldb_server_sort_control *);
struct asn1_data *data = asn1_init(mem_ctx);
int num;
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
for (num = 0; lssc[num]; num++) {
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_OctetString(data, lssc[num]->attributeName, strlen(lssc[num]->attributeName))) {
- return False;
+ return false;
}
if (lssc[num]->orderingRule) {
if (!asn1_write_OctetString(data, lssc[num]->orderingRule, strlen(lssc[num]->orderingRule))) {
- return False;
+ return false;
}
}
if (lssc[num]->reverse) {
if (!asn1_write_BOOLEAN(data, lssc[num]->reverse)) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_extended_dn_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_extended_dn_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_extended_dn_control *ledc = talloc_get_type(in, struct ldb_extended_dn_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, ledc->type)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_sd_flags_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_sd_flags_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_sd_flags_control *lsdfc = talloc_get_type(in, struct ldb_sd_flags_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lsdfc->secinfo_flags)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_search_options_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_search_options_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_search_options_control *lsoc = talloc_get_type(in, struct ldb_search_options_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lsoc->search_options)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_paged_results_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_paged_results_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_paged_control *lprc = talloc_get_type(in, struct ldb_paged_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lprc->size)) {
- return False;
+ return false;
}
if (!asn1_write_OctetString(data, lprc->cookie, lprc->cookie_len)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
/* seem that this controls has 2 forms one in case it is used with
* a Search Request and another when used ina Search Response
*/
-static BOOL encode_asq_control(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_asq_control(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_asq_control *lac = talloc_get_type(in, struct ldb_asq_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (lac->request) {
if (!asn1_write_OctetString(data, lac->source_attribute, lac->src_attr_len)) {
- return False;
+ return false;
}
} else {
if (!asn1_write_enumerated(data, lac->result)) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_dirsync_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_dirsync_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_dirsync_control *ldc = talloc_get_type(in, struct ldb_dirsync_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, ldc->flags)) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, ldc->max_attributes)) {
- return False;
+ return false;
}
if (!asn1_write_OctetString(data, ldc->cookie, ldc->cookie_len)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_domain_scope_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_domain_scope_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
if (in) {
- return False;
+ return false;
}
*out = data_blob(NULL, 0);
- return True;
+ return true;
}
-static BOOL encode_notification_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_notification_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
if (in) {
- return False;
+ return false;
}
*out = data_blob(NULL, 0);
- return True;
+ return true;
}
-static BOOL encode_show_deleted_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_show_deleted_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
if (in) {
- return False;
+ return false;
}
*out = data_blob(NULL, 0);
- return True;
+ return true;
}
-static BOOL encode_permissive_modify_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_permissive_modify_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
if (in) {
- return False;
+ return false;
}
*out = data_blob(NULL, 0);
- return True;
+ return true;
}
-static BOOL encode_manageDSAIT_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_manageDSAIT_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
if (in) {
- return False;
+ return false;
}
*out = data_blob(NULL, 0);
- return True;
+ return true;
}
-static BOOL encode_vlv_request(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_vlv_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_vlv_req_control *lvrc = talloc_get_type(in, struct ldb_vlv_req_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->beforeCount)) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->afterCount)) {
- return False;
+ return false;
}
if (lvrc->type == 0) {
if (!asn1_push_tag(data, ASN1_CONTEXT(0))) {
- return False;
+ return false;
}
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->match.byOffset.offset)) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->match.byOffset.contentCount)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) { /*SEQUENCE*/
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) { /*CONTEXT*/
- return False;
+ return false;
}
} else {
if (!asn1_push_tag(data, ASN1_CONTEXT(1))) {
- return False;
+ return false;
}
if (!asn1_write_OctetString(data, lvrc->match.gtOrEq.value, lvrc->match.gtOrEq.value_len)) {
- return False;
+ return false;
}
if (!asn1_pop_tag(data)) { /*CONTEXT*/
- return False;
+ return false;
}
}
if (lvrc->ctxid_len) {
if (!asn1_write_OctetString(data, lvrc->contextId, lvrc->ctxid_len)) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
-static BOOL encode_vlv_response(void *mem_ctx, void *in, DATA_BLOB *out)
+static bool encode_vlv_response(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_vlv_resp_control *lvrc = talloc_get_type(in, struct ldb_vlv_resp_control);
struct asn1_data *data = asn1_init(mem_ctx);
- if (!data) return False;
+ if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->targetPosition)) {
- return False;
+ return false;
}
if (!asn1_write_Integer(data, lvrc->contentCount)) {
- return False;
+ return false;
}
if (!asn1_write_enumerated(data, lvrc->vlv_result)) {
- return False;
+ return false;
}
if (lvrc->ctxid_len) {
if (!asn1_write_OctetString(data, lvrc->contextId, lvrc->ctxid_len)) {
- return False;
+ return false;
}
}
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
- return False;
+ return false;
}
talloc_free(data);
- return True;
+ return true;
}
struct control_handler ldap_known_controls[] = {
@@ -1095,49 +1095,49 @@ struct control_handler ldap_known_controls[] = {
{ NULL, NULL, NULL }
};
-BOOL ldap_decode_control_value(void *mem_ctx, DATA_BLOB value, struct ldb_control *ctrl)
+bool ldap_decode_control_value(void *mem_ctx, DATA_BLOB value, struct ldb_control *ctrl)
{
int i;
for (i = 0; ldap_known_controls[i].oid != NULL; i++) {
if (strcmp(ldap_known_controls[i].oid, ctrl->oid) == 0) {
if (!ldap_known_controls[i].decode || !ldap_known_controls[i].decode(mem_ctx, value, &ctrl->data)) {
- return False;
+ return false;
}
break;
}
}
if (ldap_known_controls[i].oid == NULL) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-BOOL ldap_decode_control_wrapper(void *mem_ctx, struct asn1_data *data, struct ldb_control *ctrl, DATA_BLOB *value)
+bool ldap_decode_control_wrapper(void *mem_ctx, struct asn1_data *data, struct ldb_control *ctrl, DATA_BLOB *value)
{
DATA_BLOB oid;
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_read_OctetString(data, mem_ctx, &oid)) {
- return False;
+ return false;
}
ctrl->oid = talloc_strndup(mem_ctx, (char *)oid.data, oid.length);
if (!ctrl->oid) {
- return False;
+ return false;
}
if (asn1_peek_tag(data, ASN1_BOOLEAN)) {
- BOOL critical;
+ bool critical;
if (!asn1_read_BOOLEAN(data, &critical)) {
- return False;
+ return false;
}
ctrl->critical = critical;
} else {
- ctrl->critical = False;
+ ctrl->critical = false;
}
ctrl->data = NULL;
@@ -1148,18 +1148,18 @@ BOOL ldap_decode_control_wrapper(void *mem_ctx, struct asn1_data *data, struct l
}
if (!asn1_read_OctetString(data, mem_ctx, value)) {
- return False;
+ return false;
}
end_tag:
if (!asn1_end_tag(data)) {
- return False;
+ return false;
}
- return True;
+ return true;
}
-BOOL ldap_encode_control(void *mem_ctx, struct asn1_data *data, struct ldb_control *ctrl)
+bool ldap_encode_control(void *mem_ctx, struct asn1_data *data, struct ldb_control *ctrl)
{
DATA_BLOB value;
int i;
@@ -1168,33 +1168,33 @@ BOOL ldap_encode_control(void *mem_ctx, struct asn1_data *data, struct ldb_contr
if (strcmp(ldap_known_controls[i].oid, ctrl->oid) == 0) {
if (!ldap_known_controls[i].encode) {
if (ctrl->critical) {
- return False;
+ return false;
} else {
/* not encoding this control */
- return True;
+ return true;
}
}
if (!ldap_known_controls[i].encode(mem_ctx, ctrl->data, &value)) {
- return False;
+ return false;
}
break;
}
}
if (ldap_known_controls[i].oid == NULL) {
- return False;
+ return false;
}
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
- return False;
+ return false;
}
if (!asn1_write_OctetString(data, ctrl->oid, strlen(ctrl->oid))) {
- return False;
+ return false;
}
if (ctrl->critical) {
if (!asn1_write_BOOLEAN(data, ctrl->critical)) {
- return False;
+ return false;
}
}
@@ -1203,13 +1203,13 @@ BOOL ldap_encode_control(void *mem_ctx, struct asn1_data *data, struct ldb_contr
}
if (!asn1_write_OctetString(data, value.data, value.length)) {
- return False;
+ return false;
}
pop_tag:
if (!asn1_pop_tag(data)) {
- return False;
+ return false;
}
- return True;
+ return true;
}
diff --git a/source4/libcli/ldap/ldap_ildap.c b/source4/libcli/ldap/ldap_ildap.c
index 62019b8cc1..7b592c65ae 100644
--- a/source4/libcli/ldap/ldap_ildap.c
+++ b/source4/libcli/ldap/ldap_ildap.c
@@ -41,7 +41,7 @@ int ildap_count_entries(struct ldap_connection *conn, struct ldap_message **res)
*/
NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
int scope, struct ldb_parse_tree *tree,
- const char * const *attrs, BOOL attributesonly,
+ const char * const *attrs, bool attributesonly,
struct ldb_control **control_req,
struct ldb_control ***control_res,
struct ldap_message ***results)
@@ -75,7 +75,7 @@ NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
req = ldap_request_send(conn, msg);
talloc_steal(msg, req);
- for (i=n=0;True;i++) {
+ for (i=n=0;true;i++) {
struct ldap_message *res;
status = ldap_result_n(req, i, &res);
if (!NT_STATUS_IS_OK(status)) break;
@@ -114,7 +114,7 @@ NTSTATUS ildap_search_bytree(struct ldap_connection *conn, const char *basedn,
*/
NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn,
int scope, const char *expression,
- const char * const *attrs, BOOL attributesonly,
+ const char * const *attrs, bool attributesonly,
struct ldb_control **control_req,
struct ldb_control ***control_res,
struct ldap_message ***results)
diff --git a/source4/libcli/ldap/ldap_msg.c b/source4/libcli/ldap/ldap_msg.c
index c9643dafda..12832b8ec4 100644
--- a/source4/libcli/ldap/ldap_msg.c
+++ b/source4/libcli/ldap/ldap_msg.c
@@ -32,7 +32,7 @@ struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx)
}
-BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value,
+bool add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value,
struct ldb_message_element *attrib)
{
attrib->values = talloc_realloc(mem_ctx,
@@ -40,16 +40,16 @@ BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value,
DATA_BLOB,
attrib->num_values+1);
if (attrib->values == NULL)
- return False;
+ return false;
attrib->values[attrib->num_values].data = talloc_steal(attrib->values,
value->data);
attrib->values[attrib->num_values].length = value->length;
attrib->num_values += 1;
- return True;
+ return true;
}
-BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx,
+bool add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx,
const struct ldb_message_element *attrib,
struct ldb_message_element **attribs,
int *num_attribs)
@@ -60,16 +60,16 @@ BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx,
*num_attribs+1);
if (*attribs == NULL)
- return False;
+ return false;
(*attribs)[*num_attribs] = *attrib;
talloc_steal(*attribs, attrib->values);
talloc_steal(*attribs, attrib->name);
*num_attribs += 1;
- return True;
+ return true;
}
-BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx,
+bool add_mod_to_array_talloc(TALLOC_CTX *mem_ctx,
struct ldap_mod *mod,
struct ldap_mod **mods,
int *num_mods)
@@ -77,10 +77,10 @@ BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx,
*mods = talloc_realloc(mem_ctx, *mods, struct ldap_mod, (*num_mods)+1);
if (*mods == NULL)
- return False;
+ return false;
(*mods)[*num_mods] = *mod;
*num_mods += 1;
- return True;
+ return true;
}