]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: generate OSC context sequence in run0/system-run
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Nov 2024 11:46:50 +0000 (12:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Feb 2025 14:09:25 +0000 (15:09 +0100)
src/run/run.c

index 8d1606af07c8f30ac208ab6f2d59497aab89ca1c..b2d74f608896fb27b6352b0755c109cd83e93760 100644 (file)
@@ -31,6 +31,7 @@
 #include "fs-util.h"
 #include "hostname-util.h"
 #include "main-func.h"
+#include "osc-context.h"
 #include "parse-argument.h"
 #include "parse-util.h"
 #include "path-util.h"
@@ -2194,7 +2195,14 @@ static int start_transient_service(sd_bus *bus) {
                 if (!c.bus_path)
                         return log_oom();
 
+                _cleanup_(osc_context_closep) sd_id128_t osc_context_id = SD_ID128_NULL;
                 if (pty_fd >= 0) {
+                        if (!terminal_is_dumb() && arg_exec_user) {
+                                r = osc_context_open_chpriv(arg_exec_user, /* ret_seq= */ NULL, &osc_context_id);
+                                if (r < 0)
+                                        return r;
+                        }
+
                         (void) sd_event_set_signal_exit(c.event, true);
 
                         if (!arg_quiet)