Revert "Skip .DS_Store files in server side utils"
authorDaniel Gustafsson
Tue, 13 Feb 2024 13:09:52 +0000 (14:09 +0100)
committerDaniel Gustafsson
Tue, 13 Feb 2024 13:09:52 +0000 (14:09 +0100)
This reverts commit aeee173d229232f94acc61e7bfe81d40f56e478e.
Per failure reports from the buildfarm.

doc/src/sgml/protocol.sgml
doc/src/sgml/ref/pg_basebackup.sgml
doc/src/sgml/ref/pg_rewind.sgml
src/backend/replication/basebackup.c
src/bin/pg_basebackup/t/010_pg_basebackup.pl
src/bin/pg_checksums/pg_checksums.c
src/bin/pg_checksums/t/002_actions.pl
src/bin/pg_rewind/filemap.c
src/bin/pg_rewind/t/003_extrafiles.pl

index ba605059fc21cfe2fe31ecc236a8f2c42df85102..a23a1033632d96779f23ced350e0664e5aa8f7e8 100644 (file)
@@ -2842,7 +2842,7 @@ The commands accepted in replication mode are:
         
          Files other than regular files and directories, such as symbolic
          links (other than for the directories listed above) and special
-         device and operating system files, are skipped.  (Symbolic links
+         device files, are skipped.  (Symbolic links
          in pg_tblspc are maintained.)
         
        
index e1d24f805ede5d01a6afe8e3dfc8d9cfc0c3e831..9e6807b4574d0327e4a090de39c1d7742ab4717f 100644 (file)
@@ -832,8 +832,7 @@ PostgreSQL documentation
    The backup will include all files in the data directory and tablespaces,
    including the configuration files and any additional files placed in the
    directory by third parties, except certain temporary files managed by
-   PostgreSQL and operating system files.  But only regular files and
-   directories are copied, except that
+   PostgreSQL.  But only regular files and directories are copied, except that
    symbolic links used for tablespaces are preserved.  Symbolic links pointing
    to certain directories known to PostgreSQL are copied as empty directories.
    Other symbolic links and special device files are skipped.
index 2f431302495620deb0a0ab85ee129879c62592f8..47c5549230187603b3263ce43878b00e19048de4 100644 (file)
@@ -374,9 +374,8 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
       backup_label,
       tablespace_map,
       pg_internal.init,
-      postmaster.opts,
-      postmaster.pid and
-      .DS_Store as well as any file or directory
+      postmaster.opts, and
+      postmaster.pid, as well as any file or directory
       beginning with pgsql_tmp, are omitted.
      
     
index 7ed82a76ff89d7ec40328f3c225ed6d748640ff5..d142cc213191a310710dbdd283696f85303f6990 100644 (file)
@@ -1272,10 +1272,6 @@ sendDir(const char *path, int basepathlen, bool sizeonly, List *tablespaces,
                    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
index 43d18fe4ccf53ddeb590167c3f624edf1b4c09d0..e23ac607aae0c9f99bb26c83f1f94231fbac3602 100644 (file)
@@ -76,16 +76,6 @@ foreach my $filename (
    close $file;
 }
 
-# Test that macOS system files are skipped. Only test on non-macOS systems
-# however since creating incorrect .DS_Store files on a macOS system may have
-# unintended side effects.
-if ($Config{osname} ne 'darwin')
-{
-   open my $file, '>>', "$pgdata/.DS_Store";
-   print $file "DONOTCOPY";
-   close $file;
-}
-
 # Connect to a database to create global/pg_internal.init.  If this is removed
 # the test to ensure global/pg_internal.init is not copied will return a false
 # positive.
@@ -154,12 +144,6 @@ foreach my $filename (
    ok(!-f "$tempdir/backup/$filename", "$filename not copied");
 }
 
-# We only test .DS_Store files being skipped on non-macOS systems
-if ($Config{osname} ne 'darwin')
-{
-   ok(!-f "$tempdir/backup/.DS_Store", ".DS_Store not copied");
-}
-
 # Unlogged relation forks other than init should not be copied
 ok(-f "$tempdir/backup/${baseUnloggedPath}_init",
    'unlogged init fork in backup');
index b97d0f32903d68653c69f8a64950be6efe2a7a8e..831cf42d3ad19fcca76cdd4454f5bc98520f0f6a 100644 (file)
@@ -338,10 +338,6 @@ scan_directory(const char *basedir, const char *subdir, bool sizeonly)
                    strlen(PG_TEMP_FILES_DIR)) == 0)
            continue;
 
-       /* Skip macOS system files */
-       if (strcmp(de->d_name, ".DS_Store") == 0)
-           continue;
-
        snprintf(fn, sizeof(fn), "%s/%s", path, de->d_name);
        if (lstat(fn, &st) < 0)
        {
index a8ced3b4bed7dccf1e5d4e59adb3ad3edf4a69dd..761f7ab53b62e06f3e0e84dbb40db44f0498c855 100644 (file)
@@ -6,7 +6,6 @@
 
 use strict;
 use warnings;
-use Config;
 use PostgresNode;
 use TestLib;
 
@@ -115,12 +114,6 @@ append_to_file "$pgdata/global/pgsql_tmp/1.1",        "foo";
 append_to_file "$pgdata/global/pg_internal.init",     "foo";
 append_to_file "$pgdata/global/pg_internal.init.123", "foo";
 
-# These are non-postgres macOS files, which should be ignored by the scan.
-# Only perform this test on non-macOS systems though as creating incorrect
-# system files may have side effects on macOS.
-append_to_file "$pgdata/global/.DS_Store", "foo"
-   unless ($Config{osname} eq 'darwin');
-
 # Enable checksums.
 command_ok([ 'pg_checksums', '--enable', '--no-sync', '-D', $pgdata ],
    "checksums successfully enabled in cluster");
index f3ce4f6828892507d559f13e4a1f2fae65a0b1fd..2618b4c957b2f526f2fb81fc86bbe321ff9f6f1c 100644 (file)
@@ -648,10 +648,6 @@ 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.
     */
index be60ecaaee4d6323091f66736c4c5c3c2d9e6c2f..baea3836b6f13c0a65f291c03c2461b94db64691 100644 (file)
@@ -5,7 +5,6 @@
 
 use strict;
 use warnings;
-use Config;
 use TestLib;
 use Test::More tests => 5;
 
@@ -54,10 +53,6 @@ sub run_test
    append_to_file
      "$test_standby_datadir/tst_standby_dir/standby_subdir/standby_file4",
      "in standby4";
-   # Skip testing .DS_Store files on macOS to avoid risk of side effects
-   append_to_file
-     "$test_standby_datadir/tst_standby_dir/.DS_Store",
-     "macOS system file" unless ($Config{osname} eq 'darwin');
 
    mkdir "$test_primary_datadir/tst_primary_dir";
    append_to_file "$test_primary_datadir/tst_primary_dir/primary_file1",