Changeset 740 for vendor/current/libcli/ldap
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/libcli/ldap
- Files:
-
- 1 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/libcli/ldap/ldap_message.c
r414 r740 168 168 169 169 for (i = 0; handlers[i].oid != NULL; i++) { 170 if (!ctrl->oid) { 171 /* not encoding this control, the OID has been 172 * set to NULL indicating it isn't really 173 * here */ 174 return true; 175 } 170 176 if (strcmp(handlers[i].oid, ctrl->oid) == 0) { 171 177 if (!handlers[i].encode) { … … 435 441 case LDAP_TAG_UnbindRequest: { 436 442 /* struct ldap_UnbindRequest *r = &msg->r.UnbindRequest; */ 443 asn1_push_tag(data, ASN1_APPLICATION_SIMPLE(msg->type)); 444 asn1_pop_tag(data); 437 445 break; 438 446 } … … 669 677 control_handlers, 670 678 msg->controls[i])) { 679 DEBUG(1,("Unable to encode control %s\n", 680 msg->controls[i]->oid)); 671 681 return false; 672 682 } … … 1608 1618 NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size) 1609 1619 { 1610 return asn1_full_tag(blob, ASN1_SEQUENCE(0), packet_size); 1611 } 1620 if (blob.length < 6) { 1621 /* 1622 * We need at least 6 bytes to workout the length 1623 * of the pdu. 1624 */ 1625 return STATUS_MORE_ENTRIES; 1626 } 1627 return asn1_peek_full_tag(blob, ASN1_SEQUENCE(0), packet_size); 1628 } -
vendor/current/libcli/ldap/ldap_message.h
r414 r740 23 23 24 24 #include "../libcli/ldap/ldap_errors.h" 25 #include "lib/ldb/include/ldb.h" 25 #if _SAMBA_BUILD_ == 3 26 #include "lib/ldb_compat.h" 27 #else 28 #include <ldb.h> 29 #endif 26 30 27 31 enum ldap_request_tag { -
vendor/current/libcli/ldap/ldap_ndr.c
r414 r740 22 22 23 23 #include "includes.h" 24 #include "lib/ldb/include/ldb.h" 24 #if _SAMBA_BUILD_ == 3 25 #include "lib/ldb_compat.h" 26 #else 27 #include <ldb.h> 28 #endif 25 29 #include "librpc/gen_ndr/ndr_security.h" 26 30 #include "librpc/gen_ndr/ndr_misc.h" … … 48 52 enum ndr_err_code ndr_err; 49 53 char *ret; 50 ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL,sid,54 ndr_err = ndr_push_struct_blob(&blob, mem_ctx, sid, 51 55 (ndr_push_flags_fn_t)ndr_push_dom_sid); 52 56 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 62 66 encode a NDR GUID as a ldap filter element 63 67 */ 64 char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid)68 char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid) 65 69 { 66 70 DATA_BLOB blob; 67 enum ndr_err_code ndr_err;71 NTSTATUS status; 68 72 char *ret; 69 ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL, guid, 70 (ndr_push_flags_fn_t)ndr_push_GUID); 71 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 73 status = GUID_to_ndr_blob(guid, mem_ctx, &blob); 74 if (!NT_STATUS_IS_OK(status)) { 72 75 return NULL; 73 76 } … … 87 90 blob.data = val.data; 88 91 blob.length = val.length; 89 ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL,guid,92 ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, guid, 90 93 (ndr_pull_flags_fn_t)ndr_pull_GUID); 91 94 talloc_free(val.data); -
vendor/current/libcli/ldap/ldap_ndr.h
r414 r740 1 /* 2 Unix SMB/CIFS mplementation. 3 4 wrap/unwrap NDR encoded elements for ldap calls 5 6 Copyright (C) Andrew Tridgell 2005 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3 of the License, or 11 (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21 */ 22 1 23 #ifndef __LIBCLI_LDAP_LDAP_NDR_H__ 2 24 #define __LIBCLI_LDAP_LDAP_NDR_H__ … … 6 28 char *ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t value); 7 29 char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); 8 char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid);30 char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid); 9 31 NTSTATUS ldap_decode_ndr_GUID(TALLOC_CTX *mem_ctx, struct ldb_val val, struct GUID *guid); 10 32
Note:
See TracChangeset
for help on using the changeset viewer.