Bug 64973

Summary: localectl should verify all keymap parameters more accurately (for example not allow newlines)
Product: systemd Reporter: Alexandre Minoshi <minoshi>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: major    
Priority: medium CC: zbyszek
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Alexandre Minoshi 2013-05-25 01:44:12 UTC
localectl not return errors if executed command have errors in [options]

For example next command not returned errors
=================
localectl set-x11-keymap ru,us pc104 cyrillic "grp:ctrl_shift_toggle terminate:ctrl_alt_bksp"
=================
But there error! Must be:
================
localectl set-x11-keymap ru,us pc104 cyrillic "grp:ctrl_shift_toggle,terminate:ctrl_alt_bksp"
================


Alexandre Minoshi
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-05-29 19:24:32 UTC
I can confirm that we will write strings with whitespace, which are then silently ignored by X. The syntax for the option string doesn't seem to be explictly documented anywhere though. I guess we might want to simply reject options with whitespace, which would probably catch many simple errors.

A more ambitious option would be to try to actually verify the option string. In principle 'localectl list-x11-keymap-options' lists the options and we could split at commas and verify that the options are in that list... I have no idea how robust this check would be, i.e. how often X would actually accept options not on this list. I'm not sure if we want to open this can of worms.
Comment 2 Lennart Poettering 2014-06-25 10:48:32 UTC
*** Bug 74108 has been marked as a duplicate of this bug. ***
Comment 3 Zbigniew Jedrzejewski-Szmek 2015-01-06 05:48:08 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=d4f5a1f47d.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.