2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 22:35:10 +00:00

Only keep backups of installed files on HP-UX where you cannot

unlink a shared library that is in use.
This commit is contained in:
Todd C. Miller
2016-07-08 12:37:41 -06:00
parent 19c80f8aee
commit 144e3bb53f
9 changed files with 35 additions and 11 deletions

9
configure vendored
View File

@@ -750,6 +750,7 @@ SELINUX_USAGE
BSDAUTH_USAGE BSDAUTH_USAGE
DONT_LEAK_PATH_INFO DONT_LEAK_PATH_INFO
INSTALL_NOEXEC INSTALL_NOEXEC
INSTALL_BACKUP
sesh_file sesh_file
noexec_file noexec_file
NOEXECDIR NOEXECDIR
@@ -2847,6 +2848,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;}
# #
@@ -2896,6 +2898,7 @@ PLUGINDIR=/usr/local/libexec/sudo
# #
# End initial values for man page substitution # End initial values for man page substitution
# #
INSTALL_BACKUP=
INSTALL_NOEXEC= INSTALL_NOEXEC=
exampledir='$(docdir)/examples' exampledir='$(docdir)/examples'
devdir='$(srcdir)' devdir='$(srcdir)'
@@ -14908,6 +14911,9 @@ _ACEOF
# Load time is much greater if writable so use 0555. # Load time is much greater if writable so use 0555.
SHLIB_MODE=0555 SHLIB_MODE=0555
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
for ac_func in pstat_getproc for ac_func in pstat_getproc
do : do :
ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc" ac_fn_c_check_func "$LINENO" "pstat_getproc" "ac_cv_func_pstat_getproc"
@@ -14940,6 +14946,9 @@ done
# Load time is much greater if writable so use 0555. # Load time is much greater if writable so use 0555.
SHLIB_MODE=0555 SHLIB_MODE=0555
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
# The HP bundled compiler cannot generate shared libs # The HP bundled compiler cannot generate shared libs
if test -z "$GCC"; then if test -z "$GCC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP bundled C compiler" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP bundled C compiler" >&5

View File

@@ -63,6 +63,7 @@ AC_SUBST([NOEXECFILE])
AC_SUBST([NOEXECDIR]) AC_SUBST([NOEXECDIR])
AC_SUBST([noexec_file]) AC_SUBST([noexec_file])
AC_SUBST([sesh_file]) AC_SUBST([sesh_file])
AC_SUBST([INSTALL_BACKUP])
AC_SUBST([INSTALL_NOEXEC]) AC_SUBST([INSTALL_NOEXEC])
AC_SUBST([DONT_LEAK_PATH_INFO]) AC_SUBST([DONT_LEAK_PATH_INFO])
AC_SUBST([BSDAUTH_USAGE]) AC_SUBST([BSDAUTH_USAGE])
@@ -186,6 +187,7 @@ dnl
dnl Initial values for Makefile variables listed above dnl Initial values for Makefile variables listed above
dnl May be overridden by environment variables.. dnl May be overridden by environment variables..
dnl dnl
INSTALL_BACKUP=
INSTALL_NOEXEC= INSTALL_NOEXEC=
exampledir='$(docdir)/examples' exampledir='$(docdir)/examples'
devdir='$(srcdir)' devdir='$(srcdir)'
@@ -1779,6 +1781,9 @@ case "$host" in
# Load time is much greater if writable so use 0555. # Load time is much greater if writable so use 0555.
SHLIB_MODE=0555 SHLIB_MODE=0555
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
AC_CHECK_FUNCS([pstat_getproc]) AC_CHECK_FUNCS([pstat_getproc])
;; ;;
*-*-hpux*) *-*-hpux*)
@@ -1800,6 +1805,9 @@ case "$host" in
# Load time is much greater if writable so use 0555. # Load time is much greater if writable so use 0555.
SHLIB_MODE=0555 SHLIB_MODE=0555
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
# The HP bundled compiler cannot generate shared libs # The HP bundled compiler cannot generate shared libs
if test -z "$GCC"; then if test -z "$GCC"; then
AC_CACHE_CHECK([for HP bundled C compiler], AC_CACHE_CHECK([for HP bundled C compiler],

View File

@@ -52,6 +52,7 @@ AWK = @AWK@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# C preprocessor defines # C preprocessor defines
CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\" CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\"
@@ -211,7 +212,7 @@ install: install-dirs
case "$(LT_LDFLAGS)" in \ case "$(LT_LDFLAGS)" in \
*-no-install*) ;; \ *-no-install*) ;; \
*) if [ X"$(shlib_enable)" = X"yes" ]; then \ *) if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
fi;; \ fi;; \
esac esac

View File

@@ -50,6 +50,7 @@ AWK = @AWK@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# C preprocessor flags # C preprocessor flags
CPPFLAGS = -I. -I$(srcdir) CPPFLAGS = -I. -I$(srcdir)
@@ -117,7 +118,7 @@ install:
case "$(LT_LDFLAGS)" in \ case "$(LT_LDFLAGS)" in \
*-no-install*) ;; \ *-no-install*) ;; \
*) if [ X"$(shlib_enable)" = X"yes" ]; then \ *) if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_z.la $(DESTDIR)$(libexecdir)/sudo; \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_z.la $(DESTDIR)$(libexecdir)/sudo; \
fi;; \ fi;; \
esac esac

View File

@@ -35,6 +35,7 @@ AWK = @AWK@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# Libraries # Libraries
LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la
@@ -133,7 +134,7 @@ install-doc:
install-plugin: install-dirs group_file.la install-plugin: install-dirs group_file.la
if [ X"$(shlib_enable)" = X"yes" ]; then \ if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) group_file.la $(DESTDIR)$(plugindir); \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) group_file.la $(DESTDIR)$(plugindir); \
fi fi
uninstall: uninstall:

View File

@@ -35,6 +35,7 @@ AWK = @AWK@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# Libraries # Libraries
LIBS = $(top_builddir)/lib/util/libsudo_util.la LIBS = $(top_builddir)/lib/util/libsudo_util.la
@@ -132,7 +133,7 @@ install-doc:
install-plugin: install-dirs sample_plugin.la install-plugin: install-dirs sample_plugin.la
if [ X"$(shlib_enable)" = X"yes" ]; then \ if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sample_plugin.la $(DESTDIR)$(plugindir); \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sample_plugin.la $(DESTDIR)$(plugindir); \
fi fi
uninstall: uninstall:

View File

@@ -48,6 +48,7 @@ PERL = perl
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# Libraries # Libraries
LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la
@@ -320,8 +321,8 @@ install-dirs:
$(INSTALL) -d $(INSTALL_OWNER) -m 0700 $(DESTDIR)$(vardir)/lectured $(INSTALL) -d $(INSTALL_OWNER) -m 0700 $(DESTDIR)$(vardir)/lectured
install-binaries: visudo sudoreplay install-dirs install-binaries: visudo sudoreplay install-dirs
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sudoreplay $(DESTDIR)$(replaydir)/sudoreplay INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sudoreplay $(DESTDIR)$(replaydir)/sudoreplay
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 visudo $(DESTDIR)$(visudodir)/visudo INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 visudo $(DESTDIR)$(visudodir)/visudo
install-includes: install-includes:
@@ -332,7 +333,7 @@ install-plugin: sudoers.la install-dirs
case "$(LT_LDFLAGS)" in \ case "$(LT_LDFLAGS)" in \
*-no-install*) ;; \ *-no-install*) ;; \
*) if [ X"$(shlib_enable)" = X"yes" ]; then \ *) if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudoers.la $(DESTDIR)$(plugindir); \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudoers.la $(DESTDIR)$(plugindir); \
fi;; \ fi;; \
esac esac

View File

@@ -35,6 +35,7 @@ AWK = @AWK@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# Libraries # Libraries
LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la
@@ -133,7 +134,7 @@ install-doc:
install-plugin: install-dirs system_group.la install-plugin: install-dirs system_group.la
if [ X"$(shlib_enable)" = X"yes" ]; then \ if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) system_group.la $(DESTDIR)$(plugindir); \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) system_group.la $(DESTDIR)$(plugindir); \
fi fi
uninstall: uninstall:

View File

@@ -35,6 +35,7 @@ SED = @SED@
# Our install program supports extra flags... # Our install program supports extra flags...
INSTALL = $(SHELL) $(top_srcdir)/install-sh -c INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
INSTALL_OWNER = -o $(install_uid) -g $(install_gid) INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
INSTALL_BACKUP = @INSTALL_BACKUP@
# Libraries # Libraries
LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la
@@ -174,11 +175,11 @@ install-rc: install-dirs
fi fi
install-binaries: install-dirs $(PROGS) install-binaries: install-dirs $(PROGS)
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 04755 sudo $(DESTDIR)$(bindir)/sudo INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 04755 sudo $(DESTDIR)$(bindir)/sudo
rm -f $(DESTDIR)$(bindir)/sudoedit rm -f $(DESTDIR)$(bindir)/sudoedit
ln -s sudo $(DESTDIR)$(bindir)/sudoedit ln -s sudo $(DESTDIR)$(bindir)/sudoedit
if [ -f sesh ]; then \ if [ -f sesh ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sesh $(DESTDIR)$(libexecdir)/sudo/sesh; \ INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 0755 sesh $(DESTDIR)$(libexecdir)/sudo/sesh; \
fi fi
install-doc: install-doc:
@@ -186,7 +187,7 @@ install-doc:
install-includes: install-includes:
install-noexec: install-dirs sudo_noexec.la install-noexec: install-dirs sudo_noexec.la
INSTALL_BACKUP='~' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudo_noexec.la $(DESTDIR)$(noexecdir) INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) $(LTFLAGS) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudo_noexec.la $(DESTDIR)$(noexecdir)
install-plugin: install-plugin: