From: Mike Yuan Date: Sat, 7 Mar 2026 04:37:30 +0000 (+0100) Subject: sd-daemon: escape notification msg using shell_escape() X-Git-Tag: v261-rc4~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F40987%2Fhead;p=thirdparty%2Fsystemd.git sd-daemon: escape notification msg using shell_escape() Follow-up for f9e0a62392fa62364bb7ac31a1cd4a8cc521cced xescape() would unconditionally emit hex escapes, rendering \n unreadable. --- diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index da5242c3b79..50bdcb1a238 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -637,8 +637,8 @@ static int pid_notify_with_fds_internal( } if (DEBUG_LOGGING) { - _cleanup_free_ char *escaped = xescape_full(state, "\"", /* console_width = */ SIZE_MAX, XESCAPE_8_BIT); - log_debug("Notify message sent to '%s': \"%s\"", e, escaped ?: state); + _cleanup_free_ char *escaped = shell_escape(state, "\""); + log_debug("Notify message sent to '%s': \"%s\"", e, strnull(escaped)); } return 1;