diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
new file mode 100644
index 71e8439..a66aeb0
*** a/contrib/pg_upgrade/exec.c
--- b/contrib/pg_upgrade/exec.c
*************** is_server_running(const char *datadir)
*** 93,98 ****
--- 93,103 ----
  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();
