diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c index 5baea7535b..75b6af80cb 100644 --- a/src/backend/backup/basebackup.c +++ b/src/backend/backup/basebackup.c @@ -1202,6 +1202,10 @@ sendDir(bbsink *sink, const char *path, int basepathlen, bool sizeonly, strlen(PG_TEMP_FILE_PREFIX)) == 0) continue; + /* Skip hidden files */ + if (de->d_name[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 diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c index 19eb67e485..d3c16acf0d 100644 --- a/src/bin/pg_checksums/pg_checksums.c +++ b/src/bin/pg_checksums/pg_checksums.c @@ -337,6 +337,10 @@ scan_directory(const char *basedir, const char *subdir, bool sizeonly) strlen(PG_TEMP_FILES_DIR)) == 0) continue; + /* Skip hidden files */ + if (de->d_name[0] == '.') + continue; + snprintf(fn, sizeof(fn), "%s/%s", path, de->d_name); if (lstat(fn, &st) < 0) pg_fatal("could not stat file \"%s\": %m", fn);