Created attachment 671148 [details] screenshot after reboot Description of problem: The input validation of 'localectl' is either weak or very weak, it just blindly trust what one says, even if one makes an absurd configuration like the one i performed below. It should check that the files supporting what one enters are there and if not, print an error. Version-Release number of selected component (if applicable): systemd.x86_64 195-10.fc18 How reproducible: always Steps to Reproduce: Set the locale to KLINGON / KLINGON using UTF "128" # localectl set-locale LANG=kl.KL.UTF-128 # localectl System Locale: LANG=kl_KL.UTF-128 VC Keymap: es X11 Layout: n/a No errors whatsoever, nice, i do have Klingon support! No, let's use a romulan keyboard! why not? # localectl set-keymap romulan # localectl System Locale: LANG=kl_KL.UTF-128 VC Keymap: romulan X11 Layout: n/a It is becoment interesting, let's and a borg X11 Layout! # localectl set-x11-keymap borg # localectl System Locale: LANG=kl_KL.UTF-128 VC Keymap: romulan X11 Layout: borg Actual results: localectl silently accept the junk values. after reboot there will be errors because it will not find what it believes it had configured. Expected results: A improved input validation, since it is an application. Additional info:
Well, the locale system works so that the "closest" locale is usec, even if the locale itself is not found. As the locale is frequently included in web browser HTTP headers its actually a good idea leaving locales set whose definition does not exist locally. So I am pretty sure we should not make such a limitation for locales. It's a privileged operation anyway... The keymap configuration is a different thing though. It can agree that validating the selected map against what is available makes sense.
As this is an RFE, setting to rawhide/FutureFeature. This is still valid: [root@adam adamw]# localectl set-keymap sdgnaihjhga [root@adam adamw]# localectl System Locale: LANG=en_US.utf8 LC_NUMERIC=en_CA.utf8 LC_TIME=en_CA.utf8 LC_MONETARY=en_CA.utf8 LC_MEASUREMENT=en_CA.utf8 VC Keymap: sdgnaihjhga X11 Layout: us X11 Model: pc105+inet X11 Options: terminate:ctrl_alt_bksp
Checking was implemented in http://cgit.freedesktop.org/systemd/systemd/commit/?id=d4f5a1f47d. This is part of systemd-218, in F22+. We currently do not refuse, only warn. This might be changed.