move temp file removal before possible exit point
[debian/sudo] / debian / sudo-ldap.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 "";