]> granicus.if.org Git - sudo/commitdiff
Install sudoers as /etc/sudoers on RPM and debian systems where the
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 22 Jul 2010 17:45:53 +0000 (13:45 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 22 Jul 2010 17:45:53 +0000 (13:45 -0400)
package manager will not replace a user-modified configuration file.
This fixes upgrades from the vendor sudo packages.

--HG--
branch : 1.7

Makefile.in
configure
configure.in
sudo.pp

index 38dee6c256bf6e1ff2a155faf1a53afde3150c6f..137dd7c0b9bd7c1889ca236a820f4d58f7045b1a 100644 (file)
@@ -541,11 +541,9 @@ package: sudo.pp
        DESTDIR=`cd $(top_builddir) && pwd`/destdir; rm -rf $$DESTDIR; \
        $(SHELL) $(srcdir)/mkinstalldirs $$DESTDIR/$(timedir) && \
        $(MAKE) install DESTDIR=$$DESTDIR && \
-       mv $$DESTDIR/$(sysconfdir)/sudoers \
-           $$DESTDIR/$(sysconfdir)/sudoers.dist && \
        $(SHELL) $(srcdir)/pp \
            --destdir=$$DESTDIR \
-           $(srcdir)/sudo.pp   \
+           $(srcdir)/sudo.pp \
            bindir=$(bindir) \
            sbindir=$(sbindir) \
            libexecdir=$(libexecdir) \
index 4102892037b8e8998cebc761b9896175b6a09f14..a749c98f2cb7ad0798543a370c1366943e95e6c5 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for sudo 1.7.4.
+# Generated by GNU Autoconf 2.65 for sudo 1.7.4b4.
 #
 # Report bugs to <http://www.sudo.ws/bugs/>.
 #
@@ -701,8 +701,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='sudo'
 PACKAGE_TARNAME='sudo'
-PACKAGE_VERSION='1.7.4'
-PACKAGE_STRING='sudo 1.7.4'
+PACKAGE_VERSION='1.7.4b4'
+PACKAGE_STRING='sudo 1.7.4b4'
 PACKAGE_BUGREPORT='http://www.sudo.ws/bugs/'
 PACKAGE_URL=''
 
@@ -1551,7 +1551,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sudo 1.7.4 to adapt to many kinds of systems.
+\`configure' configures sudo 1.7.4b4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1616,7 +1616,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sudo 1.7.4:";;
+     short | recursive ) echo "Configuration of sudo 1.7.4b4:";;
    esac
   cat <<\_ACEOF
 
@@ -1826,7 +1826,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sudo configure 1.7.4
+sudo configure 1.7.4b4
 generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2347,7 +2347,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sudo $as_me 1.7.4, which was
+It was created by sudo $as_me 1.7.4b4, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
@@ -18706,7 +18706,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sudo $as_me 1.7.4, which was
+This file was extended by sudo $as_me 1.7.4b4, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -18772,7 +18772,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-sudo config.status 1.7.4
+sudo config.status 1.7.4b4
 configured by $0, generated by GNU Autoconf 2.65,
   with options \\"\$ac_cs_config\\"
 
index 9070fecb10405e4658e7ef97b6962971ec7c37ee..fcdf2d768c433f2431b45fcac02b508068b5af37 100644 (file)
@@ -3,7 +3,7 @@ dnl Process this file with GNU autoconf to produce a configure script.
 dnl
 dnl Copyright (c) 1994-1996,1998-2010 Todd C. Miller <Todd.Miller@courtesan.com>
 dnl
-AC_INIT([sudo], [1.7.4], [http://www.sudo.ws/bugs/], [sudo])
+AC_INIT([sudo], [1.7.4b4], [http://www.sudo.ws/bugs/], [sudo])
 AC_CONFIG_HEADER(config.h pathnames.h)
 dnl
 dnl This won't work before AC_INIT
diff --git a/sudo.pp b/sudo.pp
index 7df939e052f335dc6d05a497ace8adc9cb6d49b1..1023ad589e88d526a98f18982232d1b150eafcb1 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -19,6 +19,11 @@ still allow people to get their work done."
        pp_deb_maintainer="Todd.Miller@courtesan.com"
        pp_sd_vendor_tag="TCM"
        pp_solaris_name="${pp_sd_vendor_tag}${name}"
+%if [!rpm,deb]
+       # For all but RPM and Debian we need to install sudoers with a different
+       # name and make a copy of it if there is no existing file.
+       mv ${pp_destdir}$sudoersdir/sudoers ${pp_destdir}$sudoersdir/sudoers.dist
+%endif
 
 %set [rpm]
        # Add distro info to release
@@ -32,13 +37,11 @@ still allow people to get their work done."
                ;;
        esac
 
-       # Uncomment some Defaults in sudoers.dist
+       # Uncomment some Defaults in sudoers
        # Note that the order must match that of sudoers.
        case "$pp_rpm_distro" in
        centos*|rhel*)
-               # Uncomment some Defaults in sudoers.dist, must be tab indented.
-               # Note that the order must match that of sudoers.
-               /bin/ed - ${pp_destdir}${sudoersdir}/sudoers.dist <<-'EOF'
+               /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                /Locale settings/+1,s/^# //
                /Desktop path settings/+1,s/^# //
                w
@@ -46,9 +49,7 @@ still allow people to get their work done."
                EOF
                ;;
        sles*)
-               # Uncomment some Defaults in sudoers.dist, must be tab indented.
-               # Note that the order must match that of sudoers.
-               /bin/ed - ${pp_destdir}${sudoersdir}/sudoers.dist <<-'EOF'
+               /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                /Locale settings/+1,s/^# //
                /ConsoleKit session/+1,s/^# //
                w
@@ -118,9 +119,9 @@ still allow people to get their work done."
        esac
 
 %set [deb]
-       # Uncomment some Defaults and the %sudo rule in sudoers.dist
+       # Uncomment some Defaults and the %sudo rule in sudoers
        # Note that the order must match that of sudoers and be tab-indented.
-       /bin/ed - ${pp_destdir}${sudoersdir}/sudoers.dist <<-'EOF'
+       /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
        /Locale settings/+1,s/^# //
        /X11 resource/+1,s/^# //
        /^# \%sudo/,s/^# //
@@ -148,12 +149,16 @@ still allow people to get their work done."
        $sbindir/visudo     0111
        $bindir/sudoreplay  0111
        $libexecdir/*
-       $sudoersdir/sudoers.dist $sudoers_mode $sudoers_uid:$sudoers_gid volatile
        $sudoersdir/sudoers.d/  0750 $sudoers_uid:$sudoers_gid
        $timedir/               0700 root:
        $docdir/
        $docdir/*
        /etc/pam.d/*            volatile,optional
+%if [rpm,deb]
+       $sudoersdir/sudoers $sudoers_mode $sudoers_uid:$sudoers_gid volatile
+%else
+       $sudoersdir/sudoers.dist $sudoers_mode $sudoers_uid:$sudoers_gid volatile
+%endif
 
 %files [!aix]
        $mandir/man*/*
@@ -163,7 +168,7 @@ still allow people to get their work done."
        $mandir/cat*/* optional
        $mandir/man*/* optional
 
-%post
+%post [!rpm,deb]
        # Don't overwrite an existing sudoers file
        sudoersdir=%{sudoersdir}
        if test ! -r $sudoersdir/sudoers; then