From 6bdd24fe2857258515496a6eedd7ee8650144582 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 24 May 2009 08:56:33 +0000 Subject: support multiple search bases, partially based on a patch by Leigh Wedding git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@892 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd/service.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'nslcd/service.c') diff --git a/nslcd/service.c b/nslcd/service.c index 845ff50..3403179 100644 --- a/nslcd/service.c +++ b/nslcd/service.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 @@ -46,7 +46,7 @@ */ /* the search base for searches */ -const char *service_base = NULL; +const char *service_bases[NSS_LDAP_CONFIG_MAX_BASES] = { NULL }; /* the search scope for searches */ int service_scope = LDAP_SCOPE_DEFAULT; @@ -112,9 +112,11 @@ static int mkfilter_service_bynumber(int number, static void service_init(void) { - /* set up base */ - if (service_base==NULL) - service_base=nslcd_cfg->ldc_base; + int i; + /* set up search bases */ + if (service_bases[0]==NULL) + for (i=0;ildc_bases[i]; /* set up scope */ if (service_scope==LDAP_SCOPE_DEFAULT) service_scope=nslcd_cfg->ldc_scope; -- cgit v1.2.3