]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Use the PTY only for interactive sessions
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Mar 2025 13:53:48 +0000 (13:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Mar 2025 13:53:48 +0000 (13:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/jail.c

index 2540ae502ff9c963e73270d730559ff8d45e63a2..339dcc67dcf76877b170ee83d73aadb48a28620a 100644 (file)
@@ -1384,13 +1384,13 @@ static int __pakfire_jail_exec(struct pakfire_jail* jail,
                goto ERROR;
        }
 
-       // Setup the PTY
-       r = pakfire_pty_create(&ctx.pty, jail->ctx, ctx.loop);
-       if (r < 0)
-               goto ERROR;
-
        // Are we running in interactive mode?
        if (pakfire_jail_exec_has_flag(&ctx, PAKFIRE_JAIL_INTERACTIVE)) {
+               // Setup the PTY
+               r = pakfire_pty_create(&ctx.pty, jail->ctx, ctx.loop);
+               if (r < 0)
+                       goto ERROR;
+
                // Make the PTY interactive
                r = pakfire_pty_interactive(ctx.pty);
                if (r < 0)
@@ -1417,11 +1417,14 @@ static int __pakfire_jail_exec(struct pakfire_jail* jail,
 
        // Capture Output?
        } else if (output) {
+#warning This needs to be moved back internally again
+#if 0
                r = pakfire_pty_capture_output(ctx.pty, output, output_length);
                if (r < 0) {
                        ERROR(jail->ctx, "Failed to set up output capture: %s\n", strerror(-r));
                        goto ERROR;
                }
+#endif
 
        // Otherwise we dump everything to the console
        } else {