Pārlūkot izejas kodu

dpkg-statoverride: Fail on chown or chmod errors when using --update

Fail if it cannot update the mode and owner of the file. This would fail
later on when dpkg itself applies the overrides, so better to signal
this as earlier as possible.
Guillem Jover 17 gadi atpakaļ
vecāks
revīzija
2b907c9059
2 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. 3 0
      debian/changelog
  2. 2 2
      src/statcmd.c

+ 3 - 0
debian/changelog

@@ -17,6 +17,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     header and dselect package status printing for consistency.
     header and dselect package status printing for consistency.
   * Make “dpkg-statoverride --quiet” actually do something, and quiesce
   * Make “dpkg-statoverride --quiet” actually do something, and quiesce
     most of the inoquous warning messages. Closes: #403211
     most of the inoquous warning messages. Closes: #403211
+  * Make “dpkg-statoverride --update --add” fail if it cannot update the
+    mode and owner of the file. This would fail later on when dpkg itself
+    applies the overrides, so better to signal this earlier.
 
 
   [ Updated man page translations ]
   [ Updated man page translations ]
   * German (Helge Kreutzmann).
   * German (Helge Kreutzmann).

+ 2 - 2
src/statcmd.c

@@ -171,9 +171,9 @@ static void
 statdb_node_apply(const char *filename, struct filestatoverride *filestat)
 statdb_node_apply(const char *filename, struct filestatoverride *filestat)
 {
 {
 	if (chown(filename, filestat->uid, filestat->gid) < 0)
 	if (chown(filename, filestat->uid, filestat->gid) < 0)
-		warning(_("failed to chown %s: %s"), filename, strerror(errno));
+		ohshite(_("error setting ownership of `%.255s'"), filename);
 	if (chmod(filename, filestat->mode))
 	if (chmod(filename, filestat->mode))
-		warning(_("failed to chmod %s: %s"), filename, strerror(errno));
+		ohshite(_("error setting permissions of `%.255s'"), filename);
 }
 }
 
 
 static void
 static void