lib/external/fexec.c: add some parens so that expression is evaluated correctly.

This commit is contained in:
Juan RP 2013-03-07 20:15:16 +01:00
parent 5eddf04898
commit f5f6f50e27

View File

@ -52,7 +52,7 @@ pfcexec(struct xbps_handle *xhp, const char *file, const char **argv)
* change root directory and exec command.
*/
if (strcmp(xhp->rootdir, "/")) {
if (geteuid() == 0 && access("bin/sh", X_OK) == 0) {
if ((geteuid() == 0) && (access("bin/sh", X_OK) == 0)) {
if (chroot(xhp->rootdir) == -1) {
xbps_dbg_printf(xhp, "%s: chroot() "
"failed: %s\n", *argv, strerror(errno));