mirror of
https://github.com/samba-team/samba.git
synced 2025-11-04 00:23:49 +03:00
r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without warnings on gcc4. Unfortunately That required a lot of casts :-( I have also added the start of an 'operational' module, which will replace the timestamp module, plus add support for some other operational attributes In ldb_msg_*() I added some new utility functions to make the operational module sane, and remove the 'ldb' argument from the ldb_msg_add_*() functions. That argument was only needed back in the early days of ldb when we didn't use the hierarchical talloc and thus needed a place to get the allocation function from. Now its just a pain to pass around everywhere. Also added a ldb_debug_set() function that calls ldb_debug() plus sets the result using ldb_set_errstring(). That saves on some awkward coding in a few places.
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
1183af06b7
commit
f6818daecc
@@ -79,7 +79,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
|
||||
i = 0;
|
||||
if ( ! tree->u.substring.start_with_wildcard) {
|
||||
asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(0));
|
||||
asn1_write_LDAPString(data, tree->u.substring.chunks[i]->data);
|
||||
asn1_write_LDAPString(data, (char *)tree->u.substring.chunks[i]->data);
|
||||
asn1_pop_tag(data);
|
||||
i++;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
|
||||
ctx = 1;
|
||||
}
|
||||
asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(ctx));
|
||||
asn1_write_LDAPString(data, tree->u.substring.chunks[i]->data);
|
||||
asn1_write_LDAPString(data, (char *)tree->u.substring.chunks[i]->data);
|
||||
asn1_pop_tag(data);
|
||||
i++;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ static BOOL ldap_push_filter(struct asn1_data *data, struct ldb_parse_tree *tree
|
||||
asn1_pop_tag(data);
|
||||
}
|
||||
asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(3));
|
||||
asn1_write_LDAPString(data, tree->u.extended.value.data);
|
||||
asn1_write_LDAPString(data, (char *)tree->u.extended.value.data);
|
||||
asn1_pop_tag(data);
|
||||
asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(4));
|
||||
asn1_write_uint8(data, tree->u.extended.dnAttributes);
|
||||
@@ -517,7 +517,7 @@ static struct ldb_val **ldap_decode_substring(TALLOC_CTX *mem_ctx, struct ldb_va
|
||||
return NULL;
|
||||
}
|
||||
|
||||
chunks[chunk_num]->data = talloc_strdup(mem_ctx, value);
|
||||
chunks[chunk_num]->data = (uint8_t *)talloc_strdup(mem_ctx, value);
|
||||
if (chunks[chunk_num]->data == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -631,8 +631,7 @@ static struct ldb_parse_tree *ldap_decode_filter_tree(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
ret->operation = LDB_OP_SUBSTRING;
|
||||
ret->u.substring.attr = talloc_memdup(ret, attr.data, attr.length + 1);
|
||||
ret->u.substring.attr[attr.length] = '\0';
|
||||
ret->u.substring.attr = talloc_strndup(ret, (char *)attr.data, attr.length);
|
||||
ret->u.substring.chunks = NULL;
|
||||
ret->u.substring.start_with_wildcard = 1;
|
||||
ret->u.substring.end_with_wildcard = 1;
|
||||
|
||||
Reference in New Issue
Block a user