From 29f00523808ac1d646cf51f9fe199e61ce5631e7 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Tue, 13 Feb 2024 13:47:12 +0100 Subject: Skip .DS_Store files in server side utils The macOS Finder application creates .DS_Store files in directories when opened, which creates problems for serverside utilities which expect all files to be PostgreSQL specific files. Skip these files when encountered in pg_checksums, pg_rewind and pg_basebackup. This was extracted from a larger patchset for skipping hidden files and system files, where the concencus was to just skip these. Since this is equally likely to happen in every version, backpatch to all supported versions. Reported-by: Mark Guertin Reviewed-by: Michael Paquier Reviewed-by: Tobias Bussmann Discussion: https://postgr.es/m/E258CE50-AB0E-455D-8AAD-BB4FE8F882FB@gmail.com Backpatch-through: v12 --- src/backend/backup/basebackup.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/backend/backup/basebackup.c') diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c index 078a3fe99c2..847a52f599b 100644 --- a/src/backend/backup/basebackup.c +++ b/src/backend/backup/basebackup.c @@ -1185,6 +1185,10 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly, strlen(PG_TEMP_FILE_PREFIX)) == 0) continue; + /* Skip macOS system files */ + if (strcmp(de->d_name, ".DS_Store") == 0) + continue; + /* * Check if the postmaster has signaled us to exit, and abort with an * error in that case. The error handler further up will call -- cgit v1.2.3