Diff for /embedaddon/sudo/sudo.pp between versions 1.1.1.1 and 1.1.1.5

version 1.1.1.1, 2012/02/21 16:23:02 version 1.1.1.5, 2014/06/15 16:12:54
Line 12  limited root privileges to users and log root activity Line 12  limited root privileges to users and log root activity
 The basic philosophy is to give as few privileges as possible but \  The basic philosophy is to give as few privileges as possible but \
 still allow people to get their work done."  still allow people to get their work done."
         vendor="Todd C. Miller"          vendor="Todd C. Miller"
        copyright="(c) 1993-1996,1998-2011 Todd C. Miller"        copyright="(c) 1993-1996,1998-2014 Todd C. Miller"
         sudoedit_man=`echo ${pp_destdir}$mandir/*/sudoedit.*|sed "s:^${pp_destdir}::"`
         sudoedit_man_target=`basename $sudoedit_man | sed 's/edit//'`
   
 %if [aix]  %if [aix]
         # AIX package summary is limited to 40 characters          # AIX package summary is limited to 40 characters
Line 44  still allow people to get their work done." Line 46  still allow people to get their work done."
         pp_rpm_license="BSD"          pp_rpm_license="BSD"
         pp_rpm_url="http://www.sudo.ws/"          pp_rpm_url="http://www.sudo.ws/"
         pp_rpm_group="Applications/System"          pp_rpm_group="Applications/System"
        pp_rpm_packager="Todd.Miller@courtesan.com"        pp_rpm_packager="Todd C. Miller <Todd.Miller@courtesan.com>"
         if test -n "$linux_audit"; then          if test -n "$linux_audit"; then
                 pp_rpm_requires="audit-libs >= $linux_audit"                  pp_rpm_requires="audit-libs >= $linux_audit"
         fi          fi
   
         pp_deb_maintainer="$pp_rpm_packager"  
         pp_deb_release="$pp_rpm_release"  
         pp_deb_version="$pp_rpm_version"  
 %else  %else
         # For all but RPM and Debian we need to install sudoers with a different          # 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.          # name and make a copy of it if there is no existing file.
         mv ${pp_destdir}$sudoersdir/sudoers ${pp_destdir}$sudoersdir/sudoers.dist          mv ${pp_destdir}$sudoersdir/sudoers ${pp_destdir}$sudoersdir/sudoers.dist
 %endif  %endif
   
   %if [deb]
           pp_deb_maintainer="$pp_rpm_packager"
           pp_deb_release="$pp_rpm_release"
           pp_deb_version="$pp_rpm_version"
           pp_deb_section=admin
           install -D -m 644 ${pp_destdir}$docdir/LICENSE ${pp_wrkdir}/${name}/usr/share/doc/${name}/copyright
           install -D -m 644 ${pp_destdir}$docdir/ChangeLog ${pp_wrkdir}/${name}/usr/share/doc/${name}/changelog
           gzip -9f ${pp_wrkdir}/${name}/usr/share/doc/${name}/changelog
           printf "$name ($pp_deb_version-$pp_deb_release) admin; urgency=low\n\n  * see upstream changelog\n\n -- $pp_deb_maintainer  `date '+%a, %d %b %Y %T %z'`\n" > ${pp_wrkdir}/${name}/usr/share/doc/${name}/changelog.Debian
           chmod 644 ${pp_wrkdir}/${name}/usr/share/doc/${name}/changelog.Debian
           gzip -9f ${pp_wrkdir}/${name}/usr/share/doc/${name}/changelog.Debian
           # Create lintian override file
           mkdir -p ${pp_wrkdir}/${name}/usr/share/lintian/overrides
           cat >${pp_wrkdir}/${name}/usr/share/lintian/overrides/${name} <<-EOF
           # The sudo binary must be setuid root
           $name: setuid-binary usr/bin/sudo 4755 root/root
           # Sudo configuration and data dirs must not be world-readable
           $name: non-standard-file-perm etc/sudoers 0440 != 0644
           $name: non-standard-dir-perm etc/sudoers.d/ 0750 != 0755
           $name: non-standard-dir-perm var/lib/sudo/ 0700 != 0755
           # Sudo ships with debugging symbols
           $name: unstripped-binary-or-object
           EOF
           chmod 644 ${pp_wrkdir}/${name}/usr/share/lintian/overrides/${name}
   %endif
   
 %if [rpm]  %if [rpm]
         # Add distro info to release          # Add distro info to release
         osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*//' -e 's/-.*$//'`          osrelease=`echo "$pp_rpm_distro" | sed -e 's/^[^0-9]*//' -e 's/-.*$//'`
Line 74  still allow people to get their work done." Line 98  still allow people to get their work done."
         # Note that the order must match that of sudoers.          # Note that the order must match that of sudoers.
         case "$pp_rpm_distro" in          case "$pp_rpm_distro" in
         centos*|rhel*)          centos*|rhel*)
                   chmod u+w ${pp_destdir}${sudoersdir}/sudoers
                 /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'                  /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                 /Locale settings/+1,s/^# //                  /Locale settings/+1,s/^# //
                 /Desktop path settings/+1,s/^# //                  /Desktop path settings/+1,s/^# //
                 w                  w
                 q                  q
                 EOF                  EOF
                   chmod u-w ${pp_destdir}${sudoersdir}/sudoers
                 ;;                  ;;
         sles*)          sles*)
                   chmod u+w ${pp_destdir}${sudoersdir}/sudoers
                 /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'                  /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                 /Locale settings/+1,s/^# //                  /Locale settings/+1,s/^# //
                 /ConsoleKit session/+1,s/^# //                  /ConsoleKit session/+1,s/^# //
Line 90  still allow people to get their work done." Line 117  still allow people to get their work done."
                 w                  w
                 q                  q
                 EOF                  EOF
                   chmod u-w ${pp_destdir}${sudoersdir}/sudoers
                 ;;                  ;;
         esac          esac
   
Line 157  still allow people to get their work done." Line 185  still allow people to get their work done."
 %if [deb]  %if [deb]
         # Uncomment some Defaults and the %sudo rule in sudoers          # Uncomment some Defaults and the %sudo rule in sudoers
         # Note that the order must match that of sudoers and be tab-indented.          # Note that the order must match that of sudoers and be tab-indented.
           chmod u+w ${pp_destdir}${sudoersdir}/sudoers
         /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'          /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
         /Locale settings/+1,s/^# //          /Locale settings/+1,s/^# //
         /X11 resource/+1,s/^# //          /X11 resource/+1,s/^# //
Line 164  still allow people to get their work done." Line 193  still allow people to get their work done."
         w          w
         q          q
         EOF          EOF
           chmod u-w ${pp_destdir}${sudoersdir}/sudoers
         mkdir -p ${pp_destdir}/etc/pam.d          mkdir -p ${pp_destdir}/etc/pam.d
         cat > ${pp_destdir}/etc/pam.d/sudo <<-EOF          cat > ${pp_destdir}/etc/pam.d/sudo <<-EOF
         #%PAM-1.0          #%PAM-1.0
Line 176  still allow people to get their work done." Line 206  still allow people to get their work done."
         EOF          EOF
 %endif  %endif
   
   %if [macos]
           pp_macos_pkg_type=flat
           pp_macos_bundle_id=ws.sudo.pkg.sudo
           pp_macos_pkg_license=doc/LICENSE
           pp_macos_pkg_readme=${pp_wrkdir}/ReadMe.txt
           perl -pe 'last if (/^What/i && $seen++)' NEWS > ${pp_wrkdir}/ReadMe.txt
   %endif
   
   %if X"$aix_freeware" = X"true"
           # Create links from /opt/freeware/{bin,sbin} -> /usr/{bin.sbin}
           mkdir -p ${pp_destdir}/usr/bin ${pp_destdir}/usr/sbin
           ln -s -f ${bindir}/sudo ${pp_destdir}/usr/bin
           ln -s -f ${bindir}/sudoedit ${pp_destdir}/usr/bin
           ln -s -f ${bindir}/sudoreplay ${pp_destdir}/usr/bin
           ln -s -f ${sbindir}/visudo ${pp_destdir}/usr/sbin
   %endif
   
         # OS-level directories that should generally exist but might not.          # OS-level directories that should generally exist but might not.
         extradirs=`echo ${pp_destdir}/${mandir}/[mc]* | sed "s#${pp_destdir}/##g"`          extradirs=`echo ${pp_destdir}/${mandir}/[mc]* | sed "s#${pp_destdir}/##g"`
        extradirs="$extradirs `dirname $docdir` `dirname $timedir`"        extradirs="$extradirs `dirname $docdir` `dirname $rundir` `dirname $vardir`"
         test -d ${pp_destdir}${localedir} && extradirs="$extradirs $localedir"
         test -d ${pp_destdir}/etc/pam.d && extradirs="${extradirs} /etc/pam.d"          test -d ${pp_destdir}/etc/pam.d && extradirs="${extradirs} /etc/pam.d"
         for dir in $bindir $sbindir $libexecdir $includedir $extradirs; do          for dir in $bindir $sbindir $libexecdir $includedir $extradirs; do
                 while test "$dir" != "/"; do                  while test "$dir" != "/"; do
Line 188  still allow people to get their work done." Line 236  still allow people to get their work done."
         done          done
         osdirs=`echo $osdirs | tr " " "\n" | sort -u`          osdirs=`echo $osdirs | tr " " "\n" | sort -u`
   
   %depend [deb]
           libc6, libpam0g, libpam-modules, zlib1g, libselinux1
   
   %fixup [deb]
           # Add Conflicts, Replaces headers and add libldap depedency as needed.
           if test -z "%{flavor}"; then
               echo "Conflicts: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control
               echo "Replaces: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control
           elif test "%{flavor}" = "ldap"; then
               echo "Conflicts: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control
               echo "Replaces: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control
               echo "Provides: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control
               cp -p %{pp_wrkdir}/%{name}/DEBIAN/control %{pp_wrkdir}/%{name}/DEBIAN/control.$$
               sed 's/^\(Depends:.*\) *$/\1, libldap-2.4-2/' %{pp_wrkdir}/%{name}/DEBIAN/control.$$ > %{pp_wrkdir}/%{name}/DEBIAN/control
               rm -f %{pp_wrkdir}/%{name}/DEBIAN/control.$$
           fi
           echo "Homepage: http://www.sudo.ws/sudo/" >> %{pp_wrkdir}/%{name}/DEBIAN/control
           echo "Bugs: http://www.sudo.ws/bugs/" >> %{pp_wrkdir}/%{name}/DEBIAN/control
   
 %files  %files
        $osdirs                -        $osdirs                 -
        $bindir/sudo        4111 root:        $bindir/sudo            4755 root:
        $bindir/sudoedit    4111 root:        $bindir/sudoedit        0755 root: symlink sudo
        $sbindir/visudo     0111        $sbindir/visudo         0755
        $bindir/sudoreplay  0111        $bindir/sudoreplay      0755
        $includedir/sudo_plugin.h        $includedir/sudo_plugin.h 0644
        $libexecdir/*                optional        $libexecdir/sudo/   0755
         $libexecdir/sudo/sesh   0755 optional,ignore-others
         $libexecdir/sudo/*      $shlib_mode optional
         $sudoersdir/sudoers.d/  0750 $sudoers_uid:$sudoers_gid          $sudoersdir/sudoers.d/  0750 $sudoers_uid:$sudoers_gid
        $timedir/            0700 root:        $rundir/            0711 root:
        $docdir/        $vardir/                0711 root: ignore-others
        $docdir/*        $docdir/                0755
        $localedir/             optional        $docdir/sudoers2ldif    0755 optional,ignore-others
        $localedir/**                optional%if [deb]
        /etc/pam.d/*            volatile,optional        $docdir/LICENSE         ignore,ignore-others
         $docdir/ChangeLog       ignore,ignore-others
 %endif
         $docdir/*               0644
         $localedir/*/              -    optional
         $localedir/*/LC_MESSAGES/ -    optional
         $localedir/*/LC_MESSAGES/* 0644    optional
         /etc/pam.d/*            0644 volatile,optional
 %if [rpm,deb]  %if [rpm,deb]
         $sudoersdir/sudoers $sudoers_mode $sudoers_uid:$sudoers_gid volatile          $sudoersdir/sudoers $sudoers_mode $sudoers_uid:$sudoers_gid volatile
 %else  %else
         $sudoersdir/sudoers.dist $sudoers_mode $sudoers_uid:$sudoers_gid volatile          $sudoersdir/sudoers.dist $sudoers_mode $sudoers_uid:$sudoers_gid volatile
 %endif  %endif
   %if X"$aix_freeware" = X"true"
           # Links for binaries from /opt/freeware to /usr
           /usr/bin/sudo           0755 root: symlink $bindir/sudo
           /usr/bin/sudoedit       0755 root: symlink $bindir/sudoedit
           /usr/bin/sudoreplay     0755 root: symlink $bindir/sudoreplay
           /usr/sbin/visudo        0755 root: symlink $sbindir/visudo
   %endif
   %if [rpm]
           /etc/rc.d/init.d/sudo   0755 root: optional
   %endif
   %if [aix]
           /etc/rc.d/              ignore
           /etc/rc.d/rc2.d/        ignore
           /etc/rc.d/rc2.d/**      ignore
           /etc/rc.d/init.d/       ignore
           /etc/rc.d/init.d/sudo   0755 root:
   %endif
   %if [sd]
           /sbin/                  ignore
           /sbin/rc2.d/            ignore
           /sbin/rc2.d/**          ignore
           /sbin/init.d/           ignore
           /sbin/init.d/sudo       0755 root:
   %endif
   
 %files [!aix]  %files [!aix]
        $mandir/man*/*        $sudoedit_man           0644 symlink,ignore-others $sudoedit_man_target
         $mandir/man*/*          0644
   
 %files [aix]  %files [aix]
         # Some versions use catpages, some use manpages.          # Some versions use catpages, some use manpages.
        $mandir/cat*/* optional        $sudoedit_man           0644 symlink,ignore-others $sudoedit_man_target
        $mandir/man*/* optional        $mandir/cat*/*          0644 optional
         $mandir/man*/*          0644 optional
   
   %pre [aix]
           if rpm -q %{name} >/dev/null 2>&1; then
                   echo "Another version of sudo is currently installed via rpm." 2>&1
                   echo "Please either uninstall the rpm version of sudo by running \"rpm -e sudo\"" 2>&1
                   echo "or upgrade the existing version of sudo using the .rpm packagae instead" 2>&1
                   echo "instead of the .bff package." 2>&1
                   echo "" 2>&1
                   echo "Note that you may need to pass rpm the --oldpackage flag when upgrading" 2>&1
                   echo "the AIX Toolbox version of sudo to the latest sudo rpm from sudo.ws." 2>&1
                   echo "" 2>&1
                   exit 1
           fi
   
 %post [!rpm,deb]  %post [!rpm,deb]
         # Don't overwrite an existing sudoers file          # Don't overwrite an existing sudoers file
   %if [solaris]
           sudoersdir=${PKG_INSTALL_ROOT}%{sudoersdir}
   %else
         sudoersdir=%{sudoersdir}          sudoersdir=%{sudoersdir}
   %endif
         if test ! -r $sudoersdir/sudoers; then          if test ! -r $sudoersdir/sudoers; then
                 cp $sudoersdir/sudoers.dist $sudoersdir/sudoers                  cp $sudoersdir/sudoers.dist $sudoersdir/sudoers
                 chmod %{sudoers_mode} $sudoersdir/sudoers                  chmod %{sudoers_mode} $sudoersdir/sudoers
Line 228  still allow people to get their work done." Line 347  still allow people to get their work done."
         fi          fi
   
 %post [deb]  %post [deb]
           set -e
   
         # dpkg-deb does not maintain the mode on the sudoers file, and          # dpkg-deb does not maintain the mode on the sudoers file, and
         # installs it 0640 when sudo requires 0440          # installs it 0640 when sudo requires 0440
         chmod %{sudoers_mode} %{sudoersdir}/sudoers          chmod %{sudoers_mode} %{sudoersdir}/sudoers
Line 261  still allow people to get their work done." Line 382  still allow people to get their work done."
                 exit 0;                  exit 0;
         '          '
   
%preun [deb]%post [rpm]
         case "%{pp_rpm_distro}" in
         aix*)
                 # Create /etc/rc.d/rc2.d/S90sudo link if /etc/rc.d exists
                 if [ -d /etc/rc.d ]; then
                         rm -f /etc/rc.d/rc2.d/S90sudo
                         ln -s /etc/rc.d/init.d/sudo /etc/rc.d/rc2.d/S90sudo
                 fi
                 ;;
         esac
 
 %post [aix]
         # Create /etc/rc.d/rc2.d/S90sudo link if /etc/rc.d exists
         if [ -d /etc/rc.d ]; then
                 rm -f /etc/rc.d/rc2.d/S90sudo
                 ln -s /etc/rc.d/init.d/sudo /etc/rc.d/rc2.d/S90sudo
         fi
 
 %post [sd]
         # Create /sbin/rc2.d/S900sudo link
         rm -f /sbin/rc2.d/S900sudo
         ln -s /sbin/init.d/sudo /sbin/rc2.d/S900sudo
 
 %preun
         # Remove the time stamp dir and its contents
         # We currently leave the lecture status files installed
         rm -rf %{rundir}/ts
 %if [deb]
         set -e
 
         # Remove the /etc/ldap/ldap.conf -> /etc/sudo-ldap.conf symlink if          # Remove the /etc/ldap/ldap.conf -> /etc/sudo-ldap.conf symlink if
         # it matches what we created in the postinstall script.          # it matches what we created in the postinstall script.
         if test X"%{flavor}" = X"ldap" -a \          if test X"%{flavor}" = X"ldap" -a \
             X"`readlink /etc/sudo-ldap.conf 2>/dev/null`" = X"/etc/ldap/ldap.conf"; then              X"`readlink /etc/sudo-ldap.conf 2>/dev/null`" = X"/etc/ldap/ldap.conf"; then
                 rm -f /etc/sudo-ldap.conf                  rm -f /etc/sudo-ldap.conf
         fi          fi
   %endif
   %if [rpm]
           case "%{pp_rpm_distro}" in
           aix*)
                   # Remove /etc/rc.d/rc2.d/S90sudo link
                   rm -f /etc/rc.d/rc2.d/S90sudo
                   ;;
           esac
   %endif
   %if [aix]
           # Remove /etc/rc.d/rc2.d/S90sudo link
           rm -f /etc/rc.d/rc2.d/S90sudo
   %endif
   %if [sd]
           # Remove /sbin/rc2.d/S900sudo link
           rm -f /sbin/rc2.d/S900sudo
   %endif

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>