Просмотр исходного кода

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
Родитель
Сommit
2b907c9059
2 измененных файлов с 5 добавлено и 2 удалено
  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