From a6f4464571f516c44af731b033e557671bcf8ca5 Mon Sep 17 00:00:00 2001 From: Ryan Gonzalez Date: Sun, 6 Jan 2019 18:12:31 -0600 Subject: [PATCH] tmpfiles: Make C still copy if the destination directory is empty Fixes #11287. --- man/tmpfiles.d.xml | 10 +++++----- src/tmpfiles/tmpfiles.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml index 5d393f39840..bc6c8cdf432 100644 --- a/man/tmpfiles.d.xml +++ b/man/tmpfiles.d.xml @@ -282,11 +282,11 @@ L /tmp/foobar - - - - /dev/null C Recursively copy a file or directory, if the - destination files or directories do not exist yet. Note that - this command will not descend into subdirectories if the - destination directory already exists. Instead, the entire - copy operation is skipped. If the argument is omitted, files - from the source directory + destination files or directories do not exist yet or the + destination directory is empty. Note that this command will not + descend into subdirectories if the destination directory already + exists and is not empty. Instead, the entire copy operation is + skipped. If the argument is omitted, files from the source directory /usr/share/factory/ with the same name are copied. Does not follow symlinks. diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 19225f8cfd7..03a9e1d1f02 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -1463,7 +1463,7 @@ static int copy_files(Item *i) { dfd, bn, i->uid_set ? i->uid : UID_INVALID, i->gid_set ? i->gid : GID_INVALID, - COPY_REFLINK); + COPY_REFLINK | COPY_MERGE_EMPTY); if (r < 0) { struct stat a, b; -- 2.47.3