Commit graph

36582 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek ca5d90d4d9 journal-file: get rid of a helper variable
It doesn't really save much in code length. Having the event source named
explicitly makes it easier to understand the code at a glance.
2018-11-16 09:03:41 +01:00
Zbigniew Jędrzejewski-Szmek 08c1eb0e30 sd-event: make sd_event_source_get_enabled return more info 2018-11-16 09:03:41 +01:00
Zbigniew Jędrzejewski-Szmek 7d92a1a490 sd-event: do not use assert_return for something that is not an error
It's totally OK for description to be unset, so let's not log about this
even at debug level.
2018-11-16 09:00:33 +01:00
Evgeny Vereshchagin f7a6b40187 tests: add a reproducer for a heap-buffer-overflow fixed in 937b117137 2018-11-16 08:45:16 +01:00
Evgeny Vereshchagin 1dd485b700 tests: add a reproducer for a memory leak fixed in 30eddcd51b in August 2018-11-16 08:45:16 +01:00
Evgeny Vereshchagin 080d112caa journal: fix an off-by-one error in dev_kmsg_record 2018-11-16 08:45:16 +01:00
Evgeny Vereshchagin 8dc4de966c basic: remove an assertion from cunescape_one
The function takes a pointer to a random block of memory and
the length of that block. It shouldn't crash every time it sees
a zero byte at the beginning there.

This should help the dev-kmsg fuzzer to keep going.
2018-11-16 08:45:16 +01:00
Evgeny Vereshchagin 8857fb9beb tests: add a fuzzer for dev_kmsg_record 2018-11-16 08:44:35 +01:00
Yu Watanabe a6da77b71b udev-rules: fix possible assertion
On 'remove' action, event->dev_db_clone is NULL. So, `IMPORT{db}` rule
on 'remove' action triggers assertion. This fixes the issue.
2018-11-15 15:50:27 +01:00
Zbigniew Jędrzejewski-Szmek 28f38a7634 Revert "units: lock down logind with fs namespacing options" 2018-11-15 17:48:01 +03:00
Zbigniew Jędrzejewski-Szmek df7f9e0b2c basic/json: silence gcc warning about limited range of data type
With gcc-7.1.1-3.fc26.aarch64:
../src/basic/json.c: In function ‘json_format’:
../src/basic/json.c:1409:40: warning: comparison is always true due to limited range of data type [-Wtype-limits]
                                 if (*q >= 0 && *q < ' ')
                                        ^~
../src/basic/json.c: In function ‘inc_lines_columns’:
../src/basic/json.c:1762:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
                 } else if (*s >= 0 && *s < 127) /* Process ASCII chars quickly */
                               ^~

Cast to (signed char) silences the warning, but a cast to (int) for some reason
doesn't.
2018-11-15 15:39:06 +01:00
Zbigniew Jędrzejewski-Szmek cd5a29ce98
Merge pull request #10742 from poettering/c-utf8
default to C.UTF-8 locale, and many improvements to env var file parsing/kernel cmdline parsing
2018-11-15 12:47:17 +01:00
Lennart Poettering 042cad5737
Merge pull request #10753 from keszybz/pager-no-interrupt
Add mode in journalctl where ^C is handled by the pager
2018-11-14 20:09:39 +01:00
Lennart Poettering 3dafa6bc76 core: drop dbus queue recursion check
We don't dispatch the queue recursively anymore, hence let's simplify
things a bit.

As pointed out by @fbuihuu:

https://github.com/systemd/systemd/pull/10763#discussion_r233209550
2018-11-14 20:09:11 +01:00
Lennart Poettering 483d713e0a tests: add some tests for cmdline args containing spaces 2018-11-14 17:22:18 +01:00
Lennart Poettering 4f7dc24f8b update NEWS 2018-11-14 17:01:55 +01:00
Lennart Poettering 8a7cf15733 update TODO 2018-11-14 17:01:55 +01:00
Lennart Poettering e6755a3350 locale-util: introduce common helper locale_variables_free() for freeing locale variable arrays 2018-11-14 17:01:55 +01:00
Lennart Poettering 13df9c398d fileio: automatically add NULL sentinel to parse_env_file()
Let's modernize things a bit.
2018-11-14 17:01:55 +01:00
Lennart Poettering 608eea8ea0 localed: be more careful with the used types 2018-11-14 17:01:55 +01:00
Lennart Poettering aa8fbc74e3 fileio: drop "newline" parameter for env file parsers
Now that we don't (mis-)use the env file parser to parse kernel command
lines there's no need anymore to override the used newline character
set. Let's hence drop the argument and just "\n\r" always. This nicely
simplifies our code.
2018-11-14 17:01:54 +01:00
Lennart Poettering 01771226c2 tree-wide: replace all remaining uses of parse_env_file() for parsing /proc/cmdline
Let's always go through the proc-cmdline.c APIs.
2018-11-14 17:01:54 +01:00
Lennart Poettering 26a9337690 localed: no need to log twice about reload requests 2018-11-14 17:01:54 +01:00
Lennart Poettering 936d113663 localed: show proper bus error if we can in log message 2018-11-14 17:01:54 +01:00
Lennart Poettering 46e8b9470a localed: don't silently eat up errors, log something 2018-11-14 17:01:54 +01:00
Lennart Poettering 0db9bd200f locale-setup: default to C.UTF-8
Most distributions already were shipping a C.UTF-8 locale and even Fedora
now supports the C.UTF-8 locale, and there's clear indication that this
is going upstream too. Hence, let's default to it now too, if nothing
else is set.

Note that this is only a fallback if noting else is set, and since
distros generally configure a default for this behaviour shouldn't
really change in installed systems.

On new systems this makes vconsole.conf redundant.
2018-11-14 17:01:54 +01:00
Lennart Poettering cd45734f87 locale-setup: rework to use new proc_cmdline_get_key_many() API
This way we use the same code to access /proc/cmdline as everywhere
else, and thus support it in containers and the SYSTEMD_PROC_CMDLINE env
var.
2018-11-14 17:01:54 +01:00
Lennart Poettering 6176be15ac locale-setup: use precise type for locale variable iterator 2018-11-14 17:01:54 +01:00
Lennart Poettering 05e062cb89 locale-setup: use _cleanup_strv_free_ 2018-11-14 17:01:54 +01:00
Lennart Poettering 78b30ee056 proc-cmdline: introduce new proc_cmdline_get_key_many() helper
This is like parse_env_file(), but from the kernel command line
2018-11-14 17:01:54 +01:00
Lennart Poettering 1e7a599671 proc-cmdline: split out rd. prefix handling in proc_cmdline_parse_given() and proc_cmdline_get_key()
This introduces a wrapper around extrac_first_word() called
proc_cmdline_extract_first(), which suppresses "rd." parameters
depending on the specified calls.

This allows us to share more code between proc_cmdline_parse_given() and
proc_cmdline_get_key(), and makes it easier to reuse this logic for
other purposes.
2018-11-14 17:01:54 +01:00
Zbigniew Jędrzejewski-Szmek 84afbbcf24 man: use <keycombo> more 2018-11-14 16:57:33 +01:00
Zbigniew Jędrzejewski-Szmek 6432da6a69 basic/pager: ignore ^C when piping to less and K is not set
Normally, we want to immediately quit on ^C. But when we are running under
less, people may set SYSTEMD_LESS without K, in which case they can use ^C to
communicate with less, and e.g. start and stop following input.

Fixes #6405.
2018-11-14 16:53:50 +01:00
Zbigniew Jędrzejewski-Szmek ce02b69ea8 basic/cgroup-util: remove two unnecessary includes 2018-11-14 16:26:12 +01:00
Zbigniew Jędrzejewski-Szmek fde32028a4 Move LONG_LINE_MAX definition to fileio.h
All users of the macro (except for one, in serialize.c), use the macro in
connection with read_line(), so they must include fileio.h.  Let's not play
libc games and require multiple header file to be included for the most common
use of a function.

The removal of def.h includes is not exact. I mostly went over the commits that
switch over to use read_line() and add def.h at the same time and reverted the
addition of def.h in those files.
2018-11-14 16:25:32 +01:00
Zbigniew Jędrzejewski-Szmek 0221d68a13 basic/pager: convert the pager options to a flags argument
Pretty much everything uses just the first argument, and this doesn't make this
common pattern more complicated, but makes it simpler to pass multiple options.
2018-11-14 16:25:11 +01:00
Lennart Poettering f6dd5e7c18 proc-cmdline: turn flags parameter into a proper typedef'ed enum
Let's add some extra typesafety.
2018-11-14 16:22:28 +01:00
Lennart Poettering 8755568681
Merge pull request #10759 from keszybz/udevd-more-configuration
Udevd more configuration options
2018-11-14 16:21:14 +01:00
Evgeny Vereshchagin d419b75ce9 travis: use double the normal timeout in the ASan & UBSan stage
This should somewhat address https://github.com/systemd/systemd/issues/10696.
2018-11-14 16:17:04 +01:00
Zbigniew Jędrzejewski-Szmek b5be61d1ed
Merge pull request #10747 from poettering/machinectl-list-fix
properly acquire os-release file from containers
2018-11-14 12:47:56 +01:00
Zbigniew Jędrzejewski-Szmek eff162bf96
Merge pull request #10763 from poettering/pending-reload-fix
when reloading, don't throttle unit/job dbus change signal generation
2018-11-14 10:44:50 +01:00
Yu Watanabe d4a389eb5f json: decrease DEPTH_MAX to 4k
This makes DEPTH_MAX lower value, as test-json fails with stack
overflow.

Note that the test can pass with 8k, but for safety, here set to 4k.

Fixes #10738.
2018-11-14 10:44:18 +01:00
Ruben Suarez Alvarez 080a0178f8 hwdb: Add accelerometer orientation quirk for the Chuwi CoreBook tablet 2018-11-14 09:56:50 +01:00
Evgeny Vereshchagin 7970a52509 travis: also compile and run unsafe unit tests 2018-11-14 09:55:23 +01:00
jambonmcyeah d08819ed74 hwdb: Add Onda V820w accelerometer transformation matrix
Added accelerometer transformation matrix for the Onda V820w Tablet
2018-11-14 09:54:38 +01:00
Lennart Poettering 8204470252 unit: don't claim there was no IP traffic generated by a unit when we don't know
Only if we have some IP traffic accounting at all we should claim that.
2018-11-14 09:53:50 +01:00
Lennart Poettering 6eb65e7ca4 core: split out audit message generation from unit_notify()
Just some refactoring, no change in behaviour.
2018-11-14 09:51:47 +01:00
Lennart Poettering 438311a518 man: document that env vars are not suitable for passing secrets
Prompted by the thread around:

https://lists.freedesktop.org/archives/systemd-devel/2018-November/041665.html
2018-11-14 09:12:49 +03:00
Lennart Poettering 06bd149a71 update TODO 2018-11-13 23:48:53 +01:00
Lennart Poettering 862d9d9503
Merge pull request #10757 from Antique/cgroupv2
Fix cgroupv2 bpf-devices issues
2018-11-13 22:03:10 +01:00