]> granicus.if.org Git - sudo/commitdiff
Allow --with-ldap-conf-file option to override LDAP_CONF
authorAaron Spangler <aaron777@gmail.com>
Fri, 27 Aug 2004 03:44:35 +0000 (03:44 +0000)
committerAaron Spangler <aaron777@gmail.com>
Fri, 27 Aug 2004 03:44:35 +0000 (03:44 +0000)
configure.in
ldap.c
pathnames.h.in

index 3a2e524c999240ce7c8d0c95d21f5f199982a12f..97ff024d56fadd083c7d672a32946ae1f0710e50 100644 (file)
@@ -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 bd734f8bee4c875bb039c9971b36237641c5332b..f966be3ee653951824c99402964401fcdd4cb2da 100644 (file)
--- 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;
index 48b23210238e42d98307edb93bf48e306b875b82..5b2fe833fc36054c0deb8832f2a72f5c4278171d 100644 (file)
 #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 */