1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
Commit Graph

36519 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
c11cfa2865 logind: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
b453c447e0 inhibit: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
634a0ad3e5 cat: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
5272ae42ce import: define mains through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
3c79f0b3ce id128: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
06213aae94 hwdb: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
43ead4114b hostnamectl: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
9013653e3c fsck: configure logging before use and define main through macro
There's a slight change in logic: before, when rebooting the machine, we could
also request quotacheck (by touching /run/systemd/quotacheck) if the fsck
helper set FSCK_ERROR_CORRECTED.  This is just a race, and doesn't matter much
in practice.
2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
c88f45e744 escape: use free_and_replace 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
5f200747f6 escape: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
bdab09849e detect-virt: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
4515a95ee0 coredump: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
02434ea263 boot-check-no-failures: define main through macro 2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
9a5cedc319 ac-power: define main through macro
I decided to use a separate definition for this because it's too easy to return
positive from functions which don't need this distinction and only return
negative on error and success otherwise.
2018-11-17 09:13:35 +01:00
Zbigniew Jędrzejewski-Szmek
a974a6569e Introduce main definer and use it in cgtop
This actually fixes one bogus return code in error path.
2018-11-17 09:03:54 +01:00
Lennart Poettering
f54353406a update TODO 2018-11-16 14:54:13 +01:00
Lennart Poettering
e353faa0d6 cgroup-util: when attaching/creating cgroups in multiple hierarchies, take jointly mounted controlelrs into account
If we create a cgroup in one controller it might already have been
created in another too, if we have jointly mounted controllers. Take
that into consideration.
2018-11-16 14:54:13 +01:00
Lennart Poettering
fae9bc298a cgroup: when determining which controllers we need, always extend the mask according to cpu/cpuacct joint mounting
Note that for cgroup_context_get_mask() this doesn't actually change
much, but it does prepare the ground for #10507 later on.
2018-11-16 14:54:13 +01:00
Lennart Poettering
c01ef321af cgroup: add new helper that knows which controllers are mounted together 2018-11-16 14:54:13 +01:00
Lennart Poettering
143fadf369 core: remove JoinControllers= configuration setting
This removes the ability to configure which cgroup controllers to mount
together. Instead, we'll now hardcode that "cpu" and "cpuacct" are
mounted together as well as "net_cls" and "net_prio".

The concept of mounting controllers together has no future as it does
not exist to cgroupsv2. Moreover, the current logic is systematically
broken, as revealed by the discussions in #10507. Also, we surveyed Red
Hat customers and couldn't find a single user of the concept (which
isn't particularly surprising, as it is broken...)

This reduced the (already way too complex) cgroup handling for us, since
we now know whenever we make a change to a cgroup for one controller to
which other controllers it applies.
2018-11-16 14:54:13 +01:00
Lennart Poettering
8d33dca2ff core: fix capitalization of CPUShares= settings 2018-11-16 14:46:49 +01:00
Lennart Poettering
63a0cbbac3 cgtop: use FOREACH_STRING() for fun and profit 2018-11-16 14:46:49 +01:00
Lennart Poettering
fdaa23af94 cgtop: use automatic clean-up 2018-11-16 14:46:49 +01:00
Lennart Poettering
ac0a94f743 sd-bus: make strict asan shut up
asan doesn't like it if we use strndup() (i.e. a string function) on a
non-NULL terminated buffer (i.e. something that isn't really a string).

Let's hence use memdup_suffix0() instead of strndup(), which is more
appropriate for binary data that is to become a string.

Fixes: #10385
2018-11-16 14:32:41 +01:00
Zbigniew Jędrzejewski-Szmek
62adb5d085
Merge pull request #10795 from poettering/generator-fixes
trivial fixes to some generators
2018-11-16 14:30:53 +01:00
Zbigniew Jędrzejewski-Szmek
524f8a4aea
Merge pull request #10796 from poettering/systemd-exit-service-fixes
units: corrections for systemd-exit.service
2018-11-16 14:29:20 +01:00
Lennart Poettering
567e5d5549
Merge pull request #10791 from keszybz/sd-event-get-enabled
Some minor tweaks for sd_event_source_get_enabled
2018-11-16 12:46:30 +01:00
Evgeny Vereshchagin
cc55ac0171 test: initialize syslog_fd in fuzz-journald-kmsg too
This is a follow-up to 8857fb9beb that prevents the fuzzer from crashing with
```
==220==ERROR: AddressSanitizer: ABRT on unknown address 0x0000000000dc (pc 0x7ff4953c8428 bp 0x7ffcf66ec290 sp 0x7ffcf66ec128 T0)
SCARINESS: 10 (signal)
    #0 0x7ff4953c8427 in gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35427)
    #1 0x7ff4953ca029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029)
    #2 0x7ff49666503a in log_assert_failed_realm /work/build/../../src/systemd/src/basic/log.c:805:9
    #3 0x7ff496614ecf in safe_close /work/build/../../src/systemd/src/basic/fd-util.c:66:17
    #4 0x548806 in server_done /work/build/../../src/systemd/src/journal/journald-server.c:2064:9
    #5 0x5349fa in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-journald-kmsg.c:26:9
    #6 0x592755 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:571:15
    #7 0x590627 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:480:3
    #8 0x594432 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:708:19
    #9 0x5973c6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:839:5
    #10 0x574541 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6
    #11 0x5675fc in main /src/libfuzzer/FuzzerMain.cpp:20:10
    #12 0x7ff4953b382f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #13 0x420f58 in _start (/out/fuzz-journald-kmsg+0x420f58)
```
2018-11-16 12:44:47 +01:00
Lennart Poettering
3f547ca5a6 units: fix Description= of systemd-exit.service
This file was probably copied from the --user version, let's use some
more appropriate wording for the --system version.
2018-11-16 12:25:35 +01:00
Lennart Poettering
9f782b3e1b units: use correct command to exit
Otherwise we'll end a cyclic loop.
2018-11-16 12:25:35 +01:00
Lennart Poettering
1795457f50 units: add the same ordering deps for systemd-exit.service as for systemd-poweroff.service and friends
This stuff runs in containers, and should really behave the same
everywhere.
2018-11-16 12:25:35 +01:00
Lennart Poettering
b39cfe21b4 core: show error code even when debug logging 2018-11-16 12:22:11 +01:00
Lennart Poettering
7dcb6ef06f hibernate-resume-generator: fix minor memory leak on error path 2018-11-16 12:22:11 +01:00
Lennart Poettering
a0e1f0c164 debug-generator: fix minor memory leak 2018-11-16 12:22:11 +01:00
Yu Watanabe
9b2934cb81 udev-util: read resolve_names from udev.conf
Fixes CID#1396866.
2018-11-16 09:21:58 +01:00
Zbigniew Jędrzejewski-Szmek
708dab44cd
Merge pull request #10788 from evverx/fuzz-kmsg
tests: add a fuzzer for dev_kmsg_record
2018-11-16 09:08:38 +01:00
Zbigniew Jędrzejewski-Szmek
b6cdfbe5c4 journal: simplify use of sd_event_source_get_enabled() 2018-11-16 09:03:41 +01:00
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