chiark / gitweb /
bus: parse owner uid from cgroup path, too
[elogind.git] / src / locale / localectl.c
index 5328ac41a5b704d289d40da338d5a81d35307602..ea9187ff840a1dee493c6156f4e9cee3d9c9a1d6 100644 (file)
@@ -37,6 +37,7 @@
 #include "pager.h"
 #include "set.h"
 #include "path-util.h"
+#include "utf8.h"
 
 static bool arg_no_pager = false;
 static enum transport {
@@ -359,6 +360,9 @@ static int add_locales_from_archive(Set *locales) {
                 if (e[i].locrec_offset == 0)
                         continue;
 
+                if (!utf8_is_valid((char*) p + e[i].name_offset))
+                        continue;
+
                 z = strdup((char*) p + e[i].name_offset);
                 if (!z) {
                         r = log_oom();
@@ -383,7 +387,7 @@ static int add_locales_from_archive(Set *locales) {
 }
 
 static int add_locales_from_libdir (Set *locales) {
-        DIR _cleanup_closedir_ *dir;
+        _cleanup_closedir_ DIR *dir;
         struct dirent *entry;
         int r;
 
@@ -535,7 +539,7 @@ static int nftw_cb(
 }
 
 static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
-        char _cleanup_strv_free_ **l = NULL;
+        _cleanup_strv_free_ char **l = NULL;
 
         keymaps = set_new(string_hash_func, string_compare_func);
         if (!keymaps)
@@ -607,7 +611,7 @@ static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) {
 
 static int list_x11_keymaps(DBusConnection *bus, char **args, unsigned n) {
         _cleanup_fclose_ FILE *f = NULL;
-        char _cleanup_strv_free_ **list = NULL;
+        _cleanup_strv_free_ char **list = NULL;
         char line[LINE_MAX];
         enum {
                 NONE,
@@ -623,7 +627,7 @@ static int list_x11_keymaps(DBusConnection *bus, char **args, unsigned n) {
                 return -EINVAL;
         }
 
-        f = fopen("/usr/share/X11/xkb/rules/xorg.lst", "re");
+        f = fopen("/usr/share/X11/xkb/rules/base.lst", "re");
         if (!f) {
                 log_error("Failed to open keyboard mapping list. %m");
                 return -errno;