Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0381fef

Browse files
committed
Fix pg_rewind's handling of top-level symlinks.
The previous coding suffered a null-pointer dereference if it found anysymlink at the top level of $PGDATA. Fix that, and teach it to recurseinto a symlink for pg_xlog, but not anything else.Per note from Abhijit Menon-Sen.
1 parente5f1a4f commit0381fef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/bin/pg_rewind/copy_fetch.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ traverse_datadir(const char *datadir, process_file_callback_t callback)
4242

4343
/*
4444
* recursive part of traverse_datadir
45+
*
46+
* parent_path is the current subdirectory's path relative to datadir,
47+
* or NULL at the top level.
4548
*/
4649
staticvoid
4750
recurse_dir(constchar*datadir,constchar*parentpath,
@@ -127,9 +130,11 @@ recurse_dir(const char *datadir, const char *parentpath,
127130

128131
/*
129132
* If it's a symlink within pg_tblspc, we need to recurse into it,
130-
* to process all the tablespaces.
133+
* to process all the tablespaces. We also follow a symlink if
134+
* it's for pg_xlog. Symlinks elsewhere are ignored.
131135
*/
132-
if (strcmp(parentpath,"pg_tblspc")==0)
136+
if ((parentpath&&strcmp(parentpath,"pg_tblspc")==0)||
137+
strcmp(path,"pg_xlog")==0)
133138
recurse_dir(datadir,path,callback);
134139
#else
135140
pg_fatal("\"%s\" is a symbolic link, but symbolic links are not supported on this platform\n",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp