-/*
+/*
Unix SMB/CIFS implementation.
LDAP protocol helper functions for SAMBA
-
+
Copyright (C) Simo Sorce 2005
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
*/
#include "includes.h"
}
lssc[num]->reverse = reverse;
}
-
+
if (!asn1_end_tag(data)) {
return false;
}
if (!asn1_read_Integer(data, &(ledc->type))) {
return false;
}
-
+
if (!asn1_end_tag(data)) {
return false;
}
if (!asn1_read_Integer(data, &(lprc->size))) {
return false;
}
-
+
if (!asn1_read_OctetString(data, mem_ctx, &cookie)) {
return false;
}
if (!asn1_read_Integer(data, &(ldc->flags))) {
return false;
}
-
+
if (!asn1_read_Integer(data, &(ldc->max_attributes))) {
return false;
}
-
+
if (!asn1_read_OctetString(data, mem_ctx, &cookie)) {
return false;
}
if (!asn1_read_Integer(data, &(lvrc->beforeCount))) {
return false;
}
-
+
if (!asn1_read_Integer(data, &(lvrc->afterCount))) {
return false;
}
if (!asn1_read_Integer(data, &(lvrc->targetPosition))) {
return false;
}
-
+
if (!asn1_read_Integer(data, &(lvrc->contentCount))) {
return false;
}
-
+
if (!asn1_read_enumerated(data, &(lvrc->vlv_result))) {
return false;
}
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
return false;
}
-
+
if (!asn1_write_OctetString(data, lssc[num]->attributeName, strlen(lssc[num]->attributeName))) {
return false;
}
if (!asn1_write_OctetString(data, lprc->cookie, lprc->cookie_len)) {
return false;
- }
+ }
if (!asn1_pop_tag(data)) {
return false;
if (!asn1_write_OctetString(data, ldc->cookie, ldc->cookie_len)) {
return false;
- }
+ }
if (!asn1_pop_tag(data)) {
return false;
if (!asn1_push_tag(data, ASN1_CONTEXT(0))) {
return false;
}
-
+
if (!asn1_write_Integer(data, lvrc->match.byOffset.offset)) {
return false;
}
if (!asn1_push_tag(data, ASN1_CONTEXT_SIMPLE(1))) {
return false;
}
-
+
if (!asn1_write(data, lvrc->match.gtOrEq.value, lvrc->match.gtOrEq.value_len)) {
return false;
}
struct asn1_data *data = asn1_init(mem_ctx, ASN1_MAX_TREE_DEPTH);
if (!data) return false;
-
+
if (!control) return false;
-
+
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
return false;
}
-
+
for (i=0; control->dereference && control->dereference[i]; i++) {
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
return false;
return false;
}
for (j=0; control->dereference && control->dereference[i]->dereference_attribute[j]; j++) {
- if (!asn1_write_OctetString(data, control->dereference[i]->dereference_attribute[j],
+ if (!asn1_write_OctetString(data, control->dereference[i]->dereference_attribute[j],
strlen(control->dereference[i]->dereference_attribute[j]))) {
return false;
}
}
-
+
if (!asn1_pop_tag(data)) {
return false;
}
return false;
}
- while (asn1_tag_remaining(data) > 0) {
+ while (asn1_tag_remaining(data) > 0) {
r = talloc_realloc(control, r, struct dsdb_openldap_dereference_result *, i + 2);
if (!r) {
return false;
if (!asn1_start_tag(data, ASN1_SEQUENCE(0))) {
return false;
}
-
+
if (!asn1_read_OctetString_talloc(r[i], data, &r[i]->source_attribute)) {
return false;
}
{
return ldap_known_controls;
}
-