aboutsummaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/exec.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-05-16 11:01:29 -0400
committerBruce Momjian <bruce@momjian.us>2011-05-16 11:01:29 -0400
commitbda27e502fe9a3e9c54f065e4bc1315c3f2a57d7 (patch)
tree933a9a7b168654a170e7240e961e15e6a583f3d4 /contrib/pg_upgrade/exec.c
parent6c19bd96bc5139fabace94c5a0a5624fd9d8e986 (diff)
downloadpostgresql-bda27e502fe9a3e9c54f065e4bc1315c3f2a57d7.tar.gz
postgresql-bda27e502fe9a3e9c54f065e4bc1315c3f2a57d7.zip
Add pg_upgrade check to make sure the user has full access permission in
the current directory; if not, throw an error.
Diffstat (limited to 'contrib/pg_upgrade/exec.c')
-rw-r--r--contrib/pg_upgrade/exec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
index 71e84394e67..a66aeb03499 100644
--- a/contrib/pg_upgrade/exec.c
+++ b/contrib/pg_upgrade/exec.c
@@ -93,6 +93,11 @@ is_server_running(const char *datadir)
void
verify_directories(void)
{
+
+ if (access(".", R_OK | W_OK | X_OK) != 0)
+ pg_log(PG_FATAL,
+ "You must have full access permissions in the current directory.\n");
+
prep_status("Checking old data directory (%s)", old_cluster.pgdata);
check_data_dir(old_cluster.pgdata);
check_ok();