[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sat Nov 20 07:29:01 MST 2010


The branch, master has been updated
       via  2036d64 s3: Remove a #define used just once
       via  da75c01 s3: Remove unused ads_get_attrname_by_oid
       via  d14cf7a s3: Make ads_get_attrnames_by_oids static
       via  491fdb2 s3: Make ads_ranged_search_internal static
       via  365116e s3: Fix some nonempty blank lines
       via  b3091e0 s3: Remove unused ads_search_retry_extended_dn
       via  cdf52d5 s3: Make ads_do_search_retry_args() static
      from  e3017e6 s4:acl LDB module - it's more correct to count the password attributes using "unsigned int"

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2036d64e59732f8f80e40d56f64db6594283be75
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:46:12 2010 +0100

    s3: Remove a #define used just once
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Sat Nov 20 15:28:26 CET 2010 on sn-devel-104

commit da75c017624679354b3f3561c106ee0cef36c4bc
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:22:17 2010 +0100

    s3: Remove unused ads_get_attrname_by_oid

commit d14cf7a50b8ef5740c82028da3eba3a9d7992b45
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:20:43 2010 +0100

    s3: Make ads_get_attrnames_by_oids static

commit 491fdb24e44c0b4ba6004ce9f4dc071f1632d5d2
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:18:56 2010 +0100

    s3: Make ads_ranged_search_internal static

commit 365116ea921be0d549aebae65aa2e097108e6917
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:17:32 2010 +0100

    s3: Fix some nonempty blank lines

commit b3091e0e22acc10e1659c29fa63e2a1bde96c6df
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:12:35 2010 +0100

    s3: Remove unused ads_search_retry_extended_dn

commit cdf52d56d5476f77c5a594a996a1a7d65dc16ab4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 16 19:10:50 2010 +0100

    s3: Make ads_do_search_retry_args() static

-----------------------------------------------------------------------

Summary of changes:
 source3/libads/ads_ldap_protos.h |    8 -----
 source3/libads/ads_proto.h       |   13 ---------
 source3/libads/ldap_schema.c     |   52 +++++------------------------------
 source3/libads/ldap_schema.h     |    5 ---
 source3/libads/ldap_utils.c      |   56 +++++++++++++++++++-------------------
 source3/libsmb/dsgetdcname.c     |    4 +-
 6 files changed, 37 insertions(+), 101 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/ads_ldap_protos.h b/source3/libads/ads_ldap_protos.h
index a4821d8..d7f93b7 100644
--- a/source3/libads/ads_ldap_protos.h
+++ b/source3/libads/ads_ldap_protos.h
@@ -63,19 +63,11 @@ ADS_STATUS ads_do_search_retry(ADS_STRUCT *ads, const char *bind_path,
 			       int scope,
 			       const char *expr,
 			       const char **attrs, LDAPMessage **res);
-ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,
-				    int scope, const char *expr,
-				    const char **attrs, void *args,
-				    LDAPMessage **res);
 ADS_STATUS ads_search_retry(ADS_STRUCT *ads, LDAPMessage **res,
 			    const char *expr, const char **attrs);
 ADS_STATUS ads_search_retry_dn(ADS_STRUCT *ads, LDAPMessage **res,
 			       const char *dn,
 			       const char **attrs);
-ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res,
-					const char *dn,
-					const char **attrs,
-					enum ads_extended_dn_flags flags);
 ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
 						const char *dn,
 						const char **attrs,
diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h
index b924034..6fbd3aa 100644
--- a/source3/libads/ads_proto.h
+++ b/source3/libads/ads_proto.h
@@ -130,19 +130,6 @@ ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
 			     const char *range_attr,
 			     char ***strings,
 			     size_t *num_strings);
-ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
-				      TALLOC_CTX *mem_ctx,
-				      int scope,
-				      const char *base,
-				      const char *filter,
-				      const char **attrs,
-				      void *args,
-				      const char *range_attr,
-				      char ***strings,
-				      size_t *num_strings,
-				      uint32 *first_usn,
-				      int *num_retries,
-				      bool *more_values);
 
 /* The following definitions come from libads/ndr.c  */
 
diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c
index 66c9bf4..51aac14 100644
--- a/source3/libads/ldap_schema.c
+++ b/source3/libads/ldap_schema.c
@@ -25,10 +25,13 @@
 
 #ifdef HAVE_LDAP
 
-ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
-				     const char *schema_path,
-				     const char **OIDs, size_t num_OIDs, 
-				     char ***OIDs_out, char ***names, size_t *count)
+static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads,
+					    TALLOC_CTX *mem_ctx,
+					    const char *schema_path,
+					    const char **OIDs,
+					    size_t num_OIDs,
+					    char ***OIDs_out, char ***names,
+					    size_t *count)
 {
 	ADS_STATUS status;
 	LDAPMessage *res = NULL;
@@ -154,47 +157,6 @@ const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
 	
 }
 
-const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, const char *schema_path, TALLOC_CTX *mem_ctx, const char * OID)
-{
-	ADS_STATUS rc;
-	int count = 0;
-	LDAPMessage *res = NULL;
-	char *expr = NULL;
-	const char *attrs[] = { "lDAPDisplayName", NULL };
-	char *result;
-
-	if (ads == NULL || mem_ctx == NULL || OID == NULL) {
-		goto failed;
-	}
-
-	expr = talloc_asprintf(mem_ctx, "(attributeId=%s)", OID);
-	if (expr == NULL) {
-		goto failed;
-	}
-
-	rc = ads_do_search_retry(ads, schema_path, LDAP_SCOPE_SUBTREE, 
-		expr, attrs, &res);
-	if (!ADS_ERR_OK(rc)) {
-		goto failed;
-	}
-
-	count = ads_count_replies(ads, res);
-	if (count == 0 || !res) {
-		goto failed;
-	}
-
-	result = ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
-	ads_msgfree(ads, res);
-
-	return result;
-	
-failed:
-	DEBUG(0,("ads_get_attrname_by_oid: failed to retrieve name for oid: %s\n", 
-		OID));
-	
-	ads_msgfree(ads, res);
-	return NULL;
-}
 /*********************************************************************
 *********************************************************************/
 
diff --git a/source3/libads/ldap_schema.h b/source3/libads/ldap_schema.h
index 90ce203..44964dd 100644
--- a/source3/libads/ldap_schema.h
+++ b/source3/libads/ldap_schema.h
@@ -46,15 +46,10 @@ enum wb_posix_mapping {
 
 /* The following definitions come from libads/ldap_schema.c  */
 
-ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
-				     const char *schema_path,
-				     const char **OIDs, size_t num_OIDs,
-				     char ***OIDs_out, char ***names, size_t *count);
 const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
 				     const char *schema_path,
 				     TALLOC_CTX *mem_ctx,
 				     const struct GUID *schema_guid);
-const char *ads_get_attrname_by_oid(ADS_STRUCT *ads, const char *schema_path, TALLOC_CTX *mem_ctx, const char * OID);
 ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **schema_path);
 ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
 					  ADS_STRUCT *ads,
diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c
index 0c07961..ab77abd 100644
--- a/source3/libads/ldap_utils.c
+++ b/source3/libads/ldap_utils.c
@@ -5,17 +5,17 @@
 
    Copyright (C) Andrew Tridgell 2001
    Copyright (C) Guenther Deschner 2006,2007
-   
+
    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/>.
 */
@@ -24,6 +24,21 @@
 #include "ads.h"
 
 #ifdef HAVE_LDAP
+
+static ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
+					     TALLOC_CTX *mem_ctx,
+					     int scope,
+					     const char *base,
+					     const char *filter,
+					     const char **attrs,
+					     void *args,
+					     const char *range_attr,
+					     char ***strings,
+					     size_t *num_strings,
+					     uint32 *first_usn,
+					     int *num_retries,
+					     bool *more_values);
+
 /*
   a wrapper around ldap_search_s that retries depending on the error code
   this is supposed to catch dropped connections and auto-reconnect
@@ -72,13 +87,13 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind
 		if (*res) 
 			ads_msgfree(ads, *res);
 		*res = NULL;
-		
+
 		DEBUG(3,("Reopening ads connection to realm '%s' after error %s\n", 
 			 ads->config.realm, ads_errstr(status)));
-			 
+
 		ads_disconnect(ads);
 		status = ads_connect(ads);
-		
+
 		if (!ADS_ERR_OK(status)) {
 			DEBUG(1,("ads_search_retry: failed to reconnect (%s)\n",
 				 ads_errstr(status)));
@@ -121,10 +136,10 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind
 	return ads_do_search_retry_internal(ads, bind_path, scope, expr, attrs, NULL, res);
 }
 
- ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,
-				     int scope, const char *expr,
-				     const char **attrs, void *args,
-				     LDAPMessage **res)
+static ADS_STATUS ads_do_search_retry_args(ADS_STRUCT *ads, const char *bind_path,
+					   int scope, const char *expr,
+					   const char **attrs, void *args,
+					   LDAPMessage **res)
 {
 	return ads_do_search_retry_internal(ads, bind_path, scope, expr, attrs, args, res);
 }
@@ -145,21 +160,6 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind
 				   "(objectclass=*)", attrs, res);
 }
 
- ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res, 
-					 const char *dn, 
-					 const char **attrs,
-					 enum ads_extended_dn_flags flags)
-{
-	ads_control args;
-
-	args.control = ADS_EXTENDED_DN_OID;
-	args.val = flags;
-	args.critical = True;
-
-	return ads_do_search_retry_args(ads, dn, LDAP_SCOPE_BASE,
-					"(objectclass=*)", attrs, &args, res);
-}
-
  ADS_STATUS ads_search_retry_dn_sd_flags(ADS_STRUCT *ads, LDAPMessage **res, 
 					 uint32 sd_flags,
 					 const char *dn, 
@@ -205,7 +205,7 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind
 {
 	char *dn, *sid_string;
 	ADS_STATUS status;
-	
+
 	sid_string = sid_binstring_hex(sid);
 	if (sid_string == NULL) {
 		return ADS_ERROR(LDAP_NO_MEMORY);
@@ -278,7 +278,7 @@ ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
 	return status;
 }
 
-ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads, 
+static ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
 				      TALLOC_CTX *mem_ctx,
 				      int scope,
 				      const char *base,
@@ -308,7 +308,7 @@ ADS_STATUS ads_ranged_search_internal(ADS_STRUCT *ads,
 			 ads_errstr(status)));
 		return status;
 	}
-	
+
 	if (!res) {
 		return ADS_ERROR(LDAP_NO_MEMORY);
 	}
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 1b57c04..b1acee8 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -27,7 +27,6 @@
 #include "libads/dns.h"
 #include "libsmb/clidgram.h"
 
-#define DSGETDCNAME_FMT	"DSGETDCNAME/DOMAIN/%s"
 /* 15 minutes */
 #define DSGETDCNAME_CACHE_TTL	60*15
 
@@ -127,7 +126,8 @@ static char *dsgetdcname_cache_key(TALLOC_CTX *mem_ctx, const char *domain)
 		return NULL;
 	}
 
-	return talloc_asprintf_strupper_m(mem_ctx, DSGETDCNAME_FMT, domain);
+	return talloc_asprintf_strupper_m(mem_ctx, "DSGETDCNAME/DOMAIN/%s",
+					  domain);
 }
 
 /****************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list