Kaynağa Gözat

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 16 yıl önce
ebeveyn
işleme
2b907c9059
2 değiştirilmiş dosya ile 5 ekleme ve 2 silme
  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.
   * Make “dpkg-statoverride --quiet” actually do something, and quiesce
     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 ]
   * German (Helge Kreutzmann).

+ 2 - 2
src/statcmd.c

@@ -171,9 +171,9 @@ static void
 statdb_node_apply(const char *filename, struct filestatoverride *filestat)
 {
 	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))
-		warning(_("failed to chmod %s: %s"), filename, strerror(errno));
+		ohshite(_("error setting permissions of `%.255s'"), filename);
 }
 
 static void