lib: change xbps_dbg_printf to not require xbps_handle
This allows to simplify a lot of code by not having to pass around the xbps handle everywhere just to print some debug information.
This commit is contained in:
4
lib/external/fexec.c
vendored
4
lib/external/fexec.c
vendored
@@ -58,12 +58,12 @@ pfcexec(struct xbps_handle *xhp, const char *file, const char **argv)
|
||||
if (strcmp(xhp->rootdir, "/")) {
|
||||
if ((geteuid() == 0) && (access("bin/sh", X_OK) == 0)) {
|
||||
if (chroot(xhp->rootdir) == -1) {
|
||||
xbps_dbg_printf(xhp, "%s: chroot() "
|
||||
xbps_dbg_printf("%s: chroot() "
|
||||
"failed: %s\n", *argv, strerror(errno));
|
||||
_exit(errno);
|
||||
}
|
||||
if (chdir("/") == -1) {
|
||||
xbps_dbg_printf(xhp, "%s: chdir() "
|
||||
xbps_dbg_printf("%s: chdir() "
|
||||
"failed: %s\n", *argv, strerror(errno));
|
||||
_exit(errno);
|
||||
}
|
||||
|
Reference in New Issue
Block a user