Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

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  
    168168
    169169        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                }
    170176                if (strcmp(handlers[i].oid, ctrl->oid) == 0) {
    171177                        if (!handlers[i].encode) {
     
    435441        case LDAP_TAG_UnbindRequest: {
    436442/*              struct ldap_UnbindRequest *r = &msg->r.UnbindRequest; */
     443                asn1_push_tag(data, ASN1_APPLICATION_SIMPLE(msg->type));
     444                asn1_pop_tag(data);
    437445                break;
    438446        }
     
    669677                                                 control_handlers,
    670678                                                 msg->controls[i])) {
     679                                DEBUG(1,("Unable to encode control %s\n",
     680                                         msg->controls[i]->oid));
    671681                                return false;
    672682                        }
     
    16081618NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size)
    16091619{
    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  
    2323
    2424#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
    2630
    2731enum ldap_request_tag {
  • vendor/current/libcli/ldap/ldap_ndr.c

    r414 r740  
    2222
    2323#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
    2529#include "librpc/gen_ndr/ndr_security.h"
    2630#include "librpc/gen_ndr/ndr_misc.h"
     
    4852        enum ndr_err_code ndr_err;
    4953        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,
    5155                                       (ndr_push_flags_fn_t)ndr_push_dom_sid);
    5256        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
     
    6266  encode a NDR GUID as a ldap filter element
    6367*/
    64 char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid)
     68char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid)
    6569{
    6670        DATA_BLOB blob;
    67         enum ndr_err_code ndr_err;
     71        NTSTATUS status;
    6872        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)) {
    7275                return NULL;
    7376        }
     
    8790        blob.data = val.data;
    8891        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,
    9093                                       (ndr_pull_flags_fn_t)ndr_pull_GUID);
    9194        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
    123#ifndef __LIBCLI_LDAP_LDAP_NDR_H__
    224#define __LIBCLI_LDAP_LDAP_NDR_H__
     
    628char *ldap_encode_ndr_uint32(TALLOC_CTX *mem_ctx, uint32_t value);
    729char *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);
     30char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid);
    931NTSTATUS ldap_decode_ndr_GUID(TALLOC_CTX *mem_ctx, struct ldb_val val, struct GUID *guid);
    1032
Note: See TracChangeset for help on using the changeset viewer.