]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
jail: Ignore any return codes from the shell
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 Aug 2023 03:37:52 +0000 (03:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 31 Aug 2023 03:37:52 +0000 (03:37 +0000)
Fixes: #13003 - Python exception when exiting the build jail or requested shell
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index b1f71c77ba4167f07494312308c3ddd641abfbdd..c08624251af8519fbf6d8fa805c96e28554c54c8 100644 (file)
@@ -2146,12 +2146,21 @@ ERROR:
 }
 
 int pakfire_jail_shell(struct pakfire_jail* jail) {
+       int r;
+
        const char* argv[] = {
                "/bin/bash", "--login", NULL,
        };
 
        // Execute /bin/bash
-       return pakfire_jail_exec_interactive(jail, argv, 0);
+       r = pakfire_jail_exec_interactive(jail, argv, 0);
+
+       // Raise any errors
+       if (r < 0)
+               return r;
+
+       // Ignore any return codes from the shell
+       return 0;
 }
 
 static int pakfire_jail_run_if_possible(struct pakfire* pakfire, const char** argv) {