summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>2003-12-12 17:22:06 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>2003-12-12 17:22:06 +0000
commit614d918d0f6704394f40d277b6d0f91b9515ed45 (patch)
tree52e7ec221bd7c42e7db133879899954566b5c3b0
parent46bbd8e7e2008380069cf21d345ba38c35df1222 (diff)
downloadsudo-614d918d0f6704394f40d277b6d0f91b9515ed45.tar.gz
Don't compile ldap.c (even as a stub) unless --with-ldap is specified.
-rw-r--r--Makefile.in3
-rwxr-xr-xconfigure14
-rw-r--r--configure.in18
-rw-r--r--ldap.c8
4 files changed, 18 insertions, 25 deletions
diff --git a/Makefile.in b/Makefile.in
index ad7a73747..ba3ba0e66 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -136,8 +136,7 @@ PARSEOBJS = sudo.tab.o lex.yy.o alloc.o defaults.o
SUDOBJS = check.o env.o getspwuid.o goodpath.o fileops.o find_path.o \
interfaces.o logging.o parse.o set_perms.o sudo.o tgetpass.o \
- ldap.o \
- $(AUTH_OBJS) $(PARSEOBJS)
+ @SUDO_OBJS@ $(AUTH_OBJS) $(PARSEOBJS)
VISUDOBJS = visudo.o fileops.o goodpath.o find_path.o $(PARSEOBJS)
diff --git a/configure b/configure
index 40bb6e252..6a5255e0a 100755
--- a/configure
+++ b/configure
@@ -307,7 +307,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CFLAGS PROGS CPPFLAGS LDFLAGS SUDO_LDFLAGS SUDO_LIBS NET_LIBS AFS_LIBS OSDEFS AUTH_OBJS MANTYPE MAN_POSTINSTALL SUDOERS_MODE SUDOERS_UID SUDOERS_GID DEV mansectsu mansectform mansrcdir timedir timeout password_timeout sudo_umask passprompt long_otp_prompt lecture logfac goodpri badpri loglen ignore_dot mail_no_user mail_no_host mail_no_perms mailto mailsub badpass_message fqdn runas_default env_editor passwd_tries tty_tickets insults EGREPPROG CC ac_ct_CC EXEEXT OBJEXT CPP UNAMEPROG TRPROG SEDPROG NROFFPROG build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP YACC LIBOBJS ALLOCA KRB5CONFIG LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CFLAGS PROGS CPPFLAGS LDFLAGS SUDO_LDFLAGS SUDO_OBJS SUDO_LIBS NET_LIBS AFS_LIBS OSDEFS AUTH_OBJS MANTYPE MAN_POSTINSTALL SUDOERS_MODE SUDOERS_UID SUDOERS_GID DEV mansectsu mansectform mansrcdir timedir timeout password_timeout sudo_umask passprompt long_otp_prompt lecture logfac goodpri badpri loglen ignore_dot mail_no_user mail_no_host mail_no_perms mailto mailsub badpass_message fqdn runas_default env_editor passwd_tries tty_tickets insults EGREPPROG CC ac_ct_CC EXEEXT OBJEXT CPP UNAMEPROG TRPROG SEDPROG NROFFPROG build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP YACC LIBOBJS ALLOCA KRB5CONFIG LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -14262,6 +14262,11 @@ if test "$with_authenticate" = "yes"; then
SUDO_LIBS="${SUDO_LIBS} -ls"
fi
+if test "$with_ldap" = "yes"; then
+ SUDO_LIBS="${SUDO_LIBS} -lldap"
+ SUDO_OBJS="${SUDO_OBJS} ldap.o"
+fi
+
if test -n "$blibpath"; then
if test -n "$blibpath_add"; then
SUDO_LDFLAGS="$SUDO_LDFLAGS -Wl,-blibpath:${blibpath}${blibpath_add}"
@@ -14985,6 +14990,7 @@ s,@PROGS@,$PROGS,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@LDFLAGS@,$LDFLAGS,;t t
s,@SUDO_LDFLAGS@,$SUDO_LDFLAGS,;t t
+s,@SUDO_OBJS@,$SUDO_OBJS,;t t
s,@SUDO_LIBS@,$SUDO_LIBS,;t t
s,@NET_LIBS@,$NET_LIBS,;t t
s,@AFS_LIBS@,$AFS_LIBS,;t t
@@ -15523,9 +15529,3 @@ fi
-
-/* LDAP support */
-if test "$with_ldap" = "yes"; then
- SUDO_LIBS="${SUDO_LIBS} -lldap"
-fi
-
diff --git a/configure.in b/configure.in
index 9411aa3b2..7a069ceca 100644
--- a/configure.in
+++ b/configure.in
@@ -18,6 +18,7 @@ AC_SUBST(PROGS)dnl
AC_SUBST(CPPFLAGS)dnl
AC_SUBST(LDFLAGS)dnl
AC_SUBST(SUDO_LDFLAGS)dnl
+AC_SUBST(SUDO_OBJS)dnl
AC_SUBST(LIBS)dnl
AC_SUBST(SUDO_LIBS)dnl
AC_SUBST(NET_LIBS)dnl
@@ -2029,6 +2030,14 @@ if test "$with_authenticate" = "yes"; then
fi
dnl
+dnl extra lib and .o file for LDAP support
+dnl
+if test "$with_ldap" = "yes"; then
+ SUDO_LIBS="${SUDO_LIBS} -lldap"
+ SUDO_OBJS="${SUDO_OBJS} ldap.o"
+fi
+
+dnl
dnl Add $blibpath to SUDO_LDFLAGS if specified by the user or if we
dnl added -L dirpaths to SUDO_LDFLAGS.
dnl
@@ -2168,12 +2177,3 @@ AH_BOTTOM([/*
#endif /* __svr4__ */
#endif /* _SUDO_CONFIG_H */])
-
-/* LDAP support */
-dnl
-dnl LDAP libs
-dnl
-if test "$with_ldap" = "yes"; then
- SUDO_LIBS="${SUDO_LIBS} -lldap"
-fi
-
diff --git a/ldap.c b/ldap.c
index f16a06c40..67a0c269e 100644
--- a/ldap.c
+++ b/ldap.c
@@ -66,6 +66,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <errno.h>
+#include <ldap.h>
#include "sudo.h"
#include "parse.h"
@@ -76,10 +77,6 @@ static const char rcsid[] = "$Sudo$";
/* LDAP code below */
-
-#ifdef HAVE_LDAP
-#include <ldap.h>
-
#ifndef LDAP_CONFIG
#define LDAP_CONFIG "/etc/ldap.conf"
#endif
@@ -727,6 +724,3 @@ int pwflag;
*
*
*/
-
-#endif /* HAVE_LDAP */
-