]> git.ipfire.org Git - pakfire.git/commitdiff
pty: Always enable forwarding
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Oct 2024 14:04:14 +0000 (14:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 6 Oct 2024 14:04:14 +0000 (14:04 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/pty.h
src/libpakfire/jail.c
src/libpakfire/pty.c

index 0a49965a20c3a49d2438fe1c1efedc52d3443a7b..9b705124437be5e703fca083fd230453749e0bcc 100644 (file)
 
 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);
 
index f8a1040f7d4c7b3f8cdc44bc19b20b338cd5e7ba..ec5d2ebcf06b745483e51ec29a3c076ac1a32c1e 100644 (file)
@@ -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.
index d00acc2f13194909db9d844a23e0f7ac689f32a2..c7b4bfb60b1166d085d931bd35c8a86859d15ce7 100644 (file)
@@ -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) {