xbps_file_chdir_exec: check if /bin/sh is executable rather than readable.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20090825040429-7fbwxo2fao20w28n
This commit is contained in:
Juan RP 2009-08-25 06:04:29 +02:00
parent 10531d7d45
commit fd5afa2efb

View File

@ -60,7 +60,7 @@ pfcexec(const char *path, const char *file, const char **argv)
* destdir and exec the command. Otherwise
* just change CWD to destdir.
*/
if (getuid() == 0 && access("./bin/sh", R_OK) == 0) {
if (getuid() == 0 && access("./bin/sh", X_OK) == 0) {
if (chroot(path) == -1)
_exit(127);
if (chdir("/") == -1)