From: Todd C. Miller Date: Thu, 14 Jun 2012 15:35:02 +0000 (-0400) Subject: Don't use a map file for sudo_noexec.so since Solaris ld doesn't X-Git-Tag: SUDO_1_8_6^2~142 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47abbb90a22513487a353204b1e4195ab117863c;p=sudo Don't use a map file for sudo_noexec.so since Solaris ld doesn't allow '*' in the global section. The libtool export flag is now added to LT_LDFLAGS instead of commenting/uncommenting lines. --- diff --git a/MANIFEST b/MANIFEST index 79375dd78..9239af978 100644 --- a/MANIFEST +++ b/MANIFEST @@ -336,7 +336,6 @@ src/sudo.h src/sudo_edit.c src/sudo_exec.h src/sudo_noexec.c -src/sudo_noexec.map src/sudo_plugin_int.h src/sudo_usage.h.in src/tgetpass.c diff --git a/configure b/configure index d34a3ccd1..63e2739c2 100755 --- a/configure +++ b/configure @@ -695,7 +695,6 @@ iolog_dir COMPAT_TEST_PROGS SUDO_NLS LIBINTL -LTEXP LT_STATIC LIBDL CONFIGURE_ARGS @@ -740,7 +739,9 @@ SUDO_LIBS SUDO_OBJS SUDOERS_OBJS COMMON_OBJS -LTLDFLAGS +LT_LDEXPORTS +LT_LDMAP +LT_LDFLAGS SUDOERS_LDFLAGS LDFLAGS CPPFLAGS @@ -2882,6 +2883,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + # @@ -2937,7 +2939,6 @@ PROGS="sudo" : ${SUDOERS_GID='0'} DEVEL= LDAP="#" -LTEXP="" BAMAN=0 LCMAN=0 SEMAN=0 @@ -2950,6 +2951,7 @@ AUTH_EXCL= AUTH_EXCL_DEF= AUTH_DEF=passwd SUDO_NLS=disabled +LT_LDEXPORTS="-export-symbols \$(symfile)" CHECKSHADOW=true shadow_defs= @@ -14011,6 +14013,7 @@ $as_echo "$sudo_cv_var_daportable" >&6; } ;; *-dec-osf*) # ignore envariables wrt dynamic lib path + # XXX - sudo LDFLAGS instead? SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-no_library_replacement" : ${CHECKSIA='true'} @@ -14659,7 +14662,7 @@ fi $as_echo "$sudo_cv_var_gcc_static_libgcc" >&6; } CFLAGS="$_CFLAGS" if test "$sudo_cv_var_gcc_static_libgcc" = "yes"; then - LTLDFLAGS="$LTLDFLAGS -Wc,-static-libgcc" + LT_LDFLAGS="$LT_LDFLAGS -Wc,-static-libgcc" fi fi @@ -20113,14 +20116,14 @@ if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : $as_echo "#define HAVE_DSO_VISIBILITY 1" >>confdefs.h CFLAGS="${CFLAGS} -fvisibility=hidden" - LTEXP="#" + LT_LDEXPORTS= else : fi -if test -z "$LTEXP"; then +if test -n "$LT_LDEXPORTS"; then if test "$lt_cv_prog_gnu_ld" = "yes"; then cat > conftest.map <<-EOF VERS_1.0 { @@ -20145,7 +20148,7 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - LTEXP="#"; LTLDFLAGS="$LTLDFLAGS -Wl,--version-script,\$(mapfile)" + LT_LDEXPORTS=; LT_LDMAP="-Wl,--version-script,\$(mapfile)" fi rm -f core conftest.err conftest.$ac_objext \ @@ -20177,7 +20180,7 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - LTEXP="#"; LTLDFLAGS="$LTLDFLAGS -Wl,-M,\$(mapfile)" + LT_LDEXPORTS=; LT_LDMAP="-Wl,-M,\$(mapfile)" fi rm -f core conftest.err conftest.$ac_objext \ diff --git a/configure.in b/configure.in index 9d14111b9..a260e65d2 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,9 @@ AC_SUBST([PROGS]) AC_SUBST([CPPFLAGS]) AC_SUBST([LDFLAGS]) AC_SUBST([SUDOERS_LDFLAGS]) -AC_SUBST([LTLDFLAGS]) +AC_SUBST([LT_LDFLAGS]) +AC_SUBST([LT_LDMAP]) +AC_SUBST([LT_LDEXPORTS]) AC_SUBST([COMMON_OBJS]) AC_SUBST([SUDOERS_OBJS]) AC_SUBST([SUDO_OBJS]) @@ -66,7 +68,6 @@ AC_SUBST([ac_config_libobj_dir]) AC_SUBST([CONFIGURE_ARGS]) AC_SUBST([LIBDL]) AC_SUBST([LT_STATIC]) -AC_SUBST([LTEXP]) AC_SUBST([LIBINTL]) AC_SUBST([SUDO_NLS]) AC_SUBST([COMPAT_TEST_PROGS]) @@ -165,7 +166,6 @@ PROGS="sudo" : ${SUDOERS_GID='0'} DEVEL= LDAP="#" -LTEXP="" BAMAN=0 LCMAN=0 SEMAN=0 @@ -178,6 +178,7 @@ AUTH_EXCL= AUTH_EXCL_DEF= AUTH_DEF=passwd SUDO_NLS=disabled +LT_LDEXPORTS="-export-symbols \$(symfile)" dnl dnl Other vaiables @@ -1653,6 +1654,7 @@ case "$host" in ;; *-dec-osf*) # ignore envariables wrt dynamic lib path + # XXX - sudo LDFLAGS instead? SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-no_library_replacement" : ${CHECKSIA='true'} @@ -1987,7 +1989,7 @@ if test X"$with_gnu_ld" != "yes" -a -n "$GCC"; then ) CFLAGS="$_CFLAGS" if test "$sudo_cv_var_gcc_static_libgcc" = "yes"; then - LTLDFLAGS="$LTLDFLAGS -Wc,-static-libgcc" + LT_LDFLAGS="$LT_LDFLAGS -Wc,-static-libgcc" fi fi @@ -3175,14 +3177,14 @@ AC_LANG_WERROR AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [ AC_DEFINE(HAVE_DSO_VISIBILITY) CFLAGS="${CFLAGS} -fvisibility=hidden" - LTEXP="#" + LT_LDEXPORTS= ]) dnl dnl If the compiler doesn't have symbol visibility support, it may dnl support version scripts (only GNU and Solaris ld). dnl -if test -z "$LTEXP"; then +if test -n "$LT_LDEXPORTS"; then if test "$lt_cv_prog_gnu_ld" = "yes"; then cat > conftest.map <<-EOF VERS_1.0 { @@ -3194,7 +3196,7 @@ if test -z "$LTEXP"; then _LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" AC_TRY_LINK([int foo;], [], [ - LTEXP="#"; LTLDFLAGS="$LTLDFLAGS -Wl,--version-script,\$(mapfile)" + LT_LDEXPORTS=; LT_LDMAP="-Wl,--version-script,\$(mapfile)" ]) LDFLAGS="$_LDFLAGS" else @@ -3210,7 +3212,7 @@ if test -z "$LTEXP"; then _LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" AC_TRY_LINK([int foo;], [], [ - LTEXP="#"; LTLDFLAGS="$LTLDFLAGS -Wl,-M,\$(mapfile)" + LT_LDEXPORTS=; LT_LDMAP="-Wl,-M,\$(mapfile)" ]) LDFLAGS="$_LDFLAGS" ;; diff --git a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in index 78ed8f066..b731a3c8d 100644 --- a/plugins/sample/Makefile.in +++ b/plugins/sample/Makefile.in @@ -43,8 +43,7 @@ CFLAGS = @CFLAGS@ # Flags to pass to the link stage LDFLAGS = @LDFLAGS@ -LTLDFLAGS = @LTLDFLAGS@ -@LTEXP@LTEXPORTS = -export-symbols $(srcdir)/sample_plugin.sym +LT_LDFLAGS = @LT_LDFLAGS@ @LT_LDMAP@ @LT_LDEXPORTS@ # Where to install things... prefix = @prefix@ @@ -61,6 +60,7 @@ plugindir = @PLUGINDIR@ soext = @SOEXT@ shlib_mode = @SHLIB_MODE@ mapfile = $(srcdir)/sample_plugin.map +symfile = $(srcdir)/sample_plugin.sym # OS dependent defines DEFS = @OSDEFS@ @@ -86,7 +86,7 @@ Makefile: $(srcdir)/Makefile.in $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $< sample_plugin.la: $(OBJS) - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ $(OBJS) $(LIBS) -module $(LTEXPORTS) -avoid-version -rpath $(plugindir) + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir) pre-install: diff --git a/plugins/sample_group/Makefile.in b/plugins/sample_group/Makefile.in index 805e2ba71..523b972bd 100644 --- a/plugins/sample_group/Makefile.in +++ b/plugins/sample_group/Makefile.in @@ -44,8 +44,7 @@ CFLAGS = @CFLAGS@ # Flags to pass to the link stage LDFLAGS = @LDFLAGS@ -LTLDFLAGS = @LTLDFLAGS@ -@LTEXP@LTEXPORTS = -export-symbols $(srcdir)/sample_group.sym +LT_LDFLAGS = @LT_LDFLAGS@ @LT_LDMAP@ @LT_LDEXPORTS@ # Where to install things... prefix = @prefix@ @@ -62,6 +61,7 @@ plugindir = @PLUGINDIR@ soext = @SOEXT@ shlib_mode = @SHLIB_MODE@ mapfile = $(srcdir)/sample_group.map +symfile = $(srcdir)/sample_group.sym # OS dependent defines DEFS = @OSDEFS@ @@ -87,7 +87,7 @@ Makefile: $(srcdir)/Makefile.in $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $< sample_group.la: $(OBJS) $(LT_LIBS) - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ $(OBJS) $(LIBS) -module $(LTEXPORTS) -avoid-version -rpath $(plugindir) + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir) pre-install: diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 6bca91bbf..fe3750a61 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -58,9 +58,7 @@ CFLAGS = @CFLAGS@ # Flags to pass to the link stage LDFLAGS = @LDFLAGS@ -SUDOERS_LDFLAGS = $(LDFLAGS) @SUDOERS_LDFLAGS@ -LTLDFLAGS = @LTLDFLAGS@ -@LTEXP@LTEXPORTS = -export-symbols $(srcdir)/sudoers.sym +LT_LDFLAGS = @SUDOERS_LDFLAGS@ @LT_LDFLAGS@ @LT_LDMAP@ @LT_LDEXPORTS@ # Where to install things... prefix = @prefix@ @@ -77,6 +75,7 @@ localstatedir = @localstatedir@ soext = @SOEXT@ shlib_mode = @SHLIB_MODE@ mapfile = $(srcdir)/sudoers.map +symfile = $(srcdir)/sudoers.sym # Directory in which to install the sudoers plugin plugindir = @PLUGINDIR@ @@ -169,7 +168,7 @@ libparsesudoers.la: $(LIBPARSESUDOERS_OBJS) $(LIBTOOL) --mode=link $(CC) -o $@ $(LIBPARSESUDOERS_OBJS) -no-install sudoers.la: $(SUDOERS_OBJS) $(LT_LIBS) libparsesudoers.la - $(LIBTOOL) @LT_STATIC@ --mode=link $(CC) $(SUDOERS_LDFLAGS) $(LTLDFLAGS) -o $@ $(SUDOERS_OBJS) libparsesudoers.la $(SUDOERS_LIBS) -module $(LTEXPORTS) -avoid-version -rpath $(plugindir) + $(LIBTOOL) @LT_STATIC@ --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(SUDOERS_OBJS) libparsesudoers.la $(SUDOERS_LIBS) -module -avoid-version -rpath $(plugindir) visudo: libparsesudoers.la $(VISUDO_OBJS) $(LT_LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ $(VISUDO_OBJS) $(LDFLAGS) libparsesudoers.la $(LIBS) $(NET_LIBS) diff --git a/plugins/system_group/Makefile.in b/plugins/system_group/Makefile.in index 6665085b4..96b158ef7 100644 --- a/plugins/system_group/Makefile.in +++ b/plugins/system_group/Makefile.in @@ -44,8 +44,7 @@ CFLAGS = @CFLAGS@ # Flags to pass to the link stage LDFLAGS = @LDFLAGS@ -LTLDFLAGS = @LTLDFLAGS@ -@LTEXP@LTEXPORTS = -export-symbols $(srcdir)/system_group.sym +LT_LDFLAGS = @LT_LDFLAGS@ @LT_LDMAP@ @LT_LDEXPORTS@ # Where to install things... prefix = @prefix@ @@ -62,6 +61,7 @@ plugindir = @PLUGINDIR@ soext = @SOEXT@ shlib_mode = @SHLIB_MODE@ mapfile = $(srcdir)/system_group.map +symfile = $(srcdir)/system_group.sym # OS dependent defines DEFS = @OSDEFS@ @@ -87,7 +87,7 @@ Makefile: $(srcdir)/Makefile.in $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $< system_group.la: $(OBJS) $(LT_LIBS) - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ $(OBJS) $(LIBS) -module $(LTEXPORTS) -avoid-version -rpath $(plugindir) + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir) pre-install: diff --git a/src/Makefile.in b/src/Makefile.in index 692be29ad..04085f8a8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -44,7 +44,7 @@ CFLAGS = @CFLAGS@ # Flags to pass to the link stage LDFLAGS = @LDFLAGS@ -LTLDFLAGS = @LTLDFLAGS@ +LT_LDFLAGS = @LT_LDFLAGS@ # Where to install things... prefix = @prefix@ @@ -100,7 +100,7 @@ sudo: $(OBJS) $(LT_LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) libsudo_noexec.la: sudo_noexec.lo - $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LTLDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir) + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ sudo_noexec.lo -avoid-version -rpath $(noexecdir) sesh: sesh.o error.o exec_common.o @LIBINTL@ $(LT_LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ sesh.o error.o exec_common.o $(LDFLAGS) @LIBINTL@ $(LIBS) diff --git a/src/sudo_noexec.map b/src/sudo_noexec.map deleted file mode 100644 index c493655c3..000000000 --- a/src/sudo_noexec.map +++ /dev/null @@ -1,5 +0,0 @@ -sudo_noexec.so { - global: - # All symbols are exported - *; -};