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:
parent
10531d7d45
commit
fd5afa2efb
@ -60,7 +60,7 @@ pfcexec(const char *path, const char *file, const char **argv)
|
|||||||
* destdir and exec the command. Otherwise
|
* destdir and exec the command. Otherwise
|
||||||
* just change CWD to destdir.
|
* 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)
|
if (chroot(path) == -1)
|
||||||
_exit(127);
|
_exit(127);
|
||||||
if (chdir("/") == -1)
|
if (chdir("/") == -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user