chiark / gitweb /
path-util: Add hidden suffixes for ucf (#3131)
[elogind.git] / src / basic / path-util.c
index b222146c73f49f0fa2212c19939ffcfdbdd209ae..5f4252f48cfe7d86ece820d592ed21dd336e05bd 100644 (file)
@@ -574,10 +574,10 @@ static int binary_is_good(const char *binary) {
         if (r < 0)
                 return r;
 
-        return !path_equal(d, "true") &&
-               !path_equal(d, "/bin/true") &&
-               !path_equal(d, "/usr/bin/true") &&
-               !path_equal(d, "/dev/null");
+        return !PATH_IN_SET(d, "true"
+                               "/bin/true",
+                               "/usr/bin/true",
+                               "/dev/null");
 }
 
 int fsck_exists(const char *fstype) {
@@ -780,6 +780,9 @@ bool hidden_file_allow_backup(const char *filename) {
                 endswith(filename, ".dpkg-bak") ||
                 endswith(filename, ".dpkg-backup") ||
                 endswith(filename, ".dpkg-remove") ||
+                endswith(filename, ".ucf-new") ||
+                endswith(filename, ".ucf-old") ||
+                endswith(filename, ".ucf-dist") ||
                 endswith(filename, ".swp");
 }