From fcdd49862612a5b21382208f03902066bae282ec Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Sat, 12 Nov 2011 16:10:14 -0700 Subject: [PATCH] move temp file removal before possible exit point --- debian/sudo-ldap.postinst | 6 +++--- debian/sudo.postinst | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/sudo-ldap.postinst b/debian/sudo-ldap.postinst index 949a511..0a9a5a4 100644 --- a/debian/sudo-ldap.postinst +++ b/debian/sudo-ldap.postinst @@ -32,6 +32,9 @@ if (-e "/etc/ldap/ldap.conf" && ! -e "/etc/sudo-ldap.conf") { system("ln -s ldap/ldap.conf /etc/sudo-ldap.conf"); } +# if we've gotten this far .. remove the saved, unchanged old sudoers file +system ('rm -f /etc/sudoers.pre-conffile'); + # make sure we have a sudo group exit 0 if getgrnam("sudo"); # we're finished if there is a group sudo @@ -58,7 +61,4 @@ if ($gid != 27) { print "Creating group 'sudo' with gid = $gid\n"; system("groupadd -g $gid sudo"); -# if we've gotten this far .. remove the saved, unchanged old sudoers file -system ('rm -f /etc/sudoers.pre-conffile'); - print ""; diff --git a/debian/sudo.postinst b/debian/sudo.postinst index 454d8c7..3d40784 100644 --- a/debian/sudo.postinst +++ b/debian/sudo.postinst @@ -26,6 +26,9 @@ system ('update-rc.d -f sudo remove >/dev/null 2>&1'); system ('update-rc.d sudo start 75 2 3 4 5 . >/dev/null'); +# if we've gotten this far .. remove the saved, unchanged old sudoers file +system ('rm -f /etc/sudoers.pre-conffile'); + # make sure we have a sudo group exit 0 if getgrnam("sudo"); # we're finished if there is a group sudo @@ -52,7 +55,4 @@ if ($gid != 27) { print "Creating group 'sudo' with gid = $gid\n"; system("groupadd -g $gid sudo"); -# if we've gotten this far .. remove the saved, unchanged old sudoers file -system ('rm -f /etc/sudoers.pre-conffile'); - print ""; -- 2.47.2