From 0420232b7989c99ad7992f0f10a47f3f48a28fc7 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 21 Mar 2015 18:54:32 +0100 Subject: Various small fixes when using --with-module-name This updates the test framework to support --with-module-name, ensures that exports.map is rebuilt when configure is re-ran, fixes parsing of nsswitch.conf (to determine what to return for passwd lookups) and fixes the check for _nss_ldap_version. --- nslcd/nslcd.c | 2 +- nslcd/nsswitch.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'nslcd') diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index 36b151d..f765b9c 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -612,7 +612,7 @@ static void disable_nss_ldap(void) /* clear any existing errors */ dlerror(); /* lookup the NSS version if possible */ - version_info = (char **)dlsym(handle, "_nss_ldap_version"); + version_info = (char **)dlsym(handle, "_nss_" MODULE_NAME "_version"); error = dlerror(); if ((version_info != NULL) && (error == NULL)) log_log(LOG_DEBUG, "NSS_LDAP %s %s", version_info[0], version_info[1]); diff --git a/nslcd/nsswitch.c b/nslcd/nsswitch.c index ff9d9d5..babf40e 100644 --- a/nslcd/nsswitch.c +++ b/nslcd/nsswitch.c @@ -1,7 +1,7 @@ /* nsswitch.c - functions for parsing /etc/nsswitch.conf - Copyright (C) 2011, 2012 Arthur de Jong + Copyright (C) 2011-2015 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 @@ -151,7 +151,7 @@ static int shadow_uses_ldap(void) if (services != NULL) { shadow_found = 1; - if (has_service(services, "ldap", NSSWITCH_FILE, lnr)) + if (has_service(services, MODULE_NAME, NSSWITCH_FILE, lnr)) { fclose(fp); return 1; @@ -160,7 +160,7 @@ static int shadow_uses_ldap(void) /* see if we have a passwd line */ services = find_db(linebuf, "passwd"); if (services != NULL) - passwd_has_ldap = has_service(services, "ldap", NSSWITCH_FILE, lnr); + passwd_has_ldap = has_service(services, MODULE_NAME, NSSWITCH_FILE, lnr); } fclose(fp); if (shadow_found) -- cgit v1.2.3