[systemd-devel] [PATCH v2] localed: validate set-x11-keymap input

Lennart Poettering lennart at poettering.net
Mon Dec 1 17:09:16 PST 2014

On Mon, 24.11.14 15:21, David Herrmann (dh.herrmann at gmail.com) wrote:

> I now pushed something to -git, see:
>     commit d4f5a1f47dbd04f26f2ddf951c97c4cb0ebbbe62
>     Author: David Herrmann <dh.herrmann at gmail.com>
>     Date:   Mon Nov 24 15:12:42 2014 +0100
>         localed: validate xkb keymaps
> I think duplicating the xkb-parsers is something we should avoid. Ran
> Benita was even working on a v2 format to drop all the legacy bits
> no-one uses in the old, crufty xkb format. I dislike having a fixed
> parser in systemd. Sure, our --list-layouts option needs to do this,
> but maybe we can drop that some day, too.
> I pushed a fix to test-compile keymaps on set-x11-keymap calls. So
> far, I only print a warning if it fails. Please feel free to post
> patches to extend this. For instance, I think we might want to do that
> in localectl (maybe even forward the xkb-logs then) and fail hard if
> the compilation fails (even though I dislike --force options..).

Wouldn't it make sense to refuse keymaps we cannot compile from the
localed side? I kinda prefer doing the validity checks on the server
side. Doing enumeration (which is primarily relevant fo cmdline
completion) on the client side is OK, but validity checking should
really be done on the server side.

I think it would be great if we'd generate a simply nice error message
if the compile test failed (just some error "Keyboard map could not be
compiled, refusing." or so).


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list