Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/libads/ldap_utils.c

    r414 r745  
    66   Copyright (C) Andrew Tridgell 2001
    77   Copyright (C) Guenther Deschner 2006,2007
    8    
     8
    99   This program is free software; you can redistribute it and/or modify
    1010   it under the terms of the GNU General Public License as published by
    1111   the Free Software Foundation; either version 3 of the License, or
    1212   (at your option) any later version.
    13    
     13
    1414   This program is distributed in the hope that it will be useful,
    1515   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1717   GNU General Public License for more details.
    18    
     18
    1919   You should have received a copy of the GNU General Public License
    2020   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    2222
    2323#include "includes.h"
     24#include "ads.h"
    2425
    2526#ifdef HAVE_LDAP
     27
     28static ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
     29                                             TALLOC_CTX *mem_ctx,
     30                                             int scope,
     31                                             const char *base,
     32                                             const char *filter,
     33                                             const char **attrs,
     34                                             void *args,
     35                                             const char *range_attr,
     36                                             char ***strings,
     37                                             size_t *num_strings,
     38                                             uint32 *first_usn,
     39                                             int *num_retries,
     40                                             bool *more_values);
     41
    2642/*
    2743  a wrapper around ldap_search_s that retries depending on the error code
     
    4056
    4157        if (!ads->ldap.ld &&
    42             time(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
     58            time_mono(NULL) - ads->ldap.last_attempt < ADS_RECONNECT_TIME) {
    4359                return ADS_ERROR(LDAP_SERVER_DOWN);
    4460        }
     
    7288                        ads_msgfree(ads, *res);
    7389                *res = NULL;
    74                
     90
    7591                DEBUG(3,("Reopening ads connection to realm '%s' after error %s\n",
    7692                         ads->config.realm, ads_errstr(status)));
    77                          
     93
    7894                ads_disconnect(ads);
    7995                status = ads_connect(ads);
    80                
     96
    8197                if (!ADS_ERR_OK(status)) {
    8298                        DEBUG(1,("ads_search_retry: failed to reconnect (%s)\n",
     
    121137}
    122138
    123  ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,
    124                                      int scope, const char *expr,
    125                                      const char **attrs, void *args,
    126                                      LDAPMessage **res)
     139static ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,
     140                                           int scope, const char *expr,
     141                                           const char **attrs, void *args,
     142                                           LDAPMessage **res)
    127143{
    128144        return ads_do_search_retry_internal(ads, bind_path, scope, expr, attrs, args, res);
     
    143159        return ads_do_search_retry(ads, dn, LDAP_SCOPE_BASE,
    144160                                   "(objectclass=*)", attrs, res);
    145 }
    146 
    147  ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res,
    148                                          const char *dn,
    149                                          const char **attrs,
    150                                          enum ads_extended_dn_flags flags)
    151 {
    152         ads_control args;
    153 
    154         args.control = ADS_EXTENDED_DN_OID;
    155         args.val = flags;
    156         args.critical = True;
    157 
    158         return ads_do_search_retry_args(ads, dn, LDAP_SCOPE_BASE,
    159                                         "(objectclass=*)", attrs, &args, res);
    160161}
    161162
     
    200201
    201202 ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res,
    202                                  const DOM_SID *sid,
     203                                 const struct dom_sid *sid,
    203204                                 const char **attrs)
    204205{
    205206        char *dn, *sid_string;
    206207        ADS_STATUS status;
    207        
     208
    208209        sid_string = sid_binstring_hex(sid);
    209210        if (sid_string == NULL) {
     
    278279}
    279280
    280 ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
     281static ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
    281282                                      TALLOC_CTX *mem_ctx,
    282283                                      int scope,
     
    308309                return status;
    309310        }
    310        
     311
    311312        if (!res) {
    312313                return ADS_ERROR(LDAP_NO_MEMORY);
Note: See TracChangeset for help on using the changeset viewer.