From: Michael Tremer Date: Tue, 2 Aug 2022 18:09:46 +0000 (+0000) Subject: execute: Use pakfire_jail_run() to call ldconfig X-Git-Tag: 0.9.28~614 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e8cddde6122db3f8e1cabfbd6c777953134ca48;p=pakfire.git execute: Use pakfire_jail_run() to call ldconfig Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/execute.c b/src/libpakfire/execute.c index 34d7710e0..d6ca176aa 100644 --- a/src/libpakfire/execute.c +++ b/src/libpakfire/execute.c @@ -1015,13 +1015,17 @@ int pakfire_execute_ldconfig(struct pakfire* pakfire) { if (r < 0) return 1; - r = -1; - - if (access(path, X_OK) == 0) { - r = pakfire_execute_command(pakfire, LDCONFIG, NULL, 0, NULL, NULL); - - DEBUG(pakfire, "ldconfig returned %d\n", r); + // Check if ldconfig is executable + r = access(path, X_OK); + if (r) { + DEBUG(pakfire, "%s is not executable. Skipping...\n", LDCONFIG); + return 0; } - return r; + const char* argv[] = { + LDCONFIG, NULL, + }; + + // Run ldconfig + return pakfire_jail_run(pakfire, argv, 0); }