[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Wed Mar 10 06:38:02 MST 2010


The branch, master has been updated
       via  184afeb... s3: Make TLDAP_IS_ALPHA and TLDAP_IS_ADH static functions
      from  7fdbbdd... s3-passdb: Fix typo in debug message.

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


- Log -----------------------------------------------------------------
commit 184afeb57d0daeacfacdb8c976032697efe00214
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 8 07:24:03 2010 +0100

    s3: Make TLDAP_IS_ALPHA and TLDAP_IS_ADH static functions

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

Summary of changes:
 source3/lib/tldap.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index c8f3af7..fffa42c 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -957,10 +957,17 @@ int tldap_simple_bind(struct tldap_context *ld, const char *dn,
 /*****************************************************************************/
 
 /* can't use isalpha() as only a strict set is valid for LDAP */
-#define TLDAP_IS_ALPHA(c) ((((c) >= 'a') && ((c) <= 'z')) || \
-			   (((c) >= 'A') && ((c) <= 'Z')))
 
-#define TLDAP_IS_ADH(c) (TLDAP_IS_ALPHA(c) || isdigit(c) || (c) == '-')
+static bool tldap_is_alpha(char c)
+{
+	return (((c >= 'a') && (c <= 'z')) || \
+		((c >= 'A') && (c <= 'Z')));
+}
+
+static bool tldap_is_adh(char c)
+{
+	return tldap_is_alpha(c) || isdigit(c) || (c == '-');
+}
 
 #define TLDAP_FILTER_AND  ASN1_CONTEXT(0)
 #define TLDAP_FILTER_OR   ASN1_CONTEXT(1)
@@ -992,7 +999,7 @@ static bool tldap_is_attrdesc(const char *s, int len, bool no_tagopts)
 	/* first char has stricter rules */
 	if (isdigit(*s)) {
 		is_oid = true;
-	} else if (!TLDAP_IS_ALPHA(*s)) {
+	} else if (!tldap_is_alpha(*s)) {
 		/* bad first char */
 		return false;
 	}
@@ -1013,7 +1020,7 @@ static bool tldap_is_attrdesc(const char *s, int len, bool no_tagopts)
 				continue;
 			}
 		} else {
-			if (TLDAP_IS_ADH(s[i])) {
+			if (tldap_is_adh(s[i])) {
 				continue;
 			}
 		}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list