Commit Graph

1715 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 54fcb6192c core: define "exit" and "exit-force" actions for user units and only accept that
We would accept e.g. FailureAction=reboot-force in user units and then do an
exit in the user manager. Let's be stricter, and define "exit"/"exit-force" as
the only supported actions in user units.

v2:
- rename 'exit' to 'exit-force' and add new 'exit'
- add test for the parsing function
2018-10-17 19:31:49 +02:00
Davide Cavalca b75f0c69b3 shared: add %g, %G specifiers for group / gid (#10368) 2018-10-13 17:26:48 +09:00
Lennart Poettering a55d8bedd2
Merge pull request #10176 from yuwata/udev-cleanup-7
udev: replace udev_device by sd_device
2018-10-12 12:26:33 +02:00
Yu Watanabe eb43e8a76d test: sort included headers 2018-10-12 17:54:23 +09:00
Yu Watanabe cb3e926a5d test: add test for 'thread safety' of libudev
This adds a test for 715a970548d03fed18dc66c411c8b42ff21029cf.
2018-10-12 17:54:23 +09:00
Yu Watanabe a6ee01caf3 test: add test for 'thread safety' of sd-device
This adds a test for a5d8835c78.
2018-10-12 17:54:23 +09:00
Yu Watanabe 3ffd12bfbe test: add tests for $SYSTEMD_MEMPOOL=
This adds tests for b4f607433c and
205c085bc3 (#9792).
2018-10-12 17:54:23 +09:00
Yu Watanabe da4bb75f59 udev: drop unused function udev_build_argv() 2018-10-11 04:21:14 +09:00
Zbigniew Jędrzejewski-Szmek 2a56a88f46
Merge pull request #10316 from poettering/json-api
just the json stuff from #9762
2018-10-10 14:21:18 +02:00
Zbigniew Jędrzejewski-Szmek f436470ae1
Merge pull request #10343 from poettering/manager-state-fix
various fixes for PID1's Manager object
2018-10-10 12:36:16 +02:00
Lennart Poettering 65f95765d0 tree-wide: various ubsan zero size memory fixes
Fixes: #10346
2018-10-10 12:00:56 +02:00
Lennart Poettering 788c34be32 json: add test 2018-10-10 10:13:30 +02:00
Lennart Poettering ed4ac965fa manager: rework test flags set
No reason to avoid bit 0.

Also, fix some tests that pass "true" as flags value, which is just
wrong.
2018-10-09 19:43:43 +02:00
Roman Gushchin 084c700780 core: support cgroup v2 device controller
Cgroup v2 provides the eBPF-based device controller, which isn't currently
supported by systemd. This commit aims to provide such support.

There are no user-visible changes, just the device policy and whitelist
start working if cgroup v2 is used.
2018-10-09 09:47:51 -07:00
Roman Gushchin 17f149556a core: refactor bpf firewall support into a pseudo-controller
The idea is to introduce a concept of bpf-based pseudo-controllers
to make adding new bpf-based features easier.
2018-10-09 09:46:08 -07:00
Zbigniew Jędrzejewski-Szmek 065f4d9645 test-udev: sprinkle (void) and assert_se() as necessary
CID #996263.
2018-10-09 10:21:17 +02:00
Zbigniew Jędrzejewski-Szmek ac1a3726be test-udev: remove unsatisfiable conditionals
CID #1396013.
2018-10-09 10:21:15 +02:00
Lennart Poettering 36cd739a78 test: shorten test-boot-timestamps a bit 2018-10-08 21:40:44 +02:00
Lennart Poettering 337eed30e4 efivars: check whether we are booted with EFI before reading/writing to variables
We do these checks only for the high-level calls as for the low-level
ones it might make sense in some exotic uses to read the host EFI data
from a container or so.
2018-10-08 21:40:44 +02:00
Lennart Poettering 1634ebb54a
Merge pull request #10262 from keszybz/hibres-disable
Switches to disable hibernation and/or resuming
2018-10-08 21:39:54 +02:00
Zbigniew Jędrzejewski-Szmek e8f1d00d69 shared/sleep-config: add switches to kill specific sleep modes
/etc/systemd/sleep.conf gains four new switches:
AllowSuspend=, AllowHibernation=, AllowSuspendThenHibernate=, AllowHybridSleep=.

Disabling specific modes was already possible by masking suspend.target,
hibernate.target, suspend-then-hibernate.target, or hybrid-sleep.target.
But this is not convenient for distributions, which want to set some defaults
based on what they want to support. Having those available as configuration
makes it easy to put a config file in /usr/lib/systemd/sleep.conf.d/ that
overrides the defaults and gives instructions how to undo that override.
2018-10-08 18:21:00 +02:00
Zbigniew Jędrzejewski-Szmek edf43e3df7 test-sleep: print function names 2018-10-08 17:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 9a135c084a basic/proc-cmdline: allow parsing of cmdline from a string
Comes with tests.

Also add direct test for $SYSTEMD_PROC_CMDLINE.

In test-proc-cmdline, "true" was masquerading as PROC_CMDLINE_STRIP_RD_PREFIX,
fix that. Also, reorder functions to match call order.
2018-10-08 17:05:19 +02:00
Thomas Haller afbae3e9f2 path-util: fix path_simplify() with kill_dots and "."
Previously, together with kill_dots true, patch like
".", "./.", ".//.//" would all return an empty string.

That is wrong. There must be one "." left to reference
the current directory.

Also, the comment with examples was wrong.
2018-10-05 21:41:33 +02:00
Lennart Poettering ad191df836
Merge pull request #10134 from keszybz/test-runner
Some test-related fixed and a test runner for installed tests
2018-10-05 20:35:30 +02:00
Lennart Poettering dacd723620
Merge pull request #10117 from keszybz/undynamicify
Set DynamicUser=no for networkd, resolved, timesyncd
2018-10-05 17:41:56 +02:00
Lennart Poettering 083d27b654
Merge pull request #10152 from yuwata/udev-use-extract
udev: small cleanups
2018-10-05 17:11:43 +02:00
Yu Watanabe e913b7988f
test-execute: add a test for systemcall filter (#10273)
This adds a test for issue #9939 which is fixed by
a5404992cc (#9942).
2018-10-05 14:46:30 +09:00
Yu Watanabe b81b9d406d test: fix memleak in test-fs-util
Fixes #10267 and CID#1395997.
2018-10-04 16:24:44 +09:00
Zbigniew Jędrzejewski-Szmek 2796485404 test-fs-util: run all tests on the specified directory
This removes $RENAME_NOREPLACE_DIR and uses a command-line argument instead.
Logging is added, and tests are skipped if we get -EPERM or friends
(which happens on FAT and other filesystems).
2018-10-04 16:18:58 +09:00
Zbigniew Jędrzejewski-Szmek 7158b4b3fc test-fs-util: simplify testdir creation 2018-10-03 13:42:08 +02:00
Zbigniew Jędrzejewski-Szmek 9a21d8b9fd
Merge pull request #10251 from poettering/renameat-racy
rename_noreplace() fallback for file systems where neither RENAME_REPLACE nor link()/unlinkat() is available
2018-10-03 13:37:53 +02:00
Yu Watanabe b7172f3471 test-execute: also tests under the condition that unshare() is filtered
This is mainly for testing 1beab8b0d0.
2018-10-03 08:33:23 +02:00
Yu Watanabe 9380d34c2a test: add test for sd_device 2018-10-02 23:04:55 +02:00
Lennart Poettering eb74d3b97a
Merge pull request #10249 from keszybz/lgtm-fixes
Fixes for issues found by LGTM
2018-10-02 17:42:55 +02:00
Lennart Poettering 4a5d77615e test: add test case for rename_noreplace() 2018-10-02 16:11:10 +02:00
Zbigniew Jędrzejewski-Szmek 459500a32c shared/install: avoid overwriting 'r' counter with a partial result
We want to store either the first error or the total number of changes in 'r'.
Instead, we were overwriting this with the return value from
install_info_traverse().

LGTM complained later in the loop that:
> Comparison is always true because r >= 0.
2018-10-02 15:36:24 +02:00
Zbigniew Jędrzejewski-Szmek 7f546026ab Introduce free_and_strndup and use it in bus-message.c
v2: fix error in free_and_strndup()

When the orignal and copied message were the same, but shorter than specified
length l, memory read past the end of the buffer would be performed. A test
case is included: a string that had an embedded NUL ("q\0") is used to replace
"q".

v3: Fix one more bug in free_and_strndup and add tests.

v4: Some style fixed based on review, one more use of free_and_replace, and
make the tests more comprehensive.
2018-10-02 11:42:45 +02:00
Yu Watanabe 5c434af721
Merge pull request #10218 from keszybz/export-sd-device-hwdb
Export functions in sd-device and sd-hwdb
2018-10-01 19:45:55 +02:00
Zbigniew Jędrzejewski-Szmek 4dd73b883f test-sd-hwdb: skip tests if hwdb cannot be opened 2018-10-01 15:22:55 +02:00
Zbigniew Jędrzejewski-Szmek 3bdce0eac0
Merge pull request #10138 from yuwata/test-check-container
test: skip several tests when running in container
2018-10-01 10:09:54 +02:00
Zbigniew Jędrzejewski-Szmek ca7a9afc7e test-sd-hwdb: add a simple test for export sd-hwdb functions 2018-09-30 20:39:02 +02:00
Zbigniew Jędrzejewski-Szmek b6de93096e
Merge pull request #10173 from poettering/sd-boot-utf
the utf8.c changes from PR #9437 (i.e. the boot counting PR)
2018-09-27 08:21:20 +02:00
Lennart Poettering ee8d493cbd
Merge pull request #10158 from keszybz/seccomp-log-tightening
Seccomp log tightening
2018-09-26 15:56:32 +02:00
Yu Watanabe bd206af402 test: introduce test-udev-build-argv
This intends to clarify the rule udev_build_argv() uses.
2018-09-26 22:52:01 +09:00
Yu Watanabe 1f938af811 test: add tests for strv_split_full() 2018-09-26 22:50:02 +09:00
Lennart Poettering 80b0a59729 utf8: add utf8_to_utf16() helper 2018-09-25 15:57:47 +02:00
Lennart Poettering 7c428bb5d5
Merge pull request #10059 from yuwata/env-exec-directory
core: introduce $RUNTIME_DIRECTORY= or friends
2018-09-25 12:34:30 +02:00
Zbigniew Jędrzejewski-Szmek b54f36c604 seccomp: reduce logging about failure to add syscall to seccomp
Our logs are full of:
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldstat() / -10037, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call get_thread_area() / -10076, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call set_thread_area() / -10079, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldfstat() / -10034, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldolduname() / -10036, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldlstat() / -10035, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call waitpid() / -10073, ignoring: Numerical argument out of domain
...
This is pointless and makes debug logs hard to read. Let's keep the logs
in test code, but disable it in nspawn and pid1. This is done through a function
parameter because those functions operate recursively and it's not possible to
make the caller to log meaningfully.


There should be no functional change, except the skipped debug logs.
2018-09-24 17:21:09 +02:00
Zbigniew Jędrzejewski-Szmek f09da7ccbc test-seccomp: log function names
Various tests produce similar output, and the function names make it
easier to see where the output is generated.
2018-09-24 17:21:09 +02:00