From 3b359a7b3db88d4dea9177d3724cddc2aee08a9b Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 23 Mar 2025 13:53:48 +0000 Subject: [PATCH] jail: Use the PTY only for interactive sessions Signed-off-by: Michael Tremer --- src/pakfire/jail.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pakfire/jail.c b/src/pakfire/jail.c index 2540ae50..339dcc67 100644 --- a/src/pakfire/jail.c +++ b/src/pakfire/jail.c @@ -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 { -- 2.39.5