]> granicus.if.org Git - sudo/commitdiff
Make sure sudoers is writable before calling ed script.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 21 Feb 2012 09:54:08 +0000 (04:54 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 21 Feb 2012 09:54:08 +0000 (04:54 -0500)
sudo.pp

diff --git a/sudo.pp b/sudo.pp
index 6aa0360bccd9baee06a7cd855432e783aa5aa843..54e3410a1bad5b8495c58d22cedc78cc51a70c18 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -74,14 +74,17 @@ still allow people to get their work done."
        # Note that the order must match that of sudoers.
        case "$pp_rpm_distro" in
        centos*|rhel*)
+               chmod u+w ${pp_destdir}${sudoersdir}/sudoers
                /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                /Locale settings/+1,s/^# //
                /Desktop path settings/+1,s/^# //
                w
                q
                EOF
+               chmod u-w ${pp_destdir}${sudoersdir}/sudoers
                ;;
        sles*)
+               chmod u+w ${pp_destdir}${sudoersdir}/sudoers
                /bin/ed - ${pp_destdir}${sudoersdir}/sudoers <<-'EOF'
                /Locale settings/+1,s/^# //
                /ConsoleKit session/+1,s/^# //
@@ -90,6 +93,7 @@ still allow people to get their work done."
                w
                q
                EOF
+               chmod u-w ${pp_destdir}${sudoersdir}/sudoers
                ;;
        esac