diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2024-02-13 13:47:12 +0100 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2024-02-13 13:47:12 +0100 |
commit | d3fdfdcd1c7f1b714a9a85b893d2c5afc60bea91 (patch) | |
tree | 3aa364eeaff775e48f7150ecd06810e3623bf28f /src/bin/pg_rewind/filemap.c | |
parent | ceb224b62b9d66bdf8584b01c103268d3b90d577 (diff) |
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
Diffstat (limited to 'src/bin/pg_rewind/filemap.c')
-rw-r--r-- | src/bin/pg_rewind/filemap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c index fbb97b5cf1a..f818afa3ed6 100644 --- a/src/bin/pg_rewind/filemap.c +++ b/src/bin/pg_rewind/filemap.c @@ -749,6 +749,10 @@ isRelDataFile(const char *path) } } + /* Skip macOS system files */ + if (strstr(path, ".DS_Store") != NULL) + return FILE_ACTION_NONE; + /* * The sscanf tests above can match files that have extra characters at * the end. To eliminate such cases, cross-check that GetRelationPath |