tmpfiles: add the C+ entry, copy to a directory that is not empty

A C entry leaves a directory alone when there is something in it.  In
tmpfiles.d(5) a C+ entry copies to it anyway: what the directory lacks
is added, and what it has is not overwritten.

    C+ /etc/skel - - - - /usr/share/factory/etc/skel

tmpfiles reads C+ as C.  Let the + through to copy_tree().

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-21 17:14:04 +01:00
1 parent 7b3b217e60
commit 37cbc12946
4 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -1917,7 +1917,7 @@ static void tmpfiles(char *line)
if (lstat(arg, &ast))
break;
rc = copy_tree(arg, &ast, path, 0);
rc = copy_tree(arg, &ast, path, plus);
if (!rc && !lstat(path, &st) && !S_ISLNK(st.st_mode) && !((st.st_mode ^ ast.st_mode) & S_IFMT) &&
perm_path(path, &perm, strc, O_PATH))
warn("Failed setting mode/owner on %s", path);