Yu Watanabe [Wed, 5 Sep 2018 06:12:37 +0000 (15:12 +0900)]
core/execute: do not use the negative errno when setup_namespace() returns -ENOANO
Without this, log shows meaningless error message 'No anode', e.g.,
===
Failed to unshare the mount namespace: Operation not permitted
foo.service: Failed to set up mount namespacing: No anode
foo.service: Failed at step NAMESPACE spawning /usr/bin/test: No anode
===
Follow-up for
1beab8b0d0ff2d7d1436b52d4a0c3d56dc908962.
Yu Watanabe [Mon, 3 Sep 2018 15:31:05 +0000 (00:31 +0900)]
core/namespace: add more log messages
Evgeny Vereshchagin [Sat, 15 Sep 2018 14:21:33 +0000 (14:21 +0000)]
tests: make UBSan print full backtraces
This should make it easier to get backtraces that can be
pasted into issues like https://github.com/systemd/systemd/issues/10096.
Yu Watanabe [Sun, 16 Sep 2018 14:46:58 +0000 (23:46 +0900)]
sd-device: use qsort_safe() (#10099)
The number of found devices may be zero. So, let's use qsort_safe().
Follow-up for
0a1665890cec06032a17c16206e9f519ca88446e.
Fixes #10096.
Zbigniew Jędrzejewski-Szmek [Sat, 15 Sep 2018 20:36:38 +0000 (22:36 +0200)]
Merge pull request #9928 from yuwata/libudev-cleanups
libudev: coding style updates
Zbigniew Jędrzejewski-Szmek [Sat, 15 Sep 2018 16:33:18 +0000 (18:33 +0200)]
Merge pull request #9958 from yuwata/sd-device-enum-set
sd-device: make sd_device_enumerator_get_*_next() not destroy the list
Yu Watanabe [Sat, 15 Sep 2018 06:55:15 +0000 (15:55 +0900)]
Merge pull request #10070 from keszybz/test-reporting
Test reporting improvements
Evgeny Vereshchagin [Sat, 15 Sep 2018 02:36:44 +0000 (05:36 +0300)]
Merge pull request #10089 from yuwata/fix-oss-fuzz-10350
bus-util: use _printf_ attribute
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10350.
Yu Watanabe [Fri, 14 Sep 2018 16:58:50 +0000 (01:58 +0900)]
test-catalog: drop unused variable
Follow-up for
49cdae63d168b2fe0e19f9f090b90d79de3c39bb.
Yu Watanabe [Fri, 14 Sep 2018 16:49:29 +0000 (01:49 +0900)]
bus-util: use _printf_ attribute
Follow-up for
eda193578effbc3cee0f6d56ade52434778737c9.
Fixes oss-fuzz#10350.
Franck Bui [Fri, 14 Sep 2018 07:24:08 +0000 (09:24 +0200)]
socket-util: attempt SO_RCVBUFFORCE/SO_SNDBUFFORCE only if SO_RCVBUF/SO_SNDBUF fails
Both SO_SNDBUFFORCE and SO_RCVBUFFORCE requires capability 'net_admin'.
If this capability is not granted to the service the first attempt to increase
the recv/snd buffers (via sd_notify()) with SO_RCVBUFFORCE/SO_SNDBUFFORCE will
fail, even if the requested size is lower than the limit enforced by the
kernel.
If apparmor is used, the DENIED logs for net_admin will show up. These log
entries are seen as red warning light, because they could indicate that a
program has been hacked and tries to compromise the system.
It would be nicer if they can be avoided without giving services (relying on
sd_notify) net_admin capability or dropping DENIED logs for all such services
via their apparmor profile.
I'm not sure if sd_notify really needs to forcibly increase the buffer sizes,
but at least if the requested size is below the kernel limit, the capability
(hence the log entries) should be avoided.
Hence let's first ask politely for increasing the buffers and only if it fails
then ignore the kernel limit if we have sufficient privileges.
Zbigniew Jędrzejewski-Szmek [Fri, 14 Sep 2018 08:05:59 +0000 (10:05 +0200)]
Merge pull request #9920 from yuwata/udev-cleanup-4
udev: drop unused udev structs and use verbs in udevadm
Zbigniew Jędrzejewski-Szmek [Thu, 13 Sep 2018 14:11:16 +0000 (16:11 +0200)]
tests: add a helper function to skip with errno
Zbigniew Jędrzejewski-Szmek [Thu, 13 Sep 2018 12:31:13 +0000 (14:31 +0200)]
tests: use a helper function to parse environment and open logging
The advantages are that we save a few lines, and that we can override
logging using environment variables in more test executables.
Zbigniew Jędrzejewski-Szmek [Thu, 13 Sep 2018 11:35:03 +0000 (13:35 +0200)]
test-condition: make function return void
We don't look at the result anyway.
Zbigniew Jędrzejewski-Szmek [Thu, 13 Sep 2018 11:34:12 +0000 (13:34 +0200)]
tests: add helper to unify skipping a test and exiting
Harshit Jain [Fri, 14 Sep 2018 07:04:10 +0000 (12:34 +0530)]
man: fix typo (#10084)
fixes #10083
Alan Jenkins [Fri, 14 Sep 2018 03:11:57 +0000 (04:11 +0100)]
user-runtime-dir@.service: don't stop on runlevel switch (#10079)
Followup to commit
13cf422e04b7 ("user@.service: don't kill user manager at runlevel switch")
I think there's a general rule that units with `StopWhenUnneeded=yes` need
`IgnoreOnIsolate=yes`... But it doesn't apply to `suspend.target` and friends.
`printer.target` and friends break on isolate even if we apply the rule[1].
That just leaves `graphical-session.target`, which is a user service.
"isolate" is *mostly* a weird attempt to emulate runlevels, so I decided
not to worry about it for user services.
[1] https://github.com/systemd/systemd/issues/6505#issuecomment-
320644819
killermoehre [Thu, 13 Sep 2018 11:53:03 +0000 (13:53 +0200)]
replace https://github.com/systemd/systemd/blob/master/doc/* with https://github.com/systemd/systemd/blob/master/docs/* to point to proper documentation
Thomas Blume [Wed, 12 Sep 2018 13:10:58 +0000 (15:10 +0200)]
user@.service: don't kill user manager at runlevel switch
Loggin in as root user and then switching the runlevel results in a
stop of the user manager, even though the user ist still logged in.
That leaves a broken user session.
Adding "IgnoreOnIsolate=true" to user@.service fixes this.
Yu Watanabe [Thu, 13 Sep 2018 07:37:33 +0000 (16:37 +0900)]
test: unset $XDG_{CONFIG,DATA}_DIRS
When $XDG_DATA_DIRS is unset, then, the default value
'/usr/local/share:/usr/share' is used.
When $XDG_DATA_DIRS contain the default paths but the order
is inverted: '/usr/share:/usr/local/share', then test-path-lookup fails.
Fixes #10002.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 14:57:06 +0000 (16:57 +0200)]
meson: drop some unneeded parens
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 14:52:08 +0000 (16:52 +0200)]
meson: always allow compilation of tests binaries
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 14:11:15 +0000 (16:11 +0200)]
NEWS: remove repeated "slightly"
Yu Watanabe [Wed, 12 Sep 2018 12:47:56 +0000 (21:47 +0900)]
meson: do not build tests by default when '-Dtests=false'
[zj: it is still possible to build tests explicitly by calling
ninja -C build test-name. This way we have full flexibility.]
Yu Watanabe [Wed, 12 Sep 2018 12:52:31 +0000 (21:52 +0900)]
test: log when skipping tests in more cases
Follow-up for the previous commit.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 11:25:45 +0000 (13:25 +0200)]
test: when skipping tests, always print something
It is quite confusing if the test "fails" without printing anything at all.
A typo in an 'if' statement is also fixed.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 09:08:49 +0000 (11:08 +0200)]
meson: disable _all_ tests when -Dtests=false
Back in
08318a2c5acb3d0e4243c36461e69a3e45482441, value "false" was enabled for
'-Dtests=', but various tests were not conditionalized properly. So even with
-Dtests=false -Dslow-tests=false we'd run 120 tests. Let's make this consistent.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 09:02:58 +0000 (11:02 +0200)]
meson: disable "slow tests" too when tests are generally disabled
We would have a strange situation where after setting -Dslow-tests=true -Dtests=false
we'd get mostly the slow tests (plus some other ones which I'll fix in
subsequent commit). Let's simplify things by making -Dtests=false just
disable those tests too.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 07:55:39 +0000 (09:55 +0200)]
test-barrier: just make this a slow test
test-barrier was using a custom mechanism to skip itself. Let's
just follow the normal scheme.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 07:45:17 +0000 (09:45 +0200)]
tests: centralize check for slow tests
Lennart Poettering [Wed, 12 Sep 2018 19:39:14 +0000 (21:39 +0200)]
update TODO
afg [Wed, 29 Aug 2018 01:20:27 +0000 (09:20 +0800)]
nspawn: use copy-static if systemd-resolved is up and image is writable
Lennart Poettering [Wed, 12 Sep 2018 18:45:31 +0000 (20:45 +0200)]
Merge pull request #10061 from xnox/fix-logindless-scheduled-shutdown
Fix logindless scheduled shutdown
Lennart Poettering [Wed, 12 Sep 2018 18:17:53 +0000 (20:17 +0200)]
Merge pull request #10060 from yuwata/property-take-value
bus-util: make --property= optionaly take value
Filipe Brandenburger [Wed, 12 Sep 2018 07:23:40 +0000 (00:23 -0700)]
test: use ${builddir}/systemd-runtest.env for $SYSTEMD_CATALOG_DIR
This makes it so that tests no longer need to know the absolute paths to the
source and build dirs, instead using the systemd-runtest.env file to get these
paths when running from the build tree.
Confirmed that test-catalog works on `ninja test`, when called standalone and
also when the environment file is not present, in which case it will use the
installed location under /usr/lib/systemd/catalog.
The location can now also be overridden for this test by setting the
$SYSTEMD_CATALOG_DIR environment variable.
Filipe Brandenburger [Wed, 12 Sep 2018 06:55:02 +0000 (23:55 -0700)]
test: use ${builddir}/systemd-runtest.env to set $SYSTEMD_TEST_DATA
This simplifies get_testdata_dir() to simply checking for an environment
variable, with an additional function to locate a systemd-runtest.env file in
the same directory as the test binary and reading environment variable
assignments from that file if it exists.
This makes it possible to:
- Run `ninja test` from the build dir and have it use ${srcdir}/test for
test unit definitions.
- Run a test directly, such as `build/test-execute` and have it locate
them correctly.
- Run installed tests (from systemd-tests package) and locate the test
units in the installed location (/usr/lib/systemd/tests/testdata), in
which case the absence of the systemd-runtest.env file will have
get_testdata_dir() use the installed location hardcoded into the
binaries.
Explicit setting of $SYSTEMD_TEST_DATA still overrides the contents of
systemd-runtest.env.
Filipe Brandenburger [Wed, 12 Sep 2018 06:15:09 +0000 (23:15 -0700)]
test: remove support for suffix in get_testdata_dir()
Instead, use path_join() in callers wherever needed.
Zbigniew Jędrzejewski-Szmek [Wed, 12 Sep 2018 09:51:27 +0000 (11:51 +0200)]
Set theme jekyll-theme-slate
Yu Watanabe [Wed, 12 Sep 2018 03:36:22 +0000 (12:36 +0900)]
bash-completion: systemctl: re-implement __filter_units_by_properties()
This also unifies __filter_units_by_property() and
__filter_units_by_properties(), and makes completion for 'restart',
'reload' or 'stop' show more candidates.
Yu Watanabe [Tue, 11 Sep 2018 08:18:14 +0000 (17:18 +0900)]
bus-util: make --property= optionally take value
Michael Biebl [Tue, 11 Sep 2018 21:30:16 +0000 (23:30 +0200)]
Merge pull request #10046 from yuwata/fix-10045
test: use installed catalogs when test-catalog is not located at build dir
Dimitri John Ledkov [Tue, 11 Sep 2018 09:41:56 +0000 (10:41 +0100)]
systemctl: correctly proceed to immediate shutdown if scheduling fails
Actually check the return code from logind_schedule_shutdown() and proceed to
immediate shutdown if that fails. Negative return codes can be returned if
systemctl is compiled without logind support, or if logind otherwise failed
(either too old, disabled/masked, or it is incomplete
systemd-shim/systemd-service implementation).
Yu Watanabe [Tue, 11 Sep 2018 03:42:18 +0000 (12:42 +0900)]
sd-device,libudev: make an argument for *_set_sysattr_value() const
Yu Watanabe [Fri, 24 Aug 2018 08:12:04 +0000 (17:12 +0900)]
libudev-monitor: use assert_return() in many places
Yu Watanabe [Fri, 24 Aug 2018 08:10:27 +0000 (17:10 +0900)]
libudev-monitor: add missing error checks in udev_monitor_enable_receiving()
Yu Watanabe [Fri, 24 Aug 2018 08:05:22 +0000 (17:05 +0900)]
libudev-monitor: introduce udev_monitor_send_sd_device()
And use it in udev_monitor_send_device().
Yu Watanabe [Fri, 24 Aug 2018 08:04:10 +0000 (17:04 +0900)]
libudev-monitor: re-implement udev_monitor_receive_sd_device()
Yu Watanabe [Fri, 24 Aug 2018 08:00:40 +0000 (17:00 +0900)]
libudev-monitor: use Hashmap or Set to store filters
Yu Watanabe [Fri, 24 Aug 2018 07:51:58 +0000 (16:51 +0900)]
libudev-monitor: use structured initializer
Yu Watanabe [Fri, 24 Aug 2018 07:47:30 +0000 (16:47 +0900)]
libudev-monitor: rename monitor_set_nl_address() and make it return negative errno
Yu Watanabe [Mon, 13 Aug 2018 08:59:44 +0000 (17:59 +0900)]
libudev-monitor: rename udev_has_devtmpfs() and move it to mount-util.c
As the function itself is quite generic.
Yu Watanabe [Fri, 24 Aug 2018 07:43:01 +0000 (16:43 +0900)]
libudev-monitor: use structured initializer in bpf_*()
This also drop inline attribute from the functions.
Yu Watanabe [Fri, 24 Aug 2018 07:40:47 +0000 (16:40 +0900)]
libudev-monitor: use 'unsigned' instead of 'unsigned int'
Yu Watanabe [Fri, 24 Aug 2018 07:11:13 +0000 (16:11 +0900)]
libudev-device: create sd_device at first in udev_device_new_from_*()
Yu Watanabe [Fri, 24 Aug 2018 05:44:01 +0000 (14:44 +0900)]
libudev-device: drop prototypes of unexistent functions
Yu Watanabe [Fri, 24 Aug 2018 05:43:43 +0000 (14:43 +0900)]
libudev: drop a prototype of unexistent function
Yu Watanabe [Fri, 24 Aug 2018 05:32:05 +0000 (14:32 +0900)]
libudev-device: coding style fixes
Yu Watanabe [Fri, 24 Aug 2018 05:31:41 +0000 (14:31 +0900)]
libudev-device: fix return value of udev_device_has_tag()
Yu Watanabe [Fri, 24 Aug 2018 05:30:24 +0000 (14:30 +0900)]
libudev-device: use original negative errno
Yu Watanabe [Fri, 24 Aug 2018 05:16:43 +0000 (14:16 +0900)]
libudev-device: use structured initializer
Yu Watanabe [Fri, 24 Aug 2018 05:09:17 +0000 (14:09 +0900)]
libudev-enumerate: use structured initializer
Yu Watanabe [Fri, 24 Aug 2018 04:57:58 +0000 (13:57 +0900)]
libudev-hwdb: use assert_return_errno()
Yu Watanabe [Fri, 24 Aug 2018 04:57:04 +0000 (13:57 +0900)]
libudev-hwdb: use structured initializer
Yu Watanabe [Fri, 24 Aug 2018 04:55:25 +0000 (13:55 +0900)]
libudev-hwdb: drop unused 'struct udev *udev' in udev_hwdb struct
Yu Watanabe [Fri, 24 Aug 2018 04:43:59 +0000 (13:43 +0900)]
libudev-queue: coding style fixes
Yu Watanabe [Fri, 24 Aug 2018 04:43:38 +0000 (13:43 +0900)]
libudev-queue: drop prototypes of nonexistent functions
Yu Watanabe [Fri, 24 Aug 2018 04:42:18 +0000 (13:42 +0900)]
libudev-queue: use _cleanup_ attribute and TAKE_FD()
Yu Watanabe [Fri, 24 Aug 2018 04:41:22 +0000 (13:41 +0900)]
libudev-queue: use assert_return()
Yu Watanabe [Fri, 24 Aug 2018 04:39:46 +0000 (13:39 +0900)]
libudev-queue: use structured initializer
Yu Watanabe [Tue, 28 Aug 2018 04:15:03 +0000 (13:15 +0900)]
libudev: modernize code a bit
Yu Watanabe [Tue, 28 Aug 2018 04:14:42 +0000 (13:14 +0900)]
libudev: use structured initializer
Yu Watanabe [Tue, 28 Aug 2018 04:14:02 +0000 (13:14 +0900)]
libudev: drop unused element in udev struct
Yu Watanabe [Tue, 28 Aug 2018 04:13:39 +0000 (13:13 +0900)]
libudev: drop outdated comments
Yu Watanabe [Tue, 28 Aug 2018 04:07:48 +0000 (13:07 +0900)]
libudev: use DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC() macro where applicable
Yu Watanabe [Tue, 28 Aug 2018 04:06:02 +0000 (13:06 +0900)]
libudev-monitor: use safe_close() in udev_monitor_disconnect()
Thomas Haller [Tue, 11 Sep 2018 00:45:48 +0000 (02:45 +0200)]
dhcp: fix assertion starting DHCP client without MAC address (#10054)
An assertion in dhcp_network_bind_raw_socket() is triggered when
starting an sd_dhcp_client without setting a MAC address first.
- sd_dhcp_client_start()
- client_start()
- client_start_delayed()
- dhcp_network_bind_raw_socket()
In that case, the arp-type and MAC address is still unset. Note that
dhcp_network_bind_raw_socket() already checks for a valid arp-type
and MAC address below, so we should just gracefully return -EINVAL.
Maybe sd_dhcp_client_start() should fail earlier when starting without
MAC address. But the failure here will be correctly propagated and
the start aborted.
Fixes:
76253e73f9c9c24fec755e485516f3b55d0707b4
Yu Watanabe [Tue, 11 Sep 2018 00:18:33 +0000 (09:18 +0900)]
test: make test-catalog relocatable
Fixes #10045.
Yu Watanabe [Tue, 11 Sep 2018 00:17:22 +0000 (09:17 +0900)]
test: introduce test_is_running_from_builddir()
Dariusz Gadomski [Mon, 10 Sep 2018 22:35:30 +0000 (00:35 +0200)]
hwdb: Update PNP IDs of Goldstar (now: LG Electronics). (#10051)
hwdb: Update PNP IDs of Goldstar (now: LG Electronics)
Franck Bui [Mon, 10 Sep 2018 12:17:32 +0000 (14:17 +0200)]
nspawn: always use mode 555 for /sys
When a network namespace is needed, /sys is mounted as tmpfs (see commit
d8fc6a000fe21b0c1ba27f for details).
But in this case mode 755 was used as initial permissions for /sys whereas the
default mode for sysfs is 555.
In practice using 755 doesn't have any impact because /sys is mounted read-only
too but for consistency, let's use the correct mode.
Fixes: #10050
Dimitri John Ledkov [Mon, 10 Sep 2018 18:54:12 +0000 (19:54 +0100)]
Revert "systemctl: if no logind, don't try to schedule shutdown"
This reverts commit
c68867da320de296917820e5a76e902a8a86be5a.
Dimitri John Ledkov [Mon, 10 Sep 2018 18:53:59 +0000 (19:53 +0100)]
Revert "systemctl: fix compilation w/o logind"
This reverts commit
807690fb7f7e4998e2bb67f32026ab9f1c7b8077.
Jürg Billeter [Sat, 18 Aug 2018 07:29:43 +0000 (09:29 +0200)]
pam_systemd: support use in PID namespaces
Pass 0 as leader PID to CreateSession to let logind use the PID from the
D-Bus credentials. This allows use of pam_systemd in PID namespaces.
Yu Watanabe [Wed, 22 Aug 2018 14:56:34 +0000 (23:56 +0900)]
udevadm-util: drop unused function print_version()
Yu Watanabe [Wed, 22 Aug 2018 14:52:52 +0000 (23:52 +0900)]
udevadm-info: make info_main() returns negative value on error
Also, this replaces fprintf(stderr, ...) by log_error().
Yu Watanabe [Wed, 22 Aug 2018 14:41:55 +0000 (23:41 +0900)]
udevadm-trigger: make trigger_main() returns negative value on error
Yu Watanabe [Tue, 21 Aug 2018 07:24:23 +0000 (16:24 +0900)]
udevadm-test: modernize code
Yu Watanabe [Tue, 21 Aug 2018 07:08:54 +0000 (16:08 +0900)]
udevadm-test-builtin: modernize code
Yu Watanabe [Wed, 22 Aug 2018 12:59:29 +0000 (21:59 +0900)]
udevadm-settle: modernize code
Yu Watanabe [Fri, 24 Aug 2018 12:55:47 +0000 (21:55 +0900)]
udevadm-monitor: modernize code
Yu Watanabe [Fri, 24 Aug 2018 12:55:19 +0000 (21:55 +0900)]
udevadm-control: modernize code a bit
Yu Watanabe [Tue, 21 Aug 2018 02:28:26 +0000 (11:28 +0900)]
udevadm-hwdb: modernize code a bit
Yu Watanabe [Wed, 22 Aug 2018 12:50:50 +0000 (21:50 +0900)]
strbuf: accept NULL for strbuf_cleanup()
Yu Watanabe [Tue, 21 Aug 2018 02:17:01 +0000 (11:17 +0900)]
udevadm: use dispatch_verb() and drop udevadm_cmd struct
Yu Watanabe [Tue, 28 Aug 2018 05:02:37 +0000 (14:02 +0900)]
udevd: drop unused refcount
Yu Watanabe [Tue, 28 Aug 2018 05:01:35 +0000 (14:01 +0900)]
udev-ctrl: use DEFINE_TRIVIAL_REF_FUNC() macro or friends
Yu Watanabe [Wed, 22 Aug 2018 10:57:32 +0000 (19:57 +0900)]
udev: drop unused udev struct
Yu Watanabe [Wed, 22 Aug 2018 10:57:07 +0000 (19:57 +0900)]
udev: drop unused udev_watch struct
Yu Watanabe [Wed, 22 Aug 2018 10:51:32 +0000 (19:51 +0900)]
libudev-util: adjust type of returned value by util_string_hash32()