From: Chris Lindee Date: Mon, 16 Feb 2026 06:08:31 +0000 (-0600) Subject: profile/systemd-osc-context: Enforce length limits X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d738a0aeee0df0e9d6c001db1aeac52f65c2190;p=thirdparty%2Fsystemd.git profile/systemd-osc-context: Enforce length limits UAPI.15 limits the length of fields; adhere to them. References: [0] https://uapi-group.org/specifications/specs/osc_context/#syntax-in-abnf --- diff --git a/profile.d/80-systemd-osc-context.sh b/profile.d/80-systemd-osc-context.sh index 537facdf1a9..7d4b9a77f1b 100644 --- a/profile.d/80-systemd-osc-context.sh +++ b/profile.d/80-systemd-osc-context.sh @@ -33,9 +33,9 @@ __systemd_osc_context_escape() { __systemd_osc_context_common() { if [ -f /etc/machine-id ]; then - printf ";machineid=%s" "$(&-); then - printf "\033]3008;end=%s;exit=failure;status=%s;signal=SIG%s\033\\" "$systemd_osc_context_cmd_id" "$systemd_exitstatus" "$systemd_signal" + printf "\033]3008;end=%.64s;exit=failure;status=%d;signal=SIG%s\033\\" "$systemd_osc_context_cmd_id" "$systemd_exitstatus" "$systemd_signal" elif [ "$systemd_exitstatus" -ne 0 ]; then - printf "\033]3008;end=%s;exit=failure;status=%s\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus)) + printf "\033]3008;end=%.64s;exit=failure;status=%d\033\\" "$systemd_osc_context_cmd_id" $((systemd_exitstatus)) else - printf "\033]3008;end=%s;exit=success\033\\" "$systemd_osc_context_cmd_id" + printf "\033]3008;end=%.64s;exit=success\033\\" "$systemd_osc_context_cmd_id" fi fi @@ -58,7 +58,7 @@ __systemd_osc_context_precmdline() { fi # Create or update the shell session - printf "\033]3008;start=%s%s;type=shell;cwd=%s\033\\" "$systemd_osc_context_shell_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")" + printf "\033]3008;start=%.64s%s;type=shell;cwd=%.255s\033\\" "$systemd_osc_context_shell_id" "$(__systemd_osc_context_common)" "$(__systemd_osc_context_escape "$PWD")" # Prepare cmd id for next command read -r systemd_osc_context_cmd_id