Zbigniew Jędrzejewski-Szmek
054d871d41
test-execute: block /sys not /proc
...
As explained in the previous commit, blocking /proc can cause us
to go into a long loop or fail the test.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek
9efb96315a
test-execute: allow filtering test cases by pattern
...
When debugging failure in one of the cases, it's annoying to have to wade
through the output from all the other cases. Let's allow picking select
cases.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek
67fb5f338f
seccomp: allow shmat to be a separate syscall on architectures which use a multiplexer
...
After
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 ,
those syscalls have their separate numbers and we can block them.
But glibc might still use the old ones. So let's just do a best-effort
block and not assume anything about how effective it is.
2019-03-15 15:46:41 +01:00
Zbigniew Jędrzejewski-Szmek
e55bdf9b6c
seccomp: shm{get,at,dt} now have their own numbers everywhere
...
E.g. on i686:
(previously)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmat) = -221
arch x86: SCMP_SYS(shmdt) = -222
(now)
arch x86: SCMP_SYS(mmap) = 90
arch x86: SCMP_SYS(mmap2) = 192
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmat) = 397
arch x86: SCMP_SYS(shmdt) = 398
The relevant commit seems to be
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0d6040d46817 .
2019-03-15 15:28:43 +01:00
Lennart Poettering
d8b4d14df4
util: split out nulstr related stuff to nulstr-util.[ch]
2019-03-14 13:25:52 +01:00
Lennart Poettering
cfb4a84942
util: don't include util.h from def.h
...
Nothing it defines is used in it.
2019-03-14 13:25:51 +01:00
Lennart Poettering
f05e1d0d9f
util: split out kbd related stuff
...
This stuff is neither generic enough to be in def.h, nor really has much
to do with locale, hence give it its own .c/.h file pair.
2019-03-14 13:25:51 +01:00
Lennart Poettering
2b2fec7db0
util: split out errno related stuff
2019-03-14 13:25:51 +01:00
Lennart Poettering
ef9fafbd91
tests: add tests for embedded newlines in /proc/cmdline
...
Prompted by: #7097
2019-03-13 17:07:02 +01:00
Lennart Poettering
760877e90c
util: split out sorting related calls to new sort-util.[ch]
2019-03-13 12:16:43 +01:00
Lennart Poettering
0a9707187b
util: split out memcmp()/memset() related calls into memory-util.[ch]
...
Just some source rearranging.
2019-03-13 12:16:43 +01:00
Lennart Poettering
eefc66aa8f
util: split out some stuff into a new file limits-util.[ch]
2019-03-13 12:16:43 +01:00
Lennart Poettering
0cb8e3d118
util: split out namespace related stuff into a new namespace-util.[ch] pair
...
Just some minor reorganiztion.
2019-03-13 12:16:38 +01:00
Yu Watanabe
7e46b29bd3
test: add a testcase for ProtectHome=tmpfs vs ProtectSystem=strict
2019-03-13 11:53:59 +09:00
Lennart Poettering
441dc329d7
Merge pull request #11916 from yuwata/pid1-id-renaming-handling
...
core: handle ID_RENAMING= udev property
2019-03-07 14:42:08 +01:00
Zbigniew Jędrzejewski-Szmek
2bd061a48b
test-execute: avoid undefined variable warning when compiled w/o seccomp
2019-03-07 10:59:06 +01:00
Yu Watanabe
08caaee0ac
sd-device: move device_action_from_string() and friends to device-private.h
2019-03-07 15:18:49 +09:00
Zbigniew Jędrzejewski-Szmek
53f79e125d
meson: use a convenience library for the sources shared between core/ and the outside
...
This avoids double compilation. Those files are tiny, so it doesn't save time,
but we avoid repeated warnings and errors, and it's generally cleaner to it
this way.
The number of commands in 'ninja -C build clean && ninja -C build' drops from
1462 to 1455 for me.
2019-03-05 21:01:17 +01:00
Lennart Poettering
9e71f5d983
shutdown: rearrange shutdown sources in source tree
...
Let's move the shutdown binary into its own subdirectory in
src/shutdown, after all it is relatively isolated from the normal PID 1
sources, being a different binary and all.
Unfortunately it's not possible to move some of the code, since it is
shared with PID 1, that I wished we could move, but I still think it's
worth it.
2019-03-05 12:21:17 +01:00
Lennart Poettering
1788875576
Merge pull request #11871 from yuwata/systemctl-show-format-unprintable
...
systemctl: format many entries in 'show' command
2019-03-04 19:04:27 +01:00
Lennart Poettering
38ba8c8874
Merge pull request #11888 from keszybz/non-atomic
...
Drop unused atomic operations
2019-03-04 19:03:46 +01:00
Yu Watanabe
9201eea137
test: add tests for test_in_addr_prefix_to_string()
2019-03-04 23:45:07 +09:00
Yu Watanabe
146cf7f05b
test: move tests for in_addr_prefix_from_string()
2019-03-04 23:45:07 +09:00
Davide Cavalca
4d97f5a09e
test: do not assume test-chown-rec is running as root
2019-03-04 14:40:17 +01:00
Zbigniew Jędrzejewski-Szmek
f68a26221c
tests: use the test helpers in more places
...
This is mostly cosmetic. It makes those test binaries support SYSTEMD_LOG_*
environment variables.
2019-03-04 14:15:38 +01:00
Lennart Poettering
46d4d67d79
Merge pull request #11820 from dm0-/chase
...
Allow tmpfiles to create files in a root under an unprivileged directory
2019-03-04 13:04:45 +01:00
Lennart Poettering
d8a23f5e4f
Merge pull request #11770 from yuwata/fix-9955
...
network: rework address pool
2019-03-04 12:11:07 +01:00
Yu Watanabe
59c1546b45
test: add tests for log_syntax()
2019-03-04 15:28:32 +09:00
Lennart Poettering
4b70aedc4a
test: add test for new sd-bus refcnt logic
2019-03-01 15:37:39 +01:00
Yu Watanabe
e762ea7481
test: add tests for in_addr_random_prefix()
2019-03-01 16:28:20 +09:00
David Michael
2a2fe6ed64
test-fs-util: test chase_symlinks with user-owned dirs
...
This verifies the fix for the issue described in:
https://github.com/systemd/systemd/pull/11820
2019-02-28 13:06:07 -05:00
Zbigniew Jędrzejewski-Szmek
f0e2e0db00
test-time-util: use standard intro and print timezones read from file
...
The asserts are OK, but it's also nice to see the list by eye.
2019-02-28 15:38:52 +01:00
Zbigniew Jędrzejewski-Szmek
92e068b465
basic/utf8: do not read past end of string when looking for a multi-byte character
...
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9341 .
2019-02-26 12:37:40 +01:00
Zbigniew Jędrzejewski-Szmek
adbdcfbe63
test-json: use standard test intro
2019-02-25 10:07:18 +01:00
Zbigniew Jędrzejewski-Szmek
b6cda3ec4d
test-json: avoid deep stack recursion under msan
2019-02-25 10:07:18 +01:00
Zbigniew Jędrzejewski-Szmek
9003da2963
test-mountpoint-util: unpoison string allocated by sscanf %ms
2019-02-25 10:07:18 +01:00
Lennart Poettering
953a1af082
Merge pull request #11776 from keszybz/networkd-ordered-sets
...
Store domains lists in OrderedSets in networkd
2019-02-21 15:15:11 +01:00
Zbigniew Jędrzejewski-Szmek
53ae3f6467
basic/ordered-set: export networkd function to print string sets
...
Tests are added.
2019-02-21 12:00:05 +01:00
Zbigniew Jędrzejewski-Szmek
ef79eae09a
basic/ordered-set: add functions to operate on OrderedSets of strings
2019-02-21 12:00:05 +01:00
Yu Watanabe
528a74a1ad
socket-util: re-implement socket_address_parse_netlink() by using extract_first_word()
...
This drops support of trailing white space when a multicast group is
specified.
Fixes one of issues in #11738 .
2019-02-21 11:30:49 +01:00
Zbigniew Jędrzejewski-Szmek
1b78172b5a
test-ordered-set: add a copy of test-set adapted to OrderedSet
2019-02-20 22:12:48 +01:00
Anita Zhang
7ca69792e5
core: add ':' prefix to ExecXYZ= skip env var substitution
2019-02-20 17:58:14 +01:00
Matthias Klumpp
4b05f0c9d9
core: Allow to configure execute_directories execution behavior
...
This adds a new bitfield to `execute_directories()` which allows to
configure whether to ignore non-zero exit statuses of binaries run and
whether to allow parallel execution of commands.
In case errors are not ignored, the exit status of the failed script
will now be returned for error reposrting purposes or other further
future use.
2019-02-18 16:16:02 +01:00
Lennart Poettering
4d422d1f9e
Merge pull request #11226 from keszybz/enable-remount-fs-dynamically
...
Enable systemd-remount-fs.service dynamically
2019-02-18 12:46:31 +01:00
Lennart Poettering
eca3d5d567
Merge pull request #9594 from filbranden/cpu_quota_period1
...
core: add CPUQuotaPeriodSec=
2019-02-15 12:11:42 +01:00
Lennart Poettering
e5d21c24a0
Merge pull request #11382 from keszybz/udev-predictable-macs
...
Allow MACAddressPolicy=persistent for all virtual devices
2019-02-15 11:31:25 +01:00
Filipe Brandenburger
10f2864111
core: add CPUQuotaPeriodSec=
...
This new setting allows configuration of CFS period on the CPU cgroup, instead
of using a hardcoded default of 100ms.
Tested:
- Legacy cgroup + Unified cgroup
- systemctl set-property
- systemctl show
- Confirmed that the cgroup settings (such as cpu.cfs_period_ns) were set
appropriately, including updating the CPU quota (cpu.cfs_quota_ns) when
CPUQuotaPeriodSec= is updated.
- Checked that clamping works properly when either period or (quota * period)
are below the resolution of 1ms, or if period is above the max of 1s.
2019-02-14 11:04:42 -08:00
Filipe Brandenburger
7b61ce3c44
time-util: Introduce parse_sec_def_infinity
...
This works like parse_sec() but defaults to USEC_INFINITY when passed an
empty string or only whitespace.
Also introduce config_parse_sec_def_infinity, which can be used to parse
config options using this function.
This is useful for time options that use "infinity" for default and that
can be reset by unsetting them.
Introduce a test case to ensure it works as expected.
2019-02-14 11:04:42 -08:00
Zbigniew Jędrzejewski-Szmek
0471921b3e
Merge pull request #11487 from poettering/unprotect-errno
...
Make sure NSS modules can change errno if they want
2019-02-13 23:18:13 +01:00
Zbigniew Jędrzejewski-Szmek
14648b762f
test-json: do not pass ephemeral array as intializer to JSON_BUILD_STRV
...
Fixes #11600 .
The code was effectively doing:
json_build(..., ({ char **_x = ((char**) ((const char*[]) {"one", "two", "three", "four", NULL })); _x; }));
but there was no guarantee that the storage for the array that _x points to
survives pass the end of the block. Essentially, STRV_MAKE cannot be used
inline inside of a block like this.
2019-02-11 11:53:07 +01:00