summaryrefslogtreecommitdiff
path: root/src/locale
AgeCommit message (Collapse)Author
2015-07-29tree-wide: port everything over to fflush_and_check()Lennart Poettering
Some places invoked fflush() directly with their own manual error checking, let's unify all that by using fflush_and_check(). This also unifies the general error paths of fflush()+rename() file writers.
2015-07-03sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering
sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush() (which writes all unwritten messages out) + sd_bus_close() (which terminates the connection, releasing all unread messages) + sd_bus_unref() (which frees the connection). The combination of this call is used pretty frequently in systemd tools right before exiting, and should also be relevant for most external clients, and is hence useful to cover in a call of its own. Previously the combination of the three calls was already done in the _cleanup_bus_close_unref_ macro, but this was only available internally. Also see #327
2015-06-14tree-wide: fix memory leaks in users of bus_map_all_properties()David Herrmann
If you use bus_map_all_properties(), you must be aware that it might touch output variables even though it may fail. This is, because we parse many different bus-properties and cannot tell how to clean them up, in case we fail deep down in the parser. Fix all callers of bus_map_all_properties() to correctly cleanup any context structures at all times.
2015-05-11treewide: Correct typos and spell plural of bus consistentTorstein Husebø
2015-04-29sd-bus: drop bus parameter from message callback prototypeLennart Poettering
This should simplify the prototype a bit. The bus parameter is redundant in most cases, and in the few where it matters it can be derived from the message via sd_bus_message_get_bus().
2015-03-26util: rework word parsing and c unescaping codeLennart Poettering
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.
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
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.
2015-02-18logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering
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.
2015-02-09language fallback: it_CH (Italian, Swiss) -> it_IT (Italian, Italy)Daniele Medri
2015-02-07Add Silesian and Kashubian to language fallback mapPiotr Drąg
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
2015-02-06localed: add LANGUAGE= fallback when LANG= is specifiedZbigniew Jędrzejewski-Szmek
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
2015-02-06Add language fallback mapNaveen Kumar
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
2015-02-03util: rework strappenda(), and rename it strjoina()Lennart Poettering
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.
2015-01-22kbd-model-map: add more mappings for Slovak, Lithuanian, and KhmerMindaugas Baranauskas
https://bugs.freedesktop.org/show_bug.cgi?id=88545
2014-12-28tmpfiles: add new line type 'v' for creating btrfs subvolumesLennart Poettering
2014-12-25localed: remove spurious include of <sys/capability.h>Filipe Brandenburger
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.
2014-12-24sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering
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.
2014-12-12util: when using basename() for creating temporary files, verify the ↵Lennart Poettering
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.
2014-12-11localectl,man: make it obvious that set-*-keymaps sets both keymapsZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=85411
2014-12-03localed: log xkbcommon errorsJan Synacek
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.
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
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.
2014-11-28treewide: yet more log_*_errno + return simplificationsMichal Schmidt
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.
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
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.
2014-11-28treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
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().
2014-11-25localed: verify xkb keymaps after pk-queriesDavid Herrmann
Make sure not to run xkb-keymap validation twice if pk-queries are used. Move it below pk-checks.
2014-11-24localed: validate xkb keymapsDavid Herrmann
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.
2014-11-10strv: rework strv_split_quoted() to use unquote_first_word()Lennart Poettering
This should make the unquoting scheme a bit less naive.
2014-11-04localectl: fix localectl set-x11-keymap syntax descriptionJan Synacek
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
2014-10-23mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho
2014-10-13fi-latin1 console keymap is no moreMarko Myllynen
http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=commitdiff;h=a88711232f3216debbb02d0171187442863ccedb
2014-10-02localectl: always print warnings with log_warning() instead of printf()Lennart Poettering
They really should got to stderr, not stdout.
2014-10-02localectl: count locale variables from 0, instead of VARIABLE_LANGLennart Poettering
That way the we make our code safe regarding reordering of the variables in the enum.
2014-09-25localectl: print warning when there are options given on kernel cmdlineMichal Sekletar
2014-09-23localed: rename write_data_x11 to x11_write_dataZbigniew Jędrzejewski-Szmek
Other functions in this file follow this pattern, we have vconsole_write_data and locale_write_data.
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
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.
2014-09-03localed: check for partially matching converted keymapsZbigniew Jędrzejewski-Szmek
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".
2014-09-03localed: introduce helper function to simplify matchingZbigniew Jędrzejewski-Szmek
2014-09-03localed: log locale/keymap changes in detailZbigniew Jędrzejewski-Szmek
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.
2014-09-03localed: remove free_and_copyZbigniew Jędrzejewski-Szmek
It was mostly a duplicate of free_and_strdup().
2014-09-03localed: double free in error path and modernizationZbigniew Jędrzejewski-Szmek
Very unlikely to trigger, but in principle strv_free could be called twice: once explictly, and once from cleanup.
2014-08-28locale: fix sending PropertiesChanged for x11 keymap changedDavid Herrmann
The sd_bus_emit_properties_changed() call for x11 keymap changes lacks commas.. whoops. Fix it! Now localed emits PropertiesChanged signals again.
2014-08-18bus-util: simplify bus_verify_polkit_async() a bitLennart Poettering
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.
2014-08-15Merge commit 'b39a2770ba55637da80e2e389222c59dbea73507'Lennart Poettering
2014-08-15sd-bus: add API to check if a client has privilegesLennart Poettering
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.
2014-08-15sd-bus: Remove bus arg from bus_verify_polkit_async_registry_free()Stef Walter
It's unneccessary, not used, and complicates callers of the function.
2014-08-04bus: always explicitly close bus from main programsLennart Poettering
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.
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek
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.