Simplify validate_exec() by using access(2) to check file permissions, rather than trying to implement the equivalent logic by hand.  The motivation for the original coding appears to have been to check with the effective uid's permissions not the real uid's; but there is no longer any difference, because we don't run the postmaster setuid (indeed, main.c enforces that they're the same).  Using access() means we will get it right in situations the original coding failed to handle, such as ACL-based permissions.  Besides it's a lot shorter, cleaner, and more thread-safe.  Per bug #5275 from James Bellinger.
Simplify validate_exec() by using access(2) to check file permissions,
rather than trying to implement the equivalent logic by hand.  The motivation
for the original coding appears to have been to check with the effective uid's
permissions not the real uid's; but there is no longer any difference, because
we don't run the postmaster setuid (indeed, main.c enforces that they're the
same).  Using access() means we will get it right in situations the original
coding failed to handle, such as ACL-based permissions.  Besides it's a lot
shorter, cleaner, and more thread-safe.  Per bug #5275 from James Bellinger.

50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,ovr/postgres-xl,pavanvd/postgres-xl,ashwinstar/gpdb,pavanvd/postgres-xl,xinzweb/gpdb,postmind-net/postgres-xl,tpostgres-projects/tPostgres,zeroae/postgres-xl,tpostgres-projects/tPostgres,adam8157/gpdb,postmind-net/postgres-xl,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,kmjungersen/PostgresXL,lisakowen/gpdb,oberstet/postgres-xl,adam8157/gpdb,postmind-net/postgres-xl,yazun/postgres-xl,greenplum-db/gpdb,lisakowen/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,jmcatamney/gpdb,jmcatamney/gpdb,arcivanov/postgres-xl,snaga/postgres-xl,jmcatamney/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,jmcatamney/gpdb,zeroae/postgres-xl,techdragon/Postgres-XL,yazun/postgres-xl,ashwinstar/gpdb,ovr/postgres-xl,50wu/gpdb,jmcatamney/gpdb,lisakowen/gpdb,oberstet/postgres-xl,kmjungersen/PostgresXL,kmjungersen/PostgresXL,postmind-net/postgres-xl,ovr/postgres-xl,greenplum-db/gpdb,lisakowen/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,tpostgres-projects/tPostgres,lisakowen/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,50wu/gpdb,ashwinstar/gpdb,kmjungersen/PostgresXL,xinzweb/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,techdragon/Postgres-XL,greenplum-db/gpdb,Postgres-XL/Postgres-XL,adam8157/gpdb,yazun/postgres-xl,xinzweb/gpdb,50wu/gpdb,arcivanov/postgres-xl,postmind-net/postgres-xl,adam8157/gpdb,adam8157/gpdb,ovr/postgres-xl,snaga/postgres-xl,lisakowen/gpdb,adam8157/gpdb,kmjungersen/PostgresXL,techdragon/Postgres-XL,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,oberstet/postgres-xl,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,50wu/gpdb,snaga/postgres-xl,adam8157/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,arcivanov/postgres-xl,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,Postgres-XL/Postgres-XL,zeroae/postgres-xl,oberstet/postgres-xl,yazun/postgres-xl,adam8157/gpdb,50wu/gpdb,snaga/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,jmcatamney/gpdb,pavanvd/postgres-xl,zeroae/postgres-xl,xinzweb/gpdb,arcivanov/postgres-xl,greenplum-db/gpdb,zeroae/postgres-xl,snaga/postgres-xl,tpostgres-projects/tPostgres,ashwinstar/gpdb,tpostgres-projects/tPostgres,pavanvd/postgres-xl,50wu/gpdb,yazun/postgres-xl