| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
When doing a conversion and the specified 'xc->xvariant' has no match, select
the x11 layout entry with a matching layout and an empty xvariant if such entry
exists. It's still better than no conversion at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When doing x11->console conversions, find_converted_keymap() searches
automatically for a candidate in the converted keymap directory for a given x11
layout.
However doing console->x11 conversions, this automatic search is not done hence
simple conversion in this direction can't be achieved without populating
kbd-model-map with entries for converted keymaps.
For example, let's consider "at" layout which is not part of kbd-model-map. The
"at" x11 layout has a generated keymap
"/usr/share/kbd/keymaps/xkb/at.map.gz". If we configure "at" for the x11
layout, localed is able to automatically find the "at" converted vc layout and
the conversion just works :
$ localectl set-x11-keymap at
$ localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: at
X11 Layout: at
However in the opposite direction, ie when setting the vc keymap to "at", no
conversion is done and the x11 layout is not defined:
$ localectl set-keymap at
$ localectl
System Locale: LANG=en_US.UTF-8
VC Keymap: at
X11 Layout: (unset)
This patch fixes this limitation as the implemenation is relatively simple and
it removes the need to populate kbd-model-map with (many) entries for converted
keymaps. However the patch doesn't remove the existing entries in kbd-model-map
which became unneeded after this change to be on the safe side.
Note: by default the automatically generated x11 keyboard configs use keyboard
model "microsoftpro" which should be equivalent to "pc105" model but with the
internet/media key mapping added.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After manually editing /etc/locale.gen, calling localectl set-locale
sometimes fails. When it fails, the systemd journal shows:
systemd-localed: free() / invalid pointer.
It turned out that it only fails if some of the uncommented lines in
/etc/locale.gen have leading spaces, as in:
* C.UTF-8 <= OK
* en_US.UTF-8 <= OK
* fr_FR.UTF-8 <= NOK
After parsing a line from /etc/locale.gen, we use strstrip() to obtain
the "trimmed" line (without leading or trailing spaces).
However, we store the result of strstrip() in the original pointer
containing the untrimmed line. This pointer is later passed to free
(this is done automatically using _cleanup_free_).
This is a problem because if any leading space is present, the pointer
will essentially be shifted from its original value. This will result in
an invalid free upon cleanup.
The same issue is present in the locale_gen_locale_supported function.
Fixed by storing the result of strstrip() in a different pointer.
|
|
|
|
|
| |
If vconsole.conf or friends contain an invalid keymap, then let's
ignore the settings.
|
|
|
|
| |
No functional change, preparation for later commits.
|
|
|
|
| |
No functional change, preparation for later commits.
|
|
|
|
| |
No functional changes, just refactoring.
|
|
|
|
|
|
|
|
| |
This is a combination of fdopen() and fd_reopen(). i.e. it first reopens
the fd, and then converts that into a FILE*.
We do this at various places already manually. let's move this into a
helper call of its own.
|
|
|
|
|
| |
Let's make copy_xattr() a little more generic in preparation for
copying symlink xattrs.
|
|
|
|
|
| |
It is used at only place, and mostly trivial.
No functional change, just refactoring.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Let's make library-functions simple and independent as possible as they
are. No functional change, just refactoring.
|
| |
|
|
|
|
|
| |
Then, context_get_x11_context() always replies a valid X11 context.
No functional change, just refactoring.
|
|
|
|
|
|
|
| |
This also makes x11_convert_to_vconsole() changed in the same way.
Then, their callers update Context if necessary.
No functional change, just preparation for later commits.
|
|
|
|
| |
No functional changes, preparation for later commits.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debian/Ubuntu use almost the same variables, but without '_'. Given
our usage is new, rename them so that they match and downstream tech
debt can be removed.
Follow-up for https://github.com/systemd/systemd/pull/25805
See:
https://github.com/systemd/systemd/issues/24228
https://github.com/systemd/systemd/pull/25412
|
|
|
|
|
| |
Closes #24228.
Replaces #25412.
|
|
|
|
|
| |
No functional changes, just refactoring and preparation for later
commits.
|
|
|
|
|
|
|
| |
Similary, this also renames context_free_x11() -> context_clear_x11(),
to make it clear that these functions do not free Context.
Also, this makes context_clear() support to be called more than once.
|
| |
|
|
|
|
|
|
|
| |
- add missing assertions,
- rename arguments for storing results,
- always initialize results on success,
- use _cleanup_ attribute at more places, etc.
|
|
|
|
|
|
|
|
| |
These combine strndup() + strspn()/strcspn() into one.
There are a bunch of strndupa() calls that could use similar treatment
(or should be converted to strdup[c]spn(), but this commit doesn't
bother with that.
|
|
|
|
|
| |
Those fds never were, so it's not fair to say that they are in "bad state".
Let's use the shorter and more direct errno.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
We ignore xattr copy failures on all other cases, and we should do so
here too.
Fixes: #24106
|
|
As the file contains not only keymap related functions.
|