From 614d918d0f6704394f40d277b6d0f91b9515ed45 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 12 Dec 2003 17:22:06 +0000 Subject: Don't compile ldap.c (even as a stub) unless --with-ldap is specified. --- Makefile.in | 3 +-- configure | 14 +++++++------- configure.in | 18 +++++++++--------- ldap.c | 8 +------- 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 #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 @@ -2028,6 +2029,14 @@ if test "$with_authenticate" = "yes"; then SUDO_LIBS="${SUDO_LIBS} -ls" 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. @@ -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 #include #include +#include #include "sudo.h" #include "parse.h" @@ -76,10 +77,6 @@ static const char rcsid[] = "$Sudo$"; /* LDAP code below */ - -#ifdef HAVE_LDAP -#include - #ifndef LDAP_CONFIG #define LDAP_CONFIG "/etc/ldap.conf" #endif @@ -727,6 +724,3 @@ int pwflag; * * */ - -#endif /* HAVE_LDAP */ - -- cgit v1.2.1