From fd5afa2efbc40bc8d41a9409f28b8c088869e563 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 25 Aug 2009 06:04:29 +0200 Subject: [PATCH] xbps_file_chdir_exec: check if /bin/sh is executable rather than readable. --HG-- extra : convert_revision : xtraeme%40gmail.com-20090825040429-7fbwxo2fao20w28n --- lib/fexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fexec.c b/lib/fexec.c index a6f8469e..ed47a6b0 100644 --- a/lib/fexec.c +++ b/lib/fexec.c @@ -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)