Files
systemd/src/shared
Liu Zheng 0d92898e85 localed: normalize empty X11 option values to NULL after parsing
x11_read_data() parses an 'Option "XkbVariant" ""' line in
00-keyboard.conf with strv_split_full(..., EXTRACT_UNQUOTE), which turns
the empty quoted value into a non-NULL empty string rather than NULL.
Since 812aa57d2c ("string-util: beef up string_is_safe()") an empty
string is rejected by string_is_safe() unless STRING_ALLOW_EMPTY is
passed, so x11_context_is_safe() now refuses such a context and
x11_context_verify() discards the whole thing. As a result "localectl
status" reports "X11 Layout: (unset)" even though the file names a valid
layout, and compositors reading org.freedesktop.locale1 (e.g. the SDDM
greeter) fall back to the us layout.

Introduce x11_context_normalize(), suggested by @lionheartyu, which
converts empty strings to NULL while freeing the heap allocation —
unlike x11_context_empty_to_null() which only NULLs the pointer without
freeing. Call it at the end of x11_read_data(), before
x11_context_verify(), so empty option values are treated as unset. This
also keeps x11_context_equal() comparisons consistent with the setter
path (method_set_x11_keyboard) and vconsole_read_data(), which both
store NULL for empty values.

Fixes #43007
2026-07-28 11:53:11 +09:00
..
2026-07-18 04:56:32 +09:00
…
…
2026-07-18 04:56:32 +09:00
2026-07-15 12:12:40 +02:00
2026-07-15 12:12:40 +02:00
…
…
2026-07-15 12:12:40 +02:00
2026-05-25 12:37:36 +02:00
2026-07-18 04:56:32 +09:00
…
2026-07-18 04:56:32 +09:00
2025-11-25 17:34:48 +01:00
2025-12-15 08:50:13 +09:00
2026-07-16 19:21:48 +01:00
2025-12-15 08:50:13 +09:00
2026-07-18 04:56:32 +09:00
2026-07-20 16:23:04 +09:00
2026-07-01 14:36:45 +02:00
2026-05-18 21:42:56 +02:00
…
…