summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-03-08 07:24:03 +0100
committerVolker Lendecke <vl@samba.org>2010-03-10 14:37:35 +0100
commit184afeb57d0daeacfacdb8c976032697efe00214 (patch)
tree80cefaa632c2245555d34bade3c43c83a4518eef /source3/lib
parent7fdbbddf42bae65ef4f9679f7a2f14ccfc71fa88 (diff)
downloadsamba-184afeb57d0daeacfacdb8c976032697efe00214.tar.gz
samba-184afeb57d0daeacfacdb8c976032697efe00214.tar.bz2
samba-184afeb57d0daeacfacdb8c976032697efe00214.zip
s3: Make TLDAP_IS_ALPHA and TLDAP_IS_ADH static functions
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/tldap.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index c8f3af7982..fffa42cd33 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;
}
}