From: Yuanhong Peng Date: Mon, 22 Jan 2024 10:03:55 +0000 (+0800) Subject: deploy: Ignore sockets, fifos in /etc/ during merge X-Git-Tag: archive/raspbian/2024.8-1+rpi1^2~7^2~6^2~12^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eb1e9cf7680fb9362e832c294a09afa01851b6ce;p=ostree.git deploy: Ignore sockets, fifos in /etc/ during merge It's a followup of commit e6a560b40797324aa8b90e7100c6d50bff91f14d. We should also ignore sockets and fifos in the subdir of /etc. Signed-off-by: Yuanhong Peng --- diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 5c941d51..3a537fcb 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -323,11 +323,20 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name, } else { - if (!glnx_file_copy_at (src_dfd_iter.fd, dent->d_name, &child_stbuf, dest_dfd, - dent->d_name, - sysroot_flags_to_copy_flags (GLNX_FILE_COPY_OVERWRITE, flags), - cancellable, error)) - return glnx_prefix_error (error, "Copying %s", dent->d_name); + if (S_ISLNK (child_stbuf.st_mode) || S_ISREG (child_stbuf.st_mode)) + { + if (!glnx_file_copy_at (src_dfd_iter.fd, dent->d_name, &child_stbuf, dest_dfd, + dent->d_name, + sysroot_flags_to_copy_flags (GLNX_FILE_COPY_OVERWRITE, flags), + cancellable, error)) + return glnx_prefix_error (error, "Copying %s", dent->d_name); + } + else + { + ot_journal_print (LOG_INFO, + "Ignoring non-regular/non-symlink file found during /etc merge: %s", + dent->d_name); + } } }