From 2ceb87bc56ad3b3aae1189b13a8cf34b5f61bf1a Mon Sep 17 00:00:00 2001 From: Aaron Spangler Date: Fri, 27 Aug 2004 03:44:35 +0000 Subject: [PATCH] Allow --with-ldap-conf-file option to override LDAP_CONF --- configure.in | 2 ++ ldap.c | 6 +----- pathnames.h.in | 4 ++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 3a2e524c9..97ff024d5 100644 --- a/configure.in +++ b/configure.in @@ -915,6 +915,8 @@ AC_ARG_WITH(ldap, [ --with-ldap[[=DIR]] enable LDAP support], AC_MSG_RESULT(yes) ;; esac]) +AC_ARG_WITH(ldap-conf-file, [ --with-ldap-conf-file path to LDAP configuration file], +[AC_DEFINE_UNQUOTED(_PATH_LDAP_CONF, "$with_ldap_conf_file")]) AC_ARG_WITH(pc-insults, [ --with-pc-insults replace politically incorrect insults with less offensive ones], [case $with_pc_insults in diff --git a/ldap.c b/ldap.c index bd734f8be..f966be3ee 100644 --- a/ldap.c +++ b/ldap.c @@ -62,10 +62,6 @@ static const char rcsid[] = "$Sudo$"; /* LDAP code below */ -#ifndef LDAP_CONFIG -#define LDAP_CONFIG "/etc/ldap.conf" -#endif - #ifndef BUF_SIZ #define BUF_SIZ 1024 #endif @@ -474,7 +470,7 @@ sudo_ldap_read_config() char *keyword; char *value; - f=fopen(LDAP_CONFIG,"r"); + f=fopen(_PATH_LDAP_CONF,"r"); if (!f) return 0; while (f && fgets(buf,sizeof(buf)-1,f)){ c=buf; diff --git a/pathnames.h.in b/pathnames.h.in index 48b232102..5b2fe833f 100644 --- a/pathnames.h.in +++ b/pathnames.h.in @@ -108,3 +108,7 @@ #ifndef _PATH_USRTMP #define _PATH_USRTMP "/usr/tmp/" #endif /* _PATH_USRTMP */ + +#ifndef _PATH_LDAP_CONF +#define _PATH_LDAP_CONF "/etc/ldap.conf" +#endif /* _PATH_LDAP_CONF */ -- 2.50.1