Changeset 745 for trunk/server/source3/libads/ldap_utils.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/libads/ldap_utils.c
r414 r745 6 6 Copyright (C) Andrew Tridgell 2001 7 7 Copyright (C) Guenther Deschner 2006,2007 8 8 9 9 This program is free software; you can redistribute it and/or modify 10 10 it under the terms of the GNU General Public License as published by 11 11 the Free Software Foundation; either version 3 of the License, or 12 12 (at your option) any later version. 13 13 14 14 This program is distributed in the hope that it will be useful, 15 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 GNU General Public License for more details. 18 18 19 19 You should have received a copy of the GNU General Public License 20 20 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 22 22 23 23 #include "includes.h" 24 #include "ads.h" 24 25 25 26 #ifdef HAVE_LDAP 27 28 static 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 26 42 /* 27 43 a wrapper around ldap_search_s that retries depending on the error code … … 40 56 41 57 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) { 43 59 return ADS_ERROR(LDAP_SERVER_DOWN); 44 60 } … … 72 88 ads_msgfree(ads, *res); 73 89 *res = NULL; 74 90 75 91 DEBUG(3,("Reopening ads connection to realm '%s' after error %s\n", 76 92 ads->config.realm, ads_errstr(status))); 77 93 78 94 ads_disconnect(ads); 79 95 status = ads_connect(ads); 80 96 81 97 if (!ADS_ERR_OK(status)) { 82 98 DEBUG(1,("ads_search_retry: failed to reconnect (%s)\n", … … 121 137 } 122 138 123 ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,124 125 126 139 static 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) 127 143 { 128 144 return ads_do_search_retry_internal(ads, bind_path, scope, expr, attrs, args, res); … … 143 159 return ads_do_search_retry(ads, dn, LDAP_SCOPE_BASE, 144 160 "(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);160 161 } 161 162 … … 200 201 201 202 ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, 202 const DOM_SID*sid,203 const struct dom_sid *sid, 203 204 const char **attrs) 204 205 { 205 206 char *dn, *sid_string; 206 207 ADS_STATUS status; 207 208 208 209 sid_string = sid_binstring_hex(sid); 209 210 if (sid_string == NULL) { … … 278 279 } 279 280 280 ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads, 281 static ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads, 281 282 TALLOC_CTX *mem_ctx, 282 283 int scope, … … 308 309 return status; 309 310 } 310 311 311 312 if (!res) { 312 313 return ADS_ERROR(LDAP_NO_MEMORY);
Note:
See TracChangeset
for help on using the changeset viewer.