From: Michael Tremer Date: Sun, 6 Oct 2024 14:04:14 +0000 (+0000) Subject: pty: Always enable forwarding X-Git-Tag: 0.9.30~1135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56223f742dd32bd1c591c3e5ecd49792eb1af995;p=pakfire.git pty: Always enable forwarding Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/include/pakfire/pty.h b/src/libpakfire/include/pakfire/pty.h index 0a49965a2..9b7051244 100644 --- a/src/libpakfire/include/pakfire/pty.h +++ b/src/libpakfire/include/pakfire/pty.h @@ -29,10 +29,6 @@ struct pakfire_pty; -enum pakfire_pty_flags { - PAKFIRE_PTY_FORWARD = (1 << 0), -}; - int pakfire_pty_create(struct pakfire_pty** pty, struct pakfire_ctx* ctx, sd_event* loop, int flags); diff --git a/src/libpakfire/jail.c b/src/libpakfire/jail.c index f8a1040f7..ec5d2ebcf 100644 --- a/src/libpakfire/jail.c +++ b/src/libpakfire/jail.c @@ -1520,10 +1520,6 @@ PAKFIRE_EXPORT int pakfire_jail_exec(struct pakfire_jail* jail, const char* argv if (ctx.flags & PAKFIRE_JAIL_PTY_FORWARDING) ctx.flags |= PAKFIRE_JAIL_HAS_NETWORKING; - // Enable PTY forwarding - if (ctx.flags & PAKFIRE_JAIL_PTY_FORWARDING) - pty_flags |= PAKFIRE_PTY_FORWARD; - /* Setup a file descriptor which can be used to notify the client that the parent has completed configuration. diff --git a/src/libpakfire/pty.c b/src/libpakfire/pty.c index d00acc2f1..c7b4bfb60 100644 --- a/src/libpakfire/pty.c +++ b/src/libpakfire/pty.c @@ -632,14 +632,12 @@ static int pakfire_pty_setup(sd_event_source* source, int fd, uint32_t events, v // Set description sd_event_source_set_description(pty->master.event, "pty-master"); - // Do we need to set up PTY forwarding? - if (pty->flags & PAKFIRE_PTY_FORWARD) { - r = pakfire_pty_setup_forwarding(pty); - if (r) - return r; - } + // Setup forwarding + r = pakfire_pty_setup_forwarding(pty); + if (r < 0) + return r; - return r; + return 0; } static void pakfire_pty_free(struct pakfire_pty* pty) {