Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Revert "Skip .DS_Store files in server side utils"
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 13 Feb 2024 13:09:24 +0000 (14:09 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Tue, 13 Feb 2024 13:09:24 +0000 (14:09 +0100)
This reverts commit d3fdfdcd1c7f1b714a9a85b893d2c5afc60bea91.
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 449b1bc8d512e4153b1f834d6c8840e430cc59fb..a22c8520c004b4fe33b580ec63499635e0cdbb38 100644 (file)
@@ -2835,7 +2835,7 @@ The commands accepted in replication mode are:
         <para>
          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 <filename>pg_tblspc</filename> are maintained.)
         </para>
        </listitem>
index a583ead1cd2ee182fbd253d309cfafef84a3b9f2..c5cfa87d35e7912eb35f6b6f2883114a00f79f5a 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 be8b304512d8c3e448f3ce3bb3ab647673cd9e4f..cdfacf70888c5a1196525d0dd75e128643b5d715 100644 (file)
@@ -374,9 +374,8 @@ GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, b
       <filename>backup_label</filename>,
       <filename>tablespace_map</filename>,
       <filename>pg_internal.init</filename>,
-      <filename>postmaster.opts</filename>,
-      <filename>postmaster.pid</filename> and
-      <filename>.DS_Store</filename> as well as any file or directory
+      <filename>postmaster.opts</filename>, and
+      <filename>postmaster.pid</filename>, as well as any file or directory
       beginning with <filename>pgsql_tmp</filename>, are omitted.
      </para>
     </step>
index 203a1387d456e22fc53054a3aff0f9e7d0e44cb5..dcdbc1cd999f09010dfd1c5868412c9de7e6d4f8 100644 (file)
@@ -1262,10 +1262,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 013cf8ce46da88b6d0675335b14e86cfd117e847..09c540060a4db40956a2694a01de4d969918805b 100644 (file)
@@ -73,16 +73,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.
@@ -151,12 +141,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 9a15b339b7450983e27a285a99bc5ba470f9f3ea..52e873159d161ec545f765bed8046f61fe2af073 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 c018a0facd9c00aab3f39f2971de3a43974369c1..29a1a2a9cb68eeb0459f5e1807586af648455d3a 100644 (file)
@@ -3,7 +3,6 @@
 
 use strict;
 use warnings;
-use Config;
 use PostgresNode;
 use TestLib;
 use Test::More tests => 63;
@@ -111,12 +110,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 f818afa3ed6b7b56c56c25f71018c08fb1769c07..fbb97b5cf1ac2ffd999a46c529e89d882ce041b9 100644 (file)
@@ -749,10 +749,6 @@ 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
index 42c2b672b519428377f45a400a48c6de42b35c36..aa4472750a87a18e069053262daf5630e7498947 100644 (file)
@@ -2,7 +2,6 @@
 
 use strict;
 use warnings;
-use Config;
 use TestLib;
 use Test::More tests => 5;
 
@@ -45,10 +44,6 @@ sub run_test
    append_to_file
      "$test_standby_datadir/tst_standby_dir/standby_subdir/standby_file3",
      "in standby3";
-   # 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_master_datadir/tst_master_dir";
    append_to_file "$test_master_datadir/tst_master_dir/master_file1",