1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

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 <markguertin@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tobias Bussmann <t.bussmann@gmx.net>
Discussion: https://postgr.es/m/E258CE50-AB0E-455D-8AAD-BB4FE8F882FB@gmail.com
Backpatch-through: v12
This commit is contained in:
Daniel Gustafsson
2024-02-13 13:47:12 +01:00
parent 26c89d1054
commit 29f0052380
9 changed files with 47 additions and 4 deletions

View File

@@ -647,6 +647,10 @@ decide_file_action(file_entry_t *entry)
if (strcmp(path, "global/pg_control") == 0)
return FILE_ACTION_NONE;
/* Skip macOS system files */
if (strstr(path, ".DS_Store") != NULL)
return FILE_ACTION_NONE;
/*
* Remove all files matching the exclusion filters in the target.
*/