Bug 64973 - localectl should verify all keymap parameters more accurately (for example not allow newlines)
Summary: localectl should verify all keymap parameters more accurately (for example no...
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium major
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
: 74108 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-25 01:44 UTC by Alexandre Minoshi
Modified: 2015-01-06 05:48 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.