summaryrefslogtreecommitdiff
path: root/src/locale/localed.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-11-25 10:26:08 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2014-11-25 10:26:08 +0100
commit8623d3a3b2e3463fa6e4ded734323483540c3ed4 (patch)
tree62f274d470eec72666475558edd953ddbf060a94 /src/locale/localed.c
parent2f0dd5164d36956197b9e649a100d5cfe08bb247 (diff)
localed: verify xkb keymaps after pk-queries
Make sure not to run xkb-keymap validation twice if pk-queries are used. Move it below pk-checks.
Diffstat (limited to 'src/locale/localed.c')
-rw-r--r--src/locale/localed.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 4e56382f4f..7fe73247d4 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -1087,17 +1087,17 @@ static int method_set_x11_keyboard(sd_bus *bus, sd_bus_message *m, void *userdat
(options && !string_is_safe(options)))
return sd_bus_error_set_errnof(error, -EINVAL, "Received invalid keyboard data");
- r = verify_xkb_rmlvo(model, layout, variant, options);
- if (r < 0)
- log_warning("Cannot compile XKB keymap for new x11 keyboard layout ('%s' / '%s' / '%s' / '%s'): %s",
- strempty(model), strempty(layout), strempty(variant), strempty(options), strerror(-r));
-
r = bus_verify_polkit_async(m, CAP_SYS_ADMIN, "org.freedesktop.locale1.set-keyboard", interactive, &c->polkit_registry, error);
if (r < 0)
return r;
if (r == 0)
return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */
+ r = verify_xkb_rmlvo(model, layout, variant, options);
+ if (r < 0)
+ log_warning("Cannot compile XKB keymap for new x11 keyboard layout ('%s' / '%s' / '%s' / '%s'): %s",
+ strempty(model), strempty(layout), strempty(variant), strempty(options), strerror(-r));
+
if (free_and_strdup(&c->x11_layout, layout) < 0 ||
free_and_strdup(&c->x11_model, model) < 0 ||
free_and_strdup(&c->x11_variant, variant) < 0 ||