From: Todd C. Miller Date: Mon, 11 Jun 2012 14:45:34 +0000 (-0400) Subject: Install shared objects with mode 0644 except on HP-UX which needs X-Git-Tag: SUDO_1_8_6^2~148 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8e0687ca9c9d488e323ede22523488a61a49435;p=sudo Install shared objects with mode 0644 except on HP-UX which needs the executable bit set. --- diff --git a/Makefile.in b/Makefile.in index 549f6acef..e6fc8d077 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,6 +44,7 @@ sudoersdir = $(sysconfdir) sudoers_uid = @SUDOERS_UID@ sudoers_gid = @SUDOERS_GID@ sudoers_mode = @SUDOERS_MODE@ +shlib_mode = @SHLIB_MODE@ SUBDIRS = compat common @ZLIB_SRC@ plugins/sudoers src include doc @@ -276,6 +277,7 @@ package: sudo.pp sudoers_uid=$(sudoers_uid) \ sudoers_gid=$(sudoers_gid) \ sudoers_mode=$(sudoers_mode) \ + shlib_mode=$(shlib_mode) \ version=$(VERSION) $(PPVARS) clean: config.status diff --git a/configure b/configure index f3cfc94f9..ccc7bec3d 100755 --- a/configure +++ b/configure @@ -724,6 +724,7 @@ DEVEL SUDOERS_GID SUDOERS_UID SUDOERS_MODE +SHLIB_MODE MANCOMPRESSEXT MANCOMPRESS MANTYPE @@ -2878,6 +2879,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;} + # @@ -2927,6 +2929,7 @@ devdir='$(srcdir)' PROGS="sudo" : ${MANTYPE='man'} : ${mansrcdir='.'} +: ${SHLIB_MODE='0644'} : ${SUDOERS_MODE='0440'} : ${SUDOERS_UID='0'} : ${SUDOERS_GID='0'} @@ -13890,6 +13893,9 @@ done *-*-hiuxmpp*) : ${mansectsu='1m'} : ${mansectform='4'} + + # HP-UX shared libs must be executable + SHLIB_MODE=0755 ;; *-*-hpux*) # AFS support needs -lBSD @@ -13899,6 +13905,9 @@ done : ${mansectsu='1m'} : ${mansectform='4'} + # HP-UX shared libs must be executable + SHLIB_MODE=0755 + # The HP bundled compiler cannot generate shared libs if test -z "$GCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP bundled C compiler" >&5 diff --git a/configure.in b/configure.in index 527770071..5b3875237 100644 --- a/configure.in +++ b/configure.in @@ -36,6 +36,7 @@ AC_SUBST([AUTH_OBJS]) AC_SUBST([MANTYPE]) AC_SUBST([MANCOMPRESS]) AC_SUBST([MANCOMPRESSEXT]) +AC_SUBST([SHLIB_MODE]) AC_SUBST([SUDOERS_MODE]) AC_SUBST([SUDOERS_UID]) AC_SUBST([SUDOERS_GID]) @@ -157,6 +158,7 @@ devdir='$(srcdir)' PROGS="sudo" : ${MANTYPE='man'} : ${mansrcdir='.'} +: ${SHLIB_MODE='0644'} : ${SUDOERS_MODE='0440'} : ${SUDOERS_UID='0'} : ${SUDOERS_GID='0'} @@ -1562,6 +1564,9 @@ case "$host" in *-*-hiuxmpp*) : ${mansectsu='1m'} : ${mansectform='4'} + + # HP-UX shared libs must be executable + SHLIB_MODE=0755 ;; *-*-hpux*) # AFS support needs -lBSD @@ -1571,6 +1576,9 @@ case "$host" in : ${mansectsu='1m'} : ${mansectform='4'} + # HP-UX shared libs must be executable + SHLIB_MODE=0755 + # The HP bundled compiler cannot generate shared libs if test -z "$GCC"; then AC_CACHE_CHECK([for HP bundled C compiler], diff --git a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in index 1e7147c0d..4f083a6d5 100644 --- a/plugins/sample/Makefile.in +++ b/plugins/sample/Makefile.in @@ -55,7 +55,10 @@ libexecdir = @libexecdir@ datarootdir = @datarootdir@ localstatedir = @localstatedir@ plugindir = @PLUGINDIR@ + +# File extension and mode to use for shared libraries/objects soext = @SOEXT@ +shlib_mode = @SHLIB_MODE@ # OS dependent defines DEFS = @OSDEFS@ @@ -97,7 +100,7 @@ install-includes: install-doc: install-plugin: install-dirs sample_plugin.la - $(INSTALL) -b~ -m 0755 .libs/sample_plugin$(soext) $(DESTDIR)$(plugindir) + $(INSTALL) -b~ -m $(shlib_mode) .libs/sample_plugin$(soext) $(DESTDIR)$(plugindir) uninstall: -rm -f $(DESTDIR)$(plugindir)/sample_plugin$(soext) diff --git a/plugins/sample_group/Makefile.in b/plugins/sample_group/Makefile.in index 46b2001fc..a2d9087e8 100644 --- a/plugins/sample_group/Makefile.in +++ b/plugins/sample_group/Makefile.in @@ -56,7 +56,10 @@ libexecdir = @libexecdir@ datarootdir = @datarootdir@ localstatedir = @localstatedir@ plugindir = @PLUGINDIR@ + +# File extension and mode to use for shared libraries/objects soext = @SOEXT@ +shlib_mode = @SHLIB_MODE@ # OS dependent defines DEFS = @OSDEFS@ @@ -98,7 +101,7 @@ install-includes: install-doc: install-plugin: install-dirs sample_group.la - $(INSTALL) -b~ -m 0755 .libs/sample_group$(soext) $(DESTDIR)$(plugindir) + $(INSTALL) -b~ -m $(shlib_mode) .libs/sample_group$(soext) $(DESTDIR)$(plugindir) uninstall: -rm -f $(DESTDIR)$(plugindir)/sample_group$(soext) diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index c44f72c35..3ec7e4e11 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -72,8 +72,9 @@ datarootdir = @datarootdir@ localedir = @localedir@ localstatedir = @localstatedir@ -# File extension for shared objects +# File extension and mode to use for shared libraries/objects soext = @SOEXT@ +shlib_mode = @SHLIB_MODE@ # Directory in which to install the sudoers plugin plugindir = @PLUGINDIR@ @@ -262,7 +263,7 @@ install-doc: install-dirs install-plugin: sudoers.la install-dirs if [ X"$(soext)" != X"" ]; then \ - $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -m 0755 .libs/sudoers$(soext) $(DESTDIR)$(plugindir); \ + $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -m $(shlib_mode) .libs/sudoers$(soext) $(DESTDIR)$(plugindir); \ fi install-sudoers: install-dirs diff --git a/plugins/system_group/Makefile.in b/plugins/system_group/Makefile.in index 0146c20c6..4834c65c2 100644 --- a/plugins/system_group/Makefile.in +++ b/plugins/system_group/Makefile.in @@ -56,7 +56,10 @@ libexecdir = @libexecdir@ datarootdir = @datarootdir@ localstatedir = @localstatedir@ plugindir = @PLUGINDIR@ + +# File extension and mode to use for shared libraries/objects soext = @SOEXT@ +shlib_mode = @SHLIB_MODE@ # OS dependent defines DEFS = @OSDEFS@ @@ -98,7 +101,7 @@ install-includes: install-doc: install-plugin: install-dirs system_group.la - $(INSTALL) -b~ -m 0755 .libs/system_group$(soext) $(DESTDIR)$(plugindir) + $(INSTALL) -b~ -m $(shlib_mode) .libs/system_group$(soext) $(DESTDIR)$(plugindir) uninstall: -rm -f $(DESTDIR)$(plugindir)/system_group$(soext) diff --git a/src/Makefile.in b/src/Makefile.in index f36e5bd9f..692be29ad 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -63,6 +63,9 @@ noexecdir = @NOEXECDIR@ install_uid = 0 install_gid = 0 +# File mode to use for shared libraries/objects +shlib_mode = @SHLIB_MODE@ + # OS dependent defines DEFS = @OSDEFS@ -DLOCALEDIR=\"$(localedir)\" @@ -123,7 +126,7 @@ install-includes: # We install sudo_noexec by hand so we can avoid a "lib" prefix # and a version number. Since we use LD_PRELOAD, neither is needed. install-noexec: install-dirs libsudo_noexec.la - if [ -f .libs/lib$(noexecfile) ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -m 0755 .libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(noexecfile); fi + if [ -f .libs/lib$(noexecfile) ]; then $(INSTALL) -b~ -O $(install_uid) -G $(install_gid) -m $(shlib_mode) .libs/lib$(noexecfile) $(DESTDIR)$(noexecdir)/$(noexecfile); fi install-plugin: diff --git a/sudo.pp b/sudo.pp index 183ce6e62..011b6d6ac 100644 --- a/sudo.pp +++ b/sudo.pp @@ -13,7 +13,6 @@ The basic philosophy is to give as few privileges as possible but \ still allow people to get their work done." vendor="Todd C. Miller" copyright="(c) 1993-1996,1998-2012 Todd C. Miller" - shmode=0644 sudoedit_man=`echo ${pp_destdir}$mandir/*/sudoedit.*|sed "s:^${pp_destdir}::"` sudoedit_man_target=`basename $sudoedit_man | sed 's/edit//'` @@ -33,8 +32,6 @@ still allow people to get their work done." %if [sd] pp_sd_vendor_tag="TCM" - # HP-UX shared objects must be executable - shmode=0755 %endif %if [solaris] @@ -252,7 +249,7 @@ still allow people to get their work done." $sbindir/visudo 0755 $bindir/sudoreplay 0755 $includedir/sudo_plugin.h 0644 - $libexecdir/* $shmode optional + $libexecdir/* $shlib_mode optional $sudoersdir/sudoers.d/ 0750 $sudoers_uid:$sudoers_gid $timedir/ 0700 root: $docdir/ 0755