move temp file removal before possible exit point
authorBdale Garbee <bdale@gag.com>
Sat, 12 Nov 2011 23:10:14 +0000 (16:10 -0700)
committerBdale Garbee <bdale@gag.com>
Sat, 12 Nov 2011 23:10:14 +0000 (16:10 -0700)
debian/sudo-ldap.postinst
debian/sudo.postinst

index 949a511b99ab31b6bdb0e50aca13e09501eb58e1..0a9a5a425291902bb3326c17b83494c45a4ccd89 100644 (file)
@@ -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 "";
index 454d8c7e69f0e1f78477d1a0eca32eee2fb77834..3d40784d54e238b8b2aca20c41a05c899259612c 100644 (file)
@@ -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 "";