summaryrefslogtreecommitdiff
path: root/src/locale
Commit message (Collapse)AuthorAge
* util: rework word parsing and c unescaping codeLennart Poettering2015-03-26
| | | | | | | | | | | When parsing words from input files, optionally automatically unescape the passed strings, controllable via a new flags parameter. Make use of this in tmpfiles, and port everything else over, too. This improves parsing quite a bit, since we no longer have to process the same string multiple times with different calls, where an earlier call might corrupt the input for a later call.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* language fallback: it_CH (Italian, Swiss) -> it_IT (Italian, Italy)Daniele Medri2015-02-09
|
* Add Silesian and Kashubian to language fallback mapPiotr Drąg2015-02-07
| | | | | | | Silesian and Kashubian speakers would prefer to fall back to Polish (pl) translations instead of English (C). https://bugs.freedesktop.org/show_bug.cgi?id=89021
* localed: add LANGUAGE= fallback when LANG= is specifiedZbigniew Jędrzejewski-Szmek2015-02-06
| | | | | | | | For the entries listed in the first column of language-fallback-map, the entry from the second column will be used for LANGUAGE=, if LANGUAGE= is not explicitly specified. https://bugzilla.redhat.com/show_bug.cgi?id=624158
* Add language fallback mapNaveen Kumar2015-02-06
| | | | | | | | This map will be used to provide a fallback for translations. For example, a Niederdeutsch (nds) speaker prefers to fall back to German (de) translations rather then the English (C) ones. https://bugzilla.redhat.com/show_bug.cgi?id=624158#c9
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* kbd-model-map: add more mappings for Slovak, Lithuanian, and KhmerMindaugas Baranauskas2015-01-22
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=88545
* tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering2014-12-28
|
* localed: remove spurious include of <sys/capability.h>Filipe Brandenburger2014-12-25
| | | | | | | It does not use any functions from libcap directly. The CAP_SYS_ADMIN constant in use by this file comes from <linux/capability.h> imported through "missing.h". Tested that "systemd-localed" builds cleanly and works after this change.
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* util: when using basename() for creating temporary files, verify the ↵Lennart Poettering2014-12-12
| | | | | | | | resulting name is actually valid Also, rename filename_is_safe() to filename_is_valid(), since it actually does a full validation for what the kernel will accept as file name, it's not just a heuristic.
* localectl,man: make it obvious that set-*-keymaps sets both keymapsZbigniew Jędrzejewski-Szmek2014-12-11
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=85411
* localed: log xkbcommon errorsJan Synacek2014-12-03
| | | | | | The errors are prefixed with "libxkbcommon" to provide some context, because they are quite confusing without it. With the prefix, we at least know where they come from.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
* treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt2014-11-28
|
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* localed: verify xkb keymaps after pk-queriesDavid Herrmann2014-11-25
| | | | | Make sure not to run xkb-keymap validation twice if pk-queries are used. Move it below pk-checks.
* localed: validate xkb keymapsDavid Herrmann2014-11-24
| | | | | | | | | | | Introduce a new optional dependency on libxkbcommon for systemd-localed. Whenever the x11 keymap settings are changed, use libxkbcommon to compile the keymap. If the compilation fails, print a warning so users will get notified. On compilation failure, we still update the keymap settings for now. This patch just introduces the xkbcommon infrastructure to have keymap validation in place. We can later decide if/how we want to enforce this.
* strv: rework strv_split_quoted() to use unquote_first_word()Lennart Poettering2014-11-10
| | | | This should make the unquoting scheme a bit less naive.
* localectl: fix localectl set-x11-keymap syntax descriptionJan Synacek2014-11-04
| | | | | | | | | | This complements the fix in: commit cd4c6fb12598435fe24431f1dd616f9582f0e3bd Author: Jan Synacek <jsynacek@redhat.com> Date: Mon Oct 20 12:43:39 2014 +0200 man: fix localectl set-x11-keymap syntax description
* mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho2014-10-23
|
* fi-latin1 console keymap is no moreMarko Myllynen2014-10-13
| | | | http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=commitdiff;h=a88711232f3216debbb02d0171187442863ccedb
* localectl: always print warnings with log_warning() instead of printf()Lennart Poettering2014-10-02
| | | | They really should got to stderr, not stdout.
* localectl: count locale variables from 0, instead of VARIABLE_LANGLennart Poettering2014-10-02
| | | | | That way the we make our code safe regarding reordering of the variables in the enum.
* localectl: print warning when there are options given on kernel cmdlineMichal Sekletar2014-09-25
|
* localed: rename write_data_x11 to x11_write_dataZbigniew Jędrzejewski-Szmek2014-09-23
| | | | | Other functions in this file follow this pattern, we have vconsole_write_data and locale_write_data.
* hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt2014-09-15
| | | | | | | | | It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
* localed: check for partially matching converted keymapsZbigniew Jędrzejewski-Szmek2014-09-03
| | | | | | | | | | | | | If a user specifies multiple X11 keymaps, with a (at least the first one) nonempty variant, and we don't match the whole combo, use a converted keymap which includes the variant in preference to the default, variantless, keymap. E.g.: We would convert X11 config "layout=fr variant=mac" to "fr-mac", but "layout=fr,us variant=mac," to "fr", because we don't have a converted keymap which would match "fr,us", and we don't have a legacy mapping for "fr,us". This is unexpected, and if we cannot match both, it is still better to match the primary mapping and use "fr-mac".
* localed: introduce helper function to simplify matchingZbigniew Jędrzejewski-Szmek2014-09-03
|
* localed: log locale/keymap changes in detailZbigniew Jędrzejewski-Szmek2014-09-03
| | | | | | | | | | | Converting X11 to legacy keymaps and back is a fucking mess. Let's make it at least possible to request detailed logs of what is being changed and why (LOG_DEBUG level). At LOG_INFO level, we would log the requested change of X11 or console keymap, but not the resulting change after conversion to console or X11. Make sure that every change of configuration on disk has a matching line in the logs.
* localed: remove free_and_copyZbigniew Jędrzejewski-Szmek2014-09-03
| | | | It was mostly a duplicate of free_and_strdup().
* localed: double free in error path and modernizationZbigniew Jędrzejewski-Szmek2014-09-03
| | | | | Very unlikely to trigger, but in principle strv_free could be called twice: once explictly, and once from cleanup.
* locale: fix sending PropertiesChanged for x11 keymap changedDavid Herrmann2014-08-28
| | | | | | The sd_bus_emit_properties_changed() call for x11 keymap changes lacks commas.. whoops. Fix it! Now localed emits PropertiesChanged signals again.
* bus-util: simplify bus_verify_polkit_async() a bitLennart Poettering2014-08-18
| | | | | | | | | | | First, let's drop the "bus" argument, we can determine it from the message anyway. Secondly, determine the right callback/userdata pair automatically from what is currently is being dispatched. This should simplify things a lot for us, since it makes it unnecessary to pass pointers through the original handlers through all functions when we process messages, which might require authentication.
* Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507'Lennart Poettering2014-08-15
|\
| * sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()Stef Walter2014-08-15
| | | | | | | | | | It's unneccessary, not used, and complicates callers of the function.
* | sd-bus: add API to check if a client has privilegesLennart Poettering2014-08-15
|/ | | | | | | | | | | | | This is a generalization of the vtable privilege check we already have, but exported, and hence useful when preparing for a polkit change. This will deal with the complexity that on dbus1 one cannot trust the capability field we retrieve via the bus, since it is read via /proc/$$/stat (and thus might be out-of-date) rather than directly from the message (like on kdbus) or bus connection (as for uid creds on dbus1). Also, port over all code to this new API.
* bus: always explicitly close bus from main programsLennart Poettering2014-08-04
| | | | | | | | | | | | | | Since b5eca3a2059f9399d1dc52cbcf9698674c4b1cf0 we don't attempt to GC busses anymore when unsent messages remain that keep their reference, when they otherwise are not referenced anymore. This means that if we explicitly want connections to go away, we need to close them. With this change we will no do so explicitly wherver we connect to the bus from a main program (and thus know when the bus connection should go away), or when we create a private bus connection, that really should go away after our use. This fixes connection leaks in the NSS and PAM modules.
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | $ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
* Nuke update-kbd-mapZbigniew Jędrzejewski-Szmek2014-07-18
| | | | | | Our version has evolved independently of the original table in systemd-config-keyboard, so it cannot be ever regenerated from original upstream. Remove script to avoid confusion.
* shared: make timezone and locale enumeration and validation genericLennart Poettering2014-07-07
| | | | | This way we can reuse it other code thatn just localectl/localed + timedatectl/timedated.
* machinectl: show /etc/os-release information of container in status outputLennart Poettering2014-07-03
|
* localed: consider an unset model as a wildcardMichal Sekletar2014-07-02
|