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