Przeglądaj źródła

Fix chown/chmod ordering

Wichert Akkerman 25 lat temu
rodzic
commit
c16789c315
2 zmienionych plików z 7 dodań i 2 usunięć
  1. 5 0
      ChangeLog
  2. 2 2
      scripts/dpkg-statoverride.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Thu Jan 11 09:35:00 PST 2001 Wichert Akkerman <wakkerma@debian.org>
+
+  * scripts/dpkg-statoverride.pl: do chown before chmod so we don't
+    loose setuid bits
+
 Mon Jan  8 15:46:13 PST 2001 Wichert Akkerman <wakkerma@debian.org>
 
   * scripts/dpkg-statoverride.{pl,8}: remove --import option now that

+ 2 - 2
scripts/dpkg-statoverride.pl

@@ -114,10 +114,10 @@ if ($mode eq "add") {
 
 	if ($doupdate) {
 	    if (not -f $file) {
-		print STDERR "waring: --update given but $file does not exist\n";
+		print STDERR "warning: --update given but $file does not exist\n";
 	    } else {
-		chmod (oct($mode),$file) || warn "failed to chmod $file: $!\n";
 		chown ($uid,$gid,$file) || warn "failed to chown $file: $!\n";
+		chmod (oct($mode),$file) || warn "failed to chmod $file: $!\n";
 	    }
 	}
 } elsif ($mode eq "remove") {