summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2012-10-19 20:34:21 +0000
committerArthur de Jong <arthur@arthurdejong.org>2012-10-19 20:34:21 +0000
commit8cc09cd0cfb7dfba4a6262bb7839c934102ef3fe (patch)
tree92e708a31ac1d12a1144b982eb882890f793cd63
parente3d4472321a5376421d9930bd47171837d6eb1e4 (diff)
allow attribute options in attribute mapping expressions
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1803 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--common/expr.c2
-rw-r--r--tests/test_expr.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/common/expr.c b/common/expr.c
index 7fa4f84..33f9820 100644
--- a/common/expr.c
+++ b/common/expr.c
@@ -51,7 +51,7 @@ MUST_USE static const char *parse_name(const char *str,int *ptr,char *buffer,siz
/* look for an alpha+alphanumeric* string */
if (!my_isalpha(str[*ptr]))
return NULL;
- while (my_isalphanum(str[*ptr]))
+ while (my_isalphanum(str[*ptr])||(str[*ptr]==';'))
{
if ((size_t)i>=buflen)
return NULL;
diff --git a/tests/test_expr.c b/tests/test_expr.c
index 1ea4f8d..da8f46a 100644
--- a/tests/test_expr.c
+++ b/tests/test_expr.c
@@ -126,6 +126,11 @@ static void test_expr_vars(void)
assert(set_contains(set,"uidNumber"));
assert(set_contains(set,"uid"));
set_free(set);
+ /* a test with attribute options */
+ set=set_new();
+ assert(expr_vars("\"${homeDirectory;foo:-/home/something}\"",set)!=NULL);
+ assert(set_contains(set,"homeDirectory;foo"));
+ set_free(set);
}
/* the main program... */