Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/alias.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2009-05-24 10:56:33 +0200
committerArthur de Jong <arthur@arthurdejong.org>2009-05-24 10:56:33 +0200
commit6bdd24fe2857258515496a6eedd7ee8650144582 (patch)
treef6a37aa31062c567f528d13a0eafa6c2dd22c7d8 /nslcd/alias.c
parentd50fe928bb5526892f091f0ff287ec449b9b66be (diff)
support multiple search bases, partially based on a patch by Leigh Wedding <lwedding@bigpond.com>
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@892 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/alias.c')
-rw-r--r--nslcd/alias.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/nslcd/alias.c b/nslcd/alias.c
index c59af95..ab44e57 100644
--- a/nslcd/alias.c
+++ b/nslcd/alias.c
@@ -5,7 +5,7 @@
Copyright (C) 1997-2005 Luke Howard
Copyright (C) 2006 West Consulting
- Copyright (C) 2006, 2007 Arthur de Jong
+ Copyright (C) 2006, 2007, 2009 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -44,7 +44,7 @@
*/
/* the search base for searches */
-const char *alias_base = NULL;
+const char *alias_bases[NSS_LDAP_CONFIG_MAX_BASES] = { NULL };
/* the search scope for searches */
int alias_scope = LDAP_SCOPE_DEFAULT;
@@ -77,9 +77,11 @@ static int mkfilter_alias_byname(const char *name,
static void alias_init(void)
{
- /* set up base */
- if (alias_base==NULL)
- alias_base=nslcd_cfg->ldc_base;
+ int i;
+ /* set up search bases */
+ if (alias_bases[0]==NULL)
+ for (i=0;i<NSS_LDAP_CONFIG_MAX_BASES;i++)
+ alias_bases[i]=nslcd_cfg->ldc_bases[i];
/* set up scope */
if (alias_scope==LDAP_SCOPE_DEFAULT)
alias_scope=nslcd_cfg->ldc_scope;