deploy: Ignore sockets, fifos in /etc/<subdir> 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 <yummypeng@linux.alibaba.com>
This commit is contained in:
Yuanhong Peng 2024-01-22 18:03:55 +08:00
parent d1d8f4ab40
commit eb1e9cf768

View File

@ -322,6 +322,8 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name,
return FALSE;
}
else
{
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,
@ -329,6 +331,13 @@ copy_dir_recurse (int src_parent_dfd, int dest_parent_dfd, const char *name,
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);
}
}
}
return TRUE;