aboutsummaryrefslogtreecommitdiff
path: root/lib/ldapmap.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-10-09 17:58:33 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-10-09 17:58:33 +0300
commitf88aa8437de7e756aa5b8eb052ae4649bb3891cb (patch)
tree3030799fa8f8e6690bd71964c8de2c840dfa9d56 /lib/ldapmap.c
parentba2c9a15f42437c051738ca93d7129245791d660 (diff)
downloadeclat-f88aa8437de7e756aa5b8eb052ae4649bb3891cb.tar.gz
eclat-f88aa8437de7e756aa5b8eb052ae4649bb3891cb.tar.bz2
Improve the docs.
* doc/eclat.conf.5: New file. * doc/Makefile.am: Add new file. * doc/eclat.1: Update. * lib/expand.c (eclat_expand_kw): New macro: login. * lib/filemap.c: Add the "key" statement. * lib/gdbmmap.c: Likewise. * lib/ldapmap.c: Likewise. (ldap_map_open): Always expand binddn.
Diffstat (limited to 'lib/ldapmap.c')
-rw-r--r--lib/ldapmap.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/ldapmap.c b/lib/ldapmap.c
index 590a111..1f08179 100644
--- a/lib/ldapmap.c
+++ b/lib/ldapmap.c
@@ -73,6 +73,7 @@ static char *typestr;
static struct grecs_keyword ldapmap_kw[] = {
{ "type", "'ldap", "Set map type", grecs_type_null },
+ { "key", "<arg: string>", "key expression", grecs_type_null },
{ "uri", "arg",
"Set LDAP URI",
grecs_type_string, GRECS_DFLT,
@@ -463,17 +464,18 @@ ldap_map_open(int dbg, void *data)
p = eclat_getans("User name", user, 0);
free(user);
user = p;
- if (map->binddn) {
- kw[0] = "user";
- kw[1] = user;
- kw[2] = NULL;
- p = eclat_expand_kw(map->binddn, kw);
- } else
- p = grecs_strdup(user);
- free(map->binddn);
- map->binddn = p;
}
+ if (map->binddn) {
+ kw[0] = "user";
+ kw[1] = user;
+ kw[2] = NULL;
+ p = eclat_expand_kw(map->binddn, kw);
+ free(map->binddn);
+ map->binddn = p;
+ } else
+ map->binddn = grecs_strdup(user);
+
if (map->passfile) {
char *filename = eclat_expand_kw(map->passfile, kw);
FILE *fp = fopen(filename, "r");

Return to:

Send suggestions and report system problems to the System administrator.