platform/upstream/systemd.git
5 years agoMerge pull request #10894 from poettering/root-cgroup-fix
Lennart Poettering [Mon, 26 Nov 2018 13:13:01 +0000 (14:13 +0100)]
Merge pull request #10894 from poettering/root-cgroup-fix

A multitude of cgroup fixes

5 years agoupdate TODO
Lennart Poettering [Mon, 26 Nov 2018 12:41:07 +0000 (13:41 +0100)]
update TODO

5 years agotests: add a fuzzer for the udev rules parser (#10929)
Evgeny Vereshchagin [Mon, 26 Nov 2018 09:14:30 +0000 (12:14 +0300)]
tests: add a fuzzer for the udev rules parser (#10929)

5 years agoMerge pull request #10926 from AsciiWolf/copyright
Yu Watanabe [Mon, 26 Nov 2018 00:33:32 +0000 (09:33 +0900)]
Merge pull request #10926 from AsciiWolf/copyright

Drop my copyright

5 years agomkosi: drop my copyright
AsciiWolf [Sun, 25 Nov 2018 23:30:28 +0000 (00:30 +0100)]
mkosi: drop my copyright

5 years agopo: drop my copyright (cs.po)
AsciiWolf [Sun, 25 Nov 2018 23:26:03 +0000 (00:26 +0100)]
po: drop my copyright (cs.po)

5 years agohwdb: Add ACCEL_MOUNT_MATRIX for Trekstor T13B tablet
Marian Cepok [Sat, 24 Nov 2018 12:24:39 +0000 (13:24 +0100)]
hwdb: Add ACCEL_MOUNT_MATRIX for Trekstor T13B tablet

5 years agounits: order systemd-rfkill.socket after /var/lib/systemd/rfkill (#10904)
Lennart Poettering [Sat, 24 Nov 2018 14:59:37 +0000 (15:59 +0100)]
units: order systemd-rfkill.socket after /var/lib/systemd/rfkill (#10904)

Otherwise we might install the socket unit early, but the service
backing it late, and then end up in strange loops when we enter rescue
mode, because we saw an event on /dev/rfkill but really can't dispatch
it nor flush it.

Fixes: #9171

5 years agotests: skip test-execute on TravisCI under ASan
Evgeny Vereshchagin [Fri, 23 Nov 2018 17:26:02 +0000 (18:26 +0100)]
tests: skip test-execute on TravisCI under ASan

Unfortunately, f5f9a580dd4a3cf487b didn't help much and now
the next subtest gets stuck from time to time. Let's skip
test-execute altogether so as not to bother anybody with
spurious failures.

https://github.com/systemd/systemd/issues/10696 is still open.
Everybody is welcome to share ideas :-)

5 years agoFix a few docs typos (#10907)
nikolas [Fri, 23 Nov 2018 19:28:39 +0000 (14:28 -0500)]
Fix a few docs typos (#10907)

Found with [codespell](https://github.com/codespell-project/codespell)

5 years agoFix typo in hacking guide: "no possible" -> "not possible" (#10905)
nikolas [Fri, 23 Nov 2018 18:01:50 +0000 (13:01 -0500)]
Fix typo in hacking guide: "no possible" -> "not possible" (#10905)

5 years agoanalyze: Fix build without seccomp (#10899)
Michal Koutný [Fri, 23 Nov 2018 17:40:32 +0000 (18:40 +0100)]
analyze: Fix build without seccomp (#10899)

5 years agotests: add a fuzzer for server_process_native_file
Evgeny Vereshchagin [Thu, 22 Nov 2018 23:27:19 +0000 (00:27 +0100)]
tests: add a fuzzer for server_process_native_file

5 years agodhcp6-client: handle IAID with value zero
Thomas Haller [Fri, 23 Nov 2018 12:42:13 +0000 (13:42 +0100)]
dhcp6-client: handle IAID with value zero

config_parse_iaid(), dhcp_identifier_set_iaid() and sd_dhcp6_client_set_iaid() all
allow for the IAID to be zero. Also, RFC 3315 makes no mention that zero
would be invalid.

However, client_ensure_iaid() would take an IAID of zero as a sign that
the values was unset. Fix that by keeping track whether IAID is
initialized.

5 years agoMerge pull request #10887 from poettering/run-love
Lennart Poettering [Fri, 23 Nov 2018 15:00:16 +0000 (16:00 +0100)]
Merge pull request #10887 from poettering/run-love

systemd-run: modernizations, some new switches and let's set $INVOCATION_ID

5 years agoMerge pull request #10893 from keszybz/udev-cleanup-followup
Yu Watanabe [Fri, 23 Nov 2018 14:48:44 +0000 (23:48 +0900)]
Merge pull request #10893 from keszybz/udev-cleanup-followup

Udev cleanup follow-ups

5 years agotest: extend testcase to ensure controller membership doesn't regress
Lennart Poettering [Fri, 23 Nov 2018 00:15:19 +0000 (01:15 +0100)]
test: extend testcase to ensure controller membership doesn't regress

5 years agocgroup: when we unload a unit, also update all its parent's members mask
Lennart Poettering [Fri, 23 Nov 2018 00:13:47 +0000 (01:13 +0100)]
cgroup: when we unload a unit, also update all its parent's members mask

This way we can corectly ensure that when a unit that requires some
controller goes away, we propagate the removal of it all the way up, so
that the controller is turned off in all the parents too.

5 years agocgroup: drastically simplify caching of cgroups members mask
Lennart Poettering [Fri, 23 Nov 2018 00:07:34 +0000 (01:07 +0100)]
cgroup: drastically simplify caching of cgroups members mask

Previously we tried to be smart: when a new unit appeared and it only
added controllers to the cgroup mask we'd update the cached members mask
in all parents by ORing in the controller flags in their cached values.
Unfortunately this was quite broken, as we missed some conditions when
this cache had to be reset (for example, when a unit got unloaded),
moreover the optimization doesn't work when a controller is removed
anyway (as in that case there's no other way for the parent to iterate
though all children if any other, remaining child unit still needs it).
Hence, let's simplify the logic substantially: instead of updating the
cache on the right events (which we didn't get right), let's simply
invalidate the cache, and generate it lazily when we encounter it later.
This should actually result in better behaviour as we don't have to
calculate the new members mask for a whole subtree whever we have the
suspicion something changed, but can delay it to the point where we
actually need the members mask.

This allows us to simplify things quite a bit, which is good, since
validating this cache for correctness is hard enough.

Fixes: #9512

5 years agocgroup: extend comment on what unit_release_cgroup() is for
Lennart Poettering [Fri, 23 Nov 2018 00:07:14 +0000 (01:07 +0100)]
cgroup: extend comment on what unit_release_cgroup() is for

5 years agocgroup: extend reasons when we realize the enable mask
Lennart Poettering [Fri, 23 Nov 2018 00:03:18 +0000 (01:03 +0100)]
cgroup: extend reasons when we realize the enable mask

After creating a cgroup we need to initialize its
"cgroup.subtree_control" file with the controllers its children want to
use. Currently we do so whenever the mkdir() on the cgroup succeeded,
i.e. when we know the cgroup is "fresh". Let's update the condition
slightly that we also do so when internally we assume a cgroup doesn't
exist yet, even if it already does (maybe left-over from a previous
run).

This shouldn't change anything IRL but make things a bit more robust.

5 years agocgroup: tighten call that detects whether we need to realize a unit's cgroup a bit...
Lennart Poettering [Fri, 23 Nov 2018 00:02:17 +0000 (01:02 +0100)]
cgroup: tighten call that detects whether we need to realize a unit's cgroup a bit, and comment why

5 years agocgroup: document what the various masks variables are used for
Lennart Poettering [Thu, 22 Nov 2018 23:49:31 +0000 (00:49 +0100)]
cgroup: document what the various masks variables are used for

5 years agocgroup: extend cg_mask_supported() comment a bit
Lennart Poettering [Thu, 22 Nov 2018 23:48:31 +0000 (00:48 +0100)]
cgroup: extend cg_mask_supported() comment a bit

5 years agocgroup: simplify check whether it makes sense to realize a cgroup
Lennart Poettering [Thu, 22 Nov 2018 21:11:07 +0000 (22:11 +0100)]
cgroup: simplify check whether it makes sense to realize a cgroup

5 years agocgroup: in unit_invalidate_cgroup() actually modify invalidation mask
Lennart Poettering [Thu, 22 Nov 2018 21:02:53 +0000 (22:02 +0100)]
cgroup: in unit_invalidate_cgroup() actually modify invalidation mask

Previously this would manipulate the realization mask for invalidating
the realization. This is a bit ugly though as the realization mask's
primary purpose to is to reflect in which hierarchies a cgroup currently
exists, and it's probably a good idea to keep that in sync with
realities.

We nowadays have the an explicit fields for invalidating cgroup
controller information, the "cgroup_invalidated_mask", let's use this
one instead.

The effect is pretty much the same, as the main consumer of these masks
(unit_has_mask_realize()) checks both anyway.

5 years agocgroup: be more careful with which controllers we can enable/disable on a cgroup
Lennart Poettering [Thu, 22 Nov 2018 20:45:33 +0000 (21:45 +0100)]
cgroup: be more careful with which controllers we can enable/disable on a cgroup

This changes cg_enable_everywhere() to return which controllers are
enabled for the specified cgroup. This information is then used to
correctly track the enablement mask currently in effect for a unit.
Moreover, when we try to turn off a controller, and this works, then
this is indicates that the parent unit might succesfully turn it off
now, too as our unit might have kept it busy.

So far, when realizing cgroups, i.e. when syncing up the kernel
representation of relevant cgroups with our own idea we would strictly
work from the root to the leaves. This is generally a good approach, as
when controllers are enabled this has to happen in root-to-leaves order.
However, when controllers are disabled this has to happen in the
opposite order: in leaves-to-root order (this is because controllers can
only be enabled in a child if it is already enabled in the parent, and
if it shall be disabled in the parent then it has to be disabled in the
child first, otherwise it is considered busy when it is attempted to
remove it in the parent).

To make things complicated when invalidating a unit's cgroup membershup
systemd can actually turn off some controllers previously turned on at
the very same time as it turns on other controllers previously turned
off. In such a case we have to work up leaves-to-root *and*
root-to-leaves right after each other. With this patch this is
implemented: we still generally operate root-to-leaves, but as soon as
we noticed we successfully turned off a controller previously turned on
for a cgroup we'll re-enqueue the cgroup realization for all parents of
a unit, thus implementing leaves-to-root where necessary.

5 years agopid1,sd-device: use PATH_STARTSWITH_SET more
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:24:26 +0000 (09:24 +0100)]
pid1,sd-device: use PATH_STARTSWITH_SET more

5 years agobasic/path-util: add missing header
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:23:19 +0000 (09:23 +0100)]
basic/path-util: add missing header

PATH_STARTSWITH_SET uses STRV_FOREACH...

5 years agorun: set $INVOCATION_ID for scope units
Lennart Poettering [Thu, 22 Nov 2018 19:40:00 +0000 (20:40 +0100)]
run: set $INVOCATION_ID for scope units

Services invoked by PID1 have $INVOCATION_ID initialized, hence let's do
that for scope units (where the payload process is invoked by us on the
client side) too, to minimize needless differences.

Fixes: #8082

5 years agorun: port to static destructors
Lennart Poettering [Thu, 22 Nov 2018 18:34:15 +0000 (19:34 +0100)]
run: port to static destructors

5 years agorun: port to DEFINE_MAIN_FUNCTION()
Lennart Poettering [Thu, 22 Nov 2018 18:30:03 +0000 (19:30 +0100)]
run: port to DEFINE_MAIN_FUNCTION()

5 years agorun: add new --shell switch for spawning a shell as service
Lennart Poettering [Thu, 22 Nov 2018 18:24:48 +0000 (19:24 +0100)]
run: add new --shell switch for spawning a shell as service

I keep running "systemd-run -t /bin/bash" to quickly get a shell running
in service context. I suspect I am not the only one, hence let's add a
shortcut for it. While we are at it, let's make it smarter, and
automatically inherit the $SHELL of the invoking user as well as the
working directory, and let's imply --pty. --shell (or -S) is hence
equivalent to "-t -d $SHELL".

5 years agorun: add a switch for specifiying the working directory of a service
Lennart Poettering [Thu, 22 Nov 2018 11:07:25 +0000 (12:07 +0100)]
run: add a switch for specifiying the working directory of a service

I find myself testing service management quite often with "systemd-run
-t /bin/bash". For that it is handy if the invoked shell would use the
working directory I am currently in. Hence introduce a shorthand for
that:

        $ systemd-run -dt /bin/bash

This will automatically insert a WorkingDirectory= property into the
transient service, pointing to the working directory of the caller.

5 years agocgroup: tweak log message, so that it doesn't claim we always enable controllers...
Lennart Poettering [Thu, 22 Nov 2018 11:02:13 +0000 (12:02 +0100)]
cgroup: tweak log message, so that it doesn't claim we always enable controllers when we actually disable them

5 years agocgroup: propagate errors when we cannot open cgroup.subtree_control
Lennart Poettering [Thu, 22 Nov 2018 11:01:32 +0000 (12:01 +0100)]
cgroup: propagate errors when we cannot open cgroup.subtree_control

5 years agocgroup: add explanatory comment
Lennart Poettering [Wed, 21 Nov 2018 17:27:15 +0000 (18:27 +0100)]
cgroup: add explanatory comment

5 years agocgroup: units that aren't loaded properly should not result in cgroup controllers...
Lennart Poettering [Wed, 21 Nov 2018 17:25:37 +0000 (18:25 +0100)]
cgroup: units that aren't loaded properly should not result in cgroup controllers being pulled in

This shouldn't make much difference in real life, but is a bit cleaner.

5 years agocgroup: dump delegation mask too
Lennart Poettering [Wed, 21 Nov 2018 16:48:41 +0000 (17:48 +0100)]
cgroup: dump delegation mask too

5 years agocgroup: make unit_get_needs_bpf_firewall() static too
Lennart Poettering [Wed, 21 Nov 2018 16:44:14 +0000 (17:44 +0100)]
cgroup: make unit_get_needs_bpf_firewall() static too

5 years agocgroup: make some functions static
Lennart Poettering [Wed, 21 Nov 2018 16:42:40 +0000 (17:42 +0100)]
cgroup: make some functions static

5 years agocgroup: fine tune when to apply cgroup attributes to the root cgroup
Lennart Poettering [Tue, 20 Nov 2018 22:05:12 +0000 (23:05 +0100)]
cgroup: fine tune when to apply cgroup attributes to the root cgroup

Let's tweak when precisely to apply cgroup attributes on the root
cgroup.

With this we now follow the following rules:

1. On cgroupsv2 we never apply any regular cgroups to the host root,
   since the attributes generally do not exist there.

2. On cgroupsv1 we do not apply any "weight" or "shares" style
   attributes to the host root cgroup, since they don't make much sense
   on the top level where there's only one group, hence no need to
   compare weights against each other. The other attributes are applied
   to the host root cgroup however.

3. In any case we don't apply attributes to the root of container
   environments (and --user roots), under the assumption that this is
   managed by the manager further up. (Note that on cgroupsv2 this is
   even enforced by the kernel)

4. BPF pseudo-attributes are applied in all cases (since we can have as
   many of them as we want)

5 years agocgroup: append \n to static strings we write to cgroup attributes
Lennart Poettering [Tue, 20 Nov 2018 21:50:13 +0000 (22:50 +0100)]
cgroup: append \n to static strings we write to cgroup attributes

This is a bit cleaner since we when we format numeric limits we append
it. And this way write_string_file() doesn't have to append it.

5 years agocgroup: tighten manager_owns_host_root_cgroup() a bit
Lennart Poettering [Tue, 20 Nov 2018 21:46:03 +0000 (22:46 +0100)]
cgroup: tighten manager_owns_host_root_cgroup() a bit

This tightening is not strictly necessary (as the m->cgroup_root check
further down does the same), but let's make this explicit.

5 years agocgroup: rename {manager_owns|unit_has}_root_cgroup() → .._host_root_cgroup()
Lennart Poettering [Tue, 20 Nov 2018 21:42:16 +0000 (22:42 +0100)]
cgroup: rename {manager_owns|unit_has}_root_cgroup() → .._host_root_cgroup()

Let's emphasize that this function checks for the host root cgroup, i.e.
returns false for the root cgroup when we run in a container where
CLONE_NEWCGROUP is used. There has been some confusion around this
already, for example cgroup_context_apply() uses the function
incorrectly (which we'll fix in a later commit).

Just some refactoring, not change in behaviour.

5 years agocgroup: add a common routine for writing to attributes, and logging about it
Lennart Poettering [Tue, 20 Nov 2018 19:19:58 +0000 (20:19 +0100)]
cgroup: add a common routine for writing to attributes, and logging about it

We can use this at quite a few places, and this allows us to shorten our
code quite a bit.

5 years agocgroup: add a new macro for determining log level for cgroup attr write failures
Lennart Poettering [Tue, 20 Nov 2018 19:18:07 +0000 (20:18 +0100)]
cgroup: add a new macro for determining log level for cgroup attr write failures

For now, let's use it only at one place, but a follow-up commit will
make more use of it.

5 years agocgroup: ignore EPERM for a couple of more attribute writes
Lennart Poettering [Tue, 20 Nov 2018 19:16:03 +0000 (20:16 +0100)]
cgroup: ignore EPERM for a couple of more attribute writes

5 years agocgroup: add comment explaining why we ignore EINVAL at two places
Lennart Poettering [Tue, 20 Nov 2018 19:14:59 +0000 (20:14 +0100)]
cgroup: add comment explaining why we ignore EINVAL at two places

These are just copies from further down.

5 years agocgroup: suffix settings with "=" in log messages where appropriate
Lennart Poettering [Tue, 20 Nov 2018 18:48:43 +0000 (19:48 +0100)]
cgroup: suffix settings with "=" in log messages where appropriate

5 years agocgroup: only install cgroup release agent when we own the root cgroup
Lennart Poettering [Tue, 20 Nov 2018 18:45:09 +0000 (19:45 +0100)]
cgroup: only install cgroup release agent when we own the root cgroup

If we run in a container we shouldn't patch around this, and most likely
we can't anyway, and there's not much point in complaining about this.
Hence let's strictly say: the agent is private property of the host's
system instance, nothing else.

5 years agocgroup: use structured initialization
Lennart Poettering [Tue, 20 Nov 2018 18:45:02 +0000 (19:45 +0100)]
cgroup: use structured initialization

5 years agolibudev: drop unnecessary check
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:16:11 +0000 (09:16 +0100)]
libudev: drop unnecessary check

sd_device_get_subsystem returns -ENOENT if subsystem is not set.

5 years agoMerge pull request #10861 from yuwata/udev-list-cleanups
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 08:12:56 +0000 (09:12 +0100)]
Merge pull request #10861 from yuwata/udev-list-cleanups

libudev: several cleanups for udev-list

5 years agoMerge pull request #10886 from yuwata/sd-device-monitor-fix-filter
Zbigniew Jędrzejewski-Szmek [Fri, 23 Nov 2018 07:53:33 +0000 (08:53 +0100)]
Merge pull request #10886 from yuwata/sd-device-monitor-fix-filter

sd-device: fix subsystem filter

5 years agounit: minor optimization, use stack over heap, when we can
Lennart Poettering [Wed, 21 Nov 2018 15:43:40 +0000 (16:43 +0100)]
unit: minor optimization, use stack over heap, when we can

5 years ago70-mouse.hwdb: Set DPI for MS Classic IntelliMouse
Daniel van Vugt [Thu, 22 Nov 2018 06:06:46 +0000 (14:06 +0800)]
70-mouse.hwdb: Set DPI for MS Classic IntelliMouse

It defaults to 3200 DPI and 1000 Hz. Note the ?? is required to
match the multibyte UTF-8 character '®'.

5 years agoMerge pull request #10891 from yuwata/use-main-macro-2
Lennart Poettering [Thu, 22 Nov 2018 23:46:02 +0000 (00:46 +0100)]
Merge pull request #10891 from yuwata/use-main-macro-2

tree-wide: use recently introduced macros

5 years agounit: drop an unused fields from Unit struct
Lennart Poettering [Wed, 21 Nov 2018 16:06:19 +0000 (17:06 +0100)]
unit: drop an unused fields from Unit struct

5 years agotest: add more tests for subsystem filter
Yu Watanabe [Thu, 22 Nov 2018 17:47:51 +0000 (02:47 +0900)]
test: add more tests for subsystem filter

5 years agocore: add two minor comments (#10890)
Lennart Poettering [Thu, 22 Nov 2018 21:25:27 +0000 (22:25 +0100)]
core: add two minor comments (#10890)

5 years agolocale: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 21:15:33 +0000 (06:15 +0900)]
locale: define main through macro

5 years agolocale: store polkit_registry in Context
Yu Watanabe [Thu, 22 Nov 2018 21:12:55 +0000 (06:12 +0900)]
locale: store polkit_registry in Context

5 years agolocale: rename context_free() to context_clear()
Yu Watanabe [Thu, 22 Nov 2018 21:12:45 +0000 (06:12 +0900)]
locale: rename context_free() to context_clear()

5 years agoresolvectl: use static destructor and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 21:00:02 +0000 (06:00 +0900)]
resolvectl: use static destructor and define main through macro

5 years agorfkill: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 20:55:10 +0000 (05:55 +0900)]
rfkill: define main through macro

5 years agorfkill: store write queue and rfkill fd in struct Context
Yu Watanabe [Thu, 22 Nov 2018 20:54:44 +0000 (05:54 +0900)]
rfkill: store write queue and rfkill fd in struct Context

5 years agosocket-proxy: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 20:11:31 +0000 (05:11 +0900)]
socket-proxy: define main through macro

5 years agosysusers: use ordered_hashmap_steal_first_key_and_value()
Yu Watanabe [Thu, 22 Nov 2018 20:04:32 +0000 (05:04 +0900)]
sysusers: use ordered_hashmap_steal_first_key_and_value()

5 years agotime-wait: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:55:17 +0000 (04:55 +0900)]
time-wait: define main through macro

5 years agotimedate: define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:47:12 +0000 (04:47 +0900)]
timedate: define main through macro

5 years agoupdate-done: quit earlier on failure
Yu Watanabe [Thu, 22 Nov 2018 19:40:22 +0000 (04:40 +0900)]
update-done: quit earlier on failure

5 years agoupdate-utmp: use _cleanup_ attribute to finalize process
Yu Watanabe [Thu, 22 Nov 2018 19:38:06 +0000 (04:38 +0900)]
update-utmp: use _cleanup_ attribute to finalize process

5 years agoveritysetup-generator: use static destructors and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:27:09 +0000 (04:27 +0900)]
veritysetup-generator: use static destructors and define main through macro

5 years agoveritysetup-generator: make arg_dest const
Yu Watanabe [Thu, 22 Nov 2018 19:23:27 +0000 (04:23 +0900)]
veritysetup-generator: make arg_dest const

5 years agoveritysetup: use static destructors and define main through macro
Yu Watanabe [Thu, 22 Nov 2018 19:21:08 +0000 (04:21 +0900)]
veritysetup: use static destructors and define main through macro

This also changes the return value when crypt_init_by_name() fails in 'detach'.

5 years agotests: add a fuzzer for catalog_import_file
Evgeny Vereshchagin [Thu, 22 Nov 2018 16:09:20 +0000 (17:09 +0100)]
tests: add a fuzzer for catalog_import_file

5 years agoman: update description of Description=
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 16:05:33 +0000 (17:05 +0100)]
man: update description of Description=

The way this is used drifted a bit from the original intent. Let's update
the description and add some examples to inspire people to texts that look
less bad during initial boot.

5 years agoMerge pull request #10884 from yuwata/udev-debug
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 19:47:33 +0000 (20:47 +0100)]
Merge pull request #10884 from yuwata/udev-debug

meson: add more debug options

5 years agosd-device-monitor: fix subsystem filter
Yu Watanabe [Thu, 22 Nov 2018 16:24:34 +0000 (01:24 +0900)]
sd-device-monitor: fix subsystem filter

This fixes a bug introduced by 759d9f3f8d07af2940bb3783acc3985ee47adfa5.

Fixes #10882.

5 years agoudev-rules: update log messages
Yu Watanabe [Thu, 22 Nov 2018 16:02:10 +0000 (01:02 +0900)]
udev-rules: update log messages

5 years agomeson: also add option for debugging siphash
Yu Watanabe [Thu, 22 Nov 2018 15:36:35 +0000 (00:36 +0900)]
meson: also add option for debugging siphash

5 years agomeson: add option for debugging udev
Yu Watanabe [Thu, 22 Nov 2018 15:28:27 +0000 (00:28 +0900)]
meson: add option for debugging udev

5 years agoudev-rules: trivial coding style cleanups
Yu Watanabe [Thu, 22 Nov 2018 15:22:09 +0000 (00:22 +0900)]
udev-rules: trivial coding style cleanups

5 years agoudev: rename udev_rules_unref() to udev_rules_free()
Yu Watanabe [Thu, 22 Nov 2018 15:07:32 +0000 (00:07 +0900)]
udev: rename udev_rules_unref() to udev_rules_free()

As udev_rules do not have a reference counter.

5 years agolibudev: do not ignore error in udev_list_entry_add()
Yu Watanabe [Thu, 22 Nov 2018 14:46:43 +0000 (23:46 +0900)]
libudev: do not ignore error in udev_list_entry_add()

5 years agolibudev: introduce return_with_errno() and use it where applicable
Yu Watanabe [Wed, 21 Nov 2018 05:06:41 +0000 (14:06 +0900)]
libudev: introduce return_with_errno() and use it where applicable

5 years agotest: add tests for libudev-list
Yu Watanabe [Wed, 21 Nov 2018 04:43:55 +0000 (13:43 +0900)]
test: add tests for libudev-list

5 years agolibudev-list: drop unused udev argument from udev_list_init()
Yu Watanabe [Wed, 21 Nov 2018 04:09:59 +0000 (13:09 +0900)]
libudev-list: drop unused udev argument from udev_list_init()

5 years agolibudev-list: drop unused private functions
Yu Watanabe [Wed, 21 Nov 2018 04:06:17 +0000 (13:06 +0900)]
libudev-list: drop unused private functions

5 years agoMerge pull request #10871 from keszybz/more-cleanup-2
Yu Watanabe [Thu, 22 Nov 2018 14:16:43 +0000 (23:16 +0900)]
Merge pull request #10871 from keszybz/more-cleanup-2

Allow "synthetic" errno to be used in log calls

5 years agosysctl: when debug logging about sysctl changes, truncate trailing newline
Lennart Poettering [Tue, 20 Nov 2018 23:07:43 +0000 (00:07 +0100)]
sysctl: when debug logging about sysctl changes, truncate trailing newline

5 years agobasic/log: add note about operator precendence
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 09:56:43 +0000 (10:56 +0100)]
basic/log: add note about operator precendence

5 years agoCODING_STYLE: describe log & return operations
Zbigniew Jędrzejewski-Szmek [Thu, 22 Nov 2018 09:39:31 +0000 (10:39 +0100)]
CODING_STYLE: describe log & return operations

5 years agoAlso drop a few more unnecessary uses of synthethic errno
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 23:51:29 +0000 (00:51 +0100)]
Also drop a few more unnecessary uses of synthethic errno

5 years agococcinelle: also mark previous synthetic errnos as such
Zbigniew Jędrzejewski-Szmek [Wed, 21 Nov 2018 07:23:20 +0000 (08:23 +0100)]
coccinelle: also mark previous synthetic errnos as such

5 years agococcinelle: make use of SYNTHETIC_ERRNO
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 22:40:44 +0000 (23:40 +0100)]
coccinelle: make use of SYNTHETIC_ERRNO

Ideally, coccinelle would strip unnecessary braces too. But I do not see any
option in coccinelle for this, so instead, I edited the patch text using
search&replace to remove the braces. Unfortunately this is not fully automatic,
in particular it didn't deal well with if-else-if-else blocks and ifdefs, so
there is an increased likelikehood be some bugs in such spots.

I also removed part of the patch that coccinelle generated for udev, where we
returns -1 for failure. This should be fixed independently.

5 years agobasic/log: add concept of "synthethic errnos"
Zbigniew Jędrzejewski-Szmek [Tue, 20 Nov 2018 22:03:40 +0000 (23:03 +0100)]
basic/log: add concept of "synthethic errnos"

Synthetic errnos are processed like normal, and may be used in %m and become
the return value from log_*(), but they are not logged in the journal.

5 years agovconsole: Don't skip udev call for dummy device
Tim Ruffing [Wed, 21 Nov 2018 20:41:15 +0000 (21:41 +0100)]
vconsole: Don't skip udev call for dummy device

Kernel 4.19 supports deferred console takeover [0], i.e., fbcon will
take over the console only when the first text is displayed on the
console. Before that event, only the dummy console is active. Our
currently udev rules call systemd-vconsole on every vtcon except for
dummy consoles. Thus the exception for dummy consoles prevents a call
to systemd-vconsole when no text is displayed on the console, and as a
consequence, the keymap will not be set in that case. This is wrong and
leads to issues when keyboard input is expected without text on the
console, e.g., when a graphical password prompt is used in the boot
process.

This reverts commit 6b169c13ecf645a0a341f49b9dc2afb312a74206,
which introduced the exception for dummy devices to save unnecessary
udev calls.

Fixes #10826.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83d83bebf40132e2d55ec58af666713cc76f9764

5 years agobasic/user-util: properly protect use of gshadow
Yann E. MORIN [Wed, 21 Nov 2018 17:09:04 +0000 (18:09 +0100)]
basic/user-util: properly protect use of gshadow

Commit 100d5f6ee6 (user-util: add new wrappers for [...] database
files), ammended by commit 4f07ffa8f5 (Use #if instead of #ifdef for
ENABLE_GSHADOW) moved code from sysuser to basic/user-util.

In doing so, the combination of both commits properly propagated the
ENABLE_GSHADOW conditions around the function manipulating gshadow, but
they forgot to protect the inclusion of the gshadow.h header.

Fix that to be able to build on C libraries that do not provide gshadow
(e.g. uClibc-ng, where it does not exist.)