mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
Fix incorrect ordering of operations in pg_resetwal and pg_rewind.
Commitc37b3d08c
dropped its added GetDataDirectoryCreatePerm call into the wrong place in pg_resetwal.c, namely after the chdir to DataDir. That broke invocations using a relative path, as reported by Tushar Ahuja. We could have left it where it was and changed the argument to be ".", but that'd result in a rather confusing error message in event of a failure, so re-ordering seems like a better solution. Similarly reorder operations in pg_rewind.c. The issue there is that it doesn't seem like a good idea to do any actual operations before the not-root check (on Unix) or the restricted token acquisition (on Windows). I don't know that this is an actual bug, but I'm definitely not convinced that it isn't, either. Assorted other code review forc37b3d08c
andda9b580d8
: fix some misspelled or otherwise badly worded comments, put the #include for <sys/stat.h> where it actually belongs, etc. Discussion: https://postgr.es/m/aeb9c3a7-3c3f-a57f-1a18-c8d4fcdc2a1f@enterprisedb.com
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* File and directory permission constants
|
||||
* File and directory permission definitions
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef FILE_PERM_H
|
||||
#define FILE_PERM_H
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*
|
||||
* Mode mask for data directory permissions that only allows the owner to
|
||||
* read/write directories and files.
|
||||
|
Reference in New Issue
Block a user