core: also remove private directories by systemctl clean
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Aug 2019 16:04:24 +0000 (01:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Aug 2019 14:09:44 +0000 (23:09 +0900)
Fixes #13355.

src/core/execute.c

index eb761f0..5b9b2ed 100644 (file)
@@ -4822,6 +4822,17 @@ int exec_context_get_clean_directories(
                         r = strv_consume(&l, j);
                         if (r < 0)
                                 return r;
+
+                        /* Also remove private directories unconditionally. */
+                        if (t != EXEC_DIRECTORY_CONFIGURATION) {
+                                j = path_join(prefix[t], "private", *i);
+                                if (!j)
+                                        return -ENOMEM;
+
+                                r = strv_consume(&l, j);
+                                if (r < 0)
+                                        return r;
+                        }
                 }
         }