Allow --with-ldap-conf-file option to override LDAP_CONF
This commit is contained in:
@@ -915,6 +915,8 @@ AC_ARG_WITH(ldap, [ --with-ldap[[=DIR]] enable LDAP support],
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
;;
|
;;
|
||||||
esac])
|
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],
|
AC_ARG_WITH(pc-insults, [ --with-pc-insults replace politically incorrect insults with less offensive ones],
|
||||||
[case $with_pc_insults in
|
[case $with_pc_insults in
|
||||||
|
6
ldap.c
6
ldap.c
@@ -62,10 +62,6 @@ static const char rcsid[] = "$Sudo$";
|
|||||||
|
|
||||||
/* LDAP code below */
|
/* LDAP code below */
|
||||||
|
|
||||||
#ifndef LDAP_CONFIG
|
|
||||||
#define LDAP_CONFIG "/etc/ldap.conf"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BUF_SIZ
|
#ifndef BUF_SIZ
|
||||||
#define BUF_SIZ 1024
|
#define BUF_SIZ 1024
|
||||||
#endif
|
#endif
|
||||||
@@ -474,7 +470,7 @@ sudo_ldap_read_config()
|
|||||||
char *keyword;
|
char *keyword;
|
||||||
char *value;
|
char *value;
|
||||||
|
|
||||||
f=fopen(LDAP_CONFIG,"r");
|
f=fopen(_PATH_LDAP_CONF,"r");
|
||||||
if (!f) return 0;
|
if (!f) return 0;
|
||||||
while (f && fgets(buf,sizeof(buf)-1,f)){
|
while (f && fgets(buf,sizeof(buf)-1,f)){
|
||||||
c=buf;
|
c=buf;
|
||||||
|
@@ -108,3 +108,7 @@
|
|||||||
#ifndef _PATH_USRTMP
|
#ifndef _PATH_USRTMP
|
||||||
#define _PATH_USRTMP "/usr/tmp/"
|
#define _PATH_USRTMP "/usr/tmp/"
|
||||||
#endif /* _PATH_USRTMP */
|
#endif /* _PATH_USRTMP */
|
||||||
|
|
||||||
|
#ifndef _PATH_LDAP_CONF
|
||||||
|
#define _PATH_LDAP_CONF "/etc/ldap.conf"
|
||||||
|
#endif /* _PATH_LDAP_CONF */
|
||||||
|
Reference in New Issue
Block a user