diff --git a/HISTORY b/HISTORY index 72f97337..725b848a 100644 --- a/HISTORY +++ b/HISTORY @@ -2,6 +2,8 @@ repmgr: ensure BDR2-specific functionality cannot be used on BDR3 and later (Ian) repmgr: improve --dry-run behaviour in barman mode (Ian) + repmgr: fix data directory permissions issue in barman mode where + an existing directory is being overwritten (Ian) 4.3 2019-04-02 repmgr: add "daemon (start|stop)" command; GitHub #528 (Ian) diff --git a/dirutil.c b/dirutil.c index 356c1a55..be199288 100644 --- a/dirutil.c +++ b/dirutil.c @@ -336,6 +336,15 @@ create_pg_dir(const char *path, bool force) { log_notice(_("-F/--force provided - deleting existing data directory \"%s\""), path); nftw(path, unlink_dir_callback, 64, FTW_DEPTH | FTW_PHYS); + + /* recreate the directory ourselves to ensure permissions are correct */ + if (!create_dir(path)) + { + log_error(_("unable to create directory \"%s\"..."), + path); + return false; + } + return true; } @@ -347,6 +356,15 @@ create_pg_dir(const char *path, bool force) { log_notice(_("deleting existing directory \"%s\""), path); nftw(path, unlink_dir_callback, 64, FTW_DEPTH | FTW_PHYS); + + /* recreate the directory ourselves to ensure permissions are correct */ + if (!create_dir(path)) + { + log_error(_("unable to create directory \"%s\"..."), + path); + return false; + } + return true; } return false; diff --git a/doc/appendix-release-notes.sgml b/doc/appendix-release-notes.sgml index 95d118e6..f12b5862 100644 --- a/doc/appendix-release-notes.sgml +++ b/doc/appendix-release-notes.sgml @@ -46,6 +46,14 @@ + + + &repmgr;: when executing repmgr standby clone + in mode, ensure provision of the option + does not result in an existing data directory being modified in any way. + + +