From f0e941a396dac2c95a3da2dc7fd8ef8adc6f1be5 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 10 Jun 2011 15:26:35 -0400 Subject: [PATCH] Explicitly set mode and owner of /etc/sudoers instead of relying on "cp -p" to work in the postinstall script. On AIX 6.1 at least the postinstall script runs before the final file permissions are set. --- sudo.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sudo.pp b/sudo.pp index a755651e7..8477019c7 100644 --- a/sudo.pp +++ b/sudo.pp @@ -208,7 +208,10 @@ still allow people to get their work done." # Don't overwrite an existing sudoers file sudoersdir=%{sudoersdir} if test ! -r $sudoersdir/sudoers; then - cp -p $sudoersdir/sudoers.dist $sudoersdir/sudoers + cp $sudoersdir/sudoers.dist $sudoersdir/sudoers + chmod %{sudoers_mode} $sudoersdir/sudoers + chown %{sudoers_uid} $sudoersdir/sudoers + chgrp %{sudoers_gid} $sudoersdir/sudoers fi %post [deb]