]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agotest-hostname-util: add assert_se's to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:54:38 +0000 (21:54 +0000)] 
test-hostname-util: add assert_se's to make coverity happy

6 years agotest-process-util: add (void) cast to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:52:32 +0000 (21:52 +0000)] 
test-process-util: add (void) cast to make coverity happy

The intent is for the call to succeed only when privileged, so make
that clear.

6 years agotest-fd-util: add assert_se to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:51:11 +0000 (21:51 +0000)] 
test-fd-util: add assert_se to make coverity happy

6 years agoudevadm-monitor: add some assert_se's to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 21:48:46 +0000 (21:48 +0000)] 
udevadm-monitor: add some assert_se's to make coverity happy

We do that elsewhere and it's nice to be consistent.

6 years agocore/umount: use _cleanup_ in one more place
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 16:13:04 +0000 (16:13 +0000)] 
core/umount: use _cleanup_ in one more place

6 years agosd-resolve: check that name fits in the specified packet length
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:54:55 +0000 (13:54 +0000)] 
sd-resolve: check that name fits in the specified packet length

Coverity complained that we didn't check if the data is long enough.

6 years agoshim: fix logically dead code
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:31:46 +0000 (13:31 +0000)] 
shim: fix logically dead code

The alternate verification path could never be taken.

Found by coverity.

6 years agonetworkd: remove dead code
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 13:25:08 +0000 (13:25 +0000)] 
networkd: remove dead code

Found by coverity.

6 years agotest-ndisc-ra: add assert_se() to make coverity happy
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:47:52 +0000 (12:47 +0000)] 
test-ndisc-ra: add assert_se() to make coverity happy

6 years agoboot/shim: fix char ** vs char * mismatch
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:36:21 +0000 (12:36 +0000)] 
boot/shim: fix char ** vs char * mismatch

This code cannot have ever worked ;(

Found by coverity, obvious when the type is not obfuscated to void*.

6 years agoboot/efi: fix NULL dereference
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:22:56 +0000 (12:22 +0000)] 
boot/efi: fix NULL dereference

The comment above makes the intent of the code pretty clear:
"use security2_protocol == NULL as indicator".
So revert the condition in the check and fix the logic in the comment while
at it.

The question is how this could have ever worked: if BS->LocateProtocol
(which is supposedly optional) ever failed, we'd crash here. Strange.

Found by coverity.

6 years agodissect-image: simplify check for passphrase presence
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:16:09 +0000 (12:16 +0000)] 
dissect-image: simplify check for passphrase presence

m->encrypted is set when fstype=="crypto_LUKS", but this is not obvious when
reading decrypt_partition(). Just check if passphrase is set before using
it.

6 years agonetworkd: fix reversed arguments
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:08:37 +0000 (12:08 +0000)] 
networkd: fix reversed arguments

Found by coverity.

Also drop unused return value while at it.

6 years agonetworkd: plug some memleaks in rule serialization/deserialization
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 12:01:41 +0000 (12:01 +0000)] 
networkd: plug some memleaks in rule serialization/deserialization

This fixes the (mostly theoretical, since we're only parsing data that we write
ourselves) memleak when iif or oif is deserialized multiple times. Unfortunately
it does not fix the memleak when rule is freed, but that'll require a bigger
effort.

6 years agonetworkd: fix serialization of {Incoming,Outgoing}Interface
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:51:08 +0000 (11:51 +0000)] 
networkd: fix serialization of {Incoming,Outgoing}Interface

Let's just say that the code wasn't fully functional ;(

Since we only had the parser for serialization, and not the writer, we are
free to change the format. So while at it, let's use shorter names in the
serialization format that match the surrounding style.

6 years agoAdd test-routing-policy-rule
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:38:24 +0000 (11:38 +0000)] 
Add test-routing-policy-rule

6 years agotest-network: use automatic cleanup
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:23:31 +0000 (11:23 +0000)] 
test-network: use automatic cleanup

6 years agonetworkd: parse the rvalue, not the option name
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 11:21:19 +0000 (11:21 +0000)] 
networkd: parse the rvalue, not the option name

:(

6 years agonetworkd: move rule loading to a separate function
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 10:22:51 +0000 (10:22 +0000)] 
networkd: move rule loading to a separate function

No functional change.

6 years agonetworkd: unbork rule serialization
Zbigniew Jędrzejewski-Szmek [Mon, 27 Nov 2017 10:06:55 +0000 (10:06 +0000)] 
networkd: unbork rule serialization

We'd write something like

RULE=from=250.250.240.0/24 to=(null)/0 tos=0 fwmark=0/0 table=12
RULE=from=250.250.250.0/24 to=(null)/0 tos=0 fwmark=0/0 table=11

6 years agologind: make sure we don't acces m->action_what if it's not initialized (#7475)
Lennart Poettering [Mon, 27 Nov 2017 07:15:07 +0000 (08:15 +0100)] 
logind: make sure we don't acces m->action_what if it's not initialized (#7475)

Fixes: #7466
6 years agoMerge pull request #7472 from keszybz/tests-on-a-slow-disk
Lennart Poettering [Sun, 26 Nov 2017 17:37:00 +0000 (18:37 +0100)] 
Merge pull request #7472 from keszybz/tests-on-a-slow-disk

Tests on a slow disk

6 years agonetworkd: DHCP client do not get into a loop while setting MTU (#7460)
Susant Sahani [Sun, 26 Nov 2017 14:21:45 +0000 (19:51 +0530)] 
networkd: DHCP client do not get into a loop while setting MTU (#7460)

Some devices get reset itself while setting the MTU. we get in to a LOOP .
Once the MTU changed then the DHCP client talking with DHCP server never stops.
networkd gets into a loop and generates endless DHCP requests.

fixes #6593
fixes #7380

6 years agotest: increase the timeout for hwdb-test 7472/head
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 12:20:08 +0000 (13:20 +0100)] 
test: increase the timeout for hwdb-test

This test does a lot of mmap/madvise/unmmap, which is slow under address sanitizer.
Just increase the timeout to avoid spurious failure.

6 years agotest: increase timeout for test-journal-enum
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 12:18:45 +0000 (13:18 +0100)] 
test: increase timeout for test-journal-enum

This reads the journal from the host system, and in case of a slow
disk, the 30s default can be easily exceeded.

6 years agoexec-util: initialize `new` before using it (#7471)
Evgeny Vereshchagin [Sun, 26 Nov 2017 11:46:56 +0000 (14:46 +0300)] 
exec-util: initialize `new` before using it (#7471)

CID #1383004

6 years agoMerge pull request #7464 from poettering/cgroup-control-fix
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 10:34:24 +0000 (11:34 +0100)] 
Merge pull request #7464 from poettering/cgroup-control-fix

various cgroup fixes

6 years agoMerge pull request #7468 from yuwata/fix-7362
Yu Watanabe [Sun, 26 Nov 2017 03:35:07 +0000 (12:35 +0900)] 
Merge pull request #7468 from yuwata/fix-7362

test and meson cleanups

6 years agoMerge pull request #7467 from yuwata/fix-7302
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2017 22:13:12 +0000 (23:13 +0100)] 
Merge pull request #7467 from yuwata/fix-7302

nspawn: adjust path to static resolv.conf to support split usr

6 years agofileio: include sys/mman.h 7468/head
Yu Watanabe [Sat, 25 Nov 2017 17:40:23 +0000 (02:40 +0900)] 
fileio: include sys/mman.h

6 years agomeson: update header file to detect memfd_create()
Yu Watanabe [Sat, 25 Nov 2017 17:17:06 +0000 (02:17 +0900)] 
meson: update header file to detect memfd_create()

6 years agoupdate TODO 7464/head
Lennart Poettering [Fri, 24 Nov 2017 17:29:29 +0000 (18:29 +0100)] 
update TODO

6 years agocore: warn about left-over processes in cgroup on unit start
Lennart Poettering [Fri, 24 Nov 2017 21:02:22 +0000 (22:02 +0100)] 
core: warn about left-over processes in cgroup on unit start

Now that we don't kill control processes anymore, let's at least warn
about any processes left-over in the unit cgroup at the moment of
starting the unit.

6 years agocore: generalize the cgroup empty check on GC
Lennart Poettering [Fri, 24 Nov 2017 19:27:01 +0000 (20:27 +0100)] 
core: generalize the cgroup empty check on GC

Let's move the cgroup empty check for all unit types into the generic
unit_check_gc() call, out of the per-unit-type _check_gc() type. This
not only allows us to share some code, but also hooks up mount and
socket units with this kind of check, for free, as it was missing there
previously.

6 years agocgroup: remove logic for maintaining /control subcgroup for the service unit type
Lennart Poettering [Fri, 24 Nov 2017 19:11:27 +0000 (20:11 +0100)] 
cgroup: remove logic for maintaining /control subcgroup for the service unit type

Previously, in the service unit type we ran all control processes in a
special subcgroup /control of the unit's main cgroup. Remove that, and
run the control program in the main cgroup instead.

The concept conflicts with cgroupv2's logic of "no processes in inner
nodes": if a unit has a main daemon process running in the main cgroup,
and a reload control process would be started in the /control subcgroup,
then this would necessarily fail, as the main daemon process would
become an inner node process that way.

We could in theory continue to support this in cgroupv1, but in the
interest in keeping behaviour similar in both hierarchies, let's drop
this altogether.

Philosophically maybe it wasn't the greatest idea anyway to just go
berserk and SIGKILL all those processes — loud warning logging might
have sufficed, too.

6 years agounit: initialize bpf cgroup realization state properly
Lennart Poettering [Fri, 24 Nov 2017 18:51:36 +0000 (19:51 +0100)] 
unit: initialize bpf cgroup realization state properly

Before this patch, the bpf cgroup realization state was implicitly set
to "NO", meaning that the bpf configuration was realized but was turned
off. That means invalidation requests for the bpf stuff (which we issue
in blanket fashion when doing a daemon reload) would actually later
result in a us re-realizing the unit, under the assumption it was
already realized once, even though in reality it never was realized
before.

This had the effect that after each daemon-reload we'd end up realizing
*all* defined units, even the unloaded ones, populating cgroupfs with
lots of unneeded empty cgroups.

With this fix we properly set the realiazation state to "INVALIDATED",
i.e. indicating the bpf stuff was never set up for the unit, and hence
when we try to invalidate it later we won't do anything.

6 years agocgroup: when dispatching the cgroup realization queue, check again if we shall actual...
Lennart Poettering [Fri, 24 Nov 2017 18:48:38 +0000 (19:48 +0100)] 
cgroup: when dispatching the cgroup realization queue, check again if we shall actually realize

We add units to the cgroup realization queue when propagating realizing
requests to sibling units, and when invalidating cgroup settings because
some cgroup setting changed. In the time between where we add the unit
to the queue until the cgroup is actually dispatched the unit's state
might have changed however, so that the unit doesn't actually need to be
realized anymore, for example because the unit went down. To handle
that, check the unit state again, if realization makes sense.

Redundant realization is usually not a problem, except when the unit is
not actually running, hence check exactly for that.

6 years agocgroup: drop unused parameter from function
Lennart Poettering [Fri, 24 Nov 2017 18:37:01 +0000 (19:37 +0100)] 
cgroup: drop unused parameter from function

6 years agocgroup-util: merge cg_set_tasks_access() and cg-set_group_access() into one
Lennart Poettering [Fri, 24 Nov 2017 17:30:23 +0000 (18:30 +0100)] 
cgroup-util: merge cg_set_tasks_access() and cg-set_group_access() into one

We never use these functions seperately, hence don't bother splitting
them into to.

Also, simplify things a bit, and maintain tables for the attribute files
to chown. Let's also update those tables a bit, and include thenew
"cgroup.threads" file in it, that needs to be delegated too, according
to the documentation.

6 years agomkosi: let's switch to the unified mode for mkosi
Lennart Poettering [Fri, 24 Nov 2017 17:29:35 +0000 (18:29 +0100)] 
mkosi: let's switch to the unified mode for mkosi

This is a toolconfiguration for developers, and hence most likely should
be the first thing to be switched over. Do so.

6 years agotest: set log_level to info in test-hwdb and check-help-*
Yu Watanabe [Sat, 25 Nov 2017 15:01:55 +0000 (00:01 +0900)] 
test: set log_level to info in test-hwdb and check-help-*

These tests check the stderr. So, if the systemd.log_level=debug
is set in the kernel command line, then these tests fail.
This set log_level to info in hwdb-test.sh and meson-check-help.sh,
the kernel command line not to change the output of the target
programs.

Fixes #7362.

6 years agoAdded Chuwi HiBook support (#7465)
Vladislav Vishnyakov [Sat, 25 Nov 2017 14:40:55 +0000 (21:40 +0700)] 
Added Chuwi HiBook support (#7465)

6 years agoMerge pull request #7449 from yuwata/clang-warnings
Zbigniew Jędrzejewski-Szmek [Sat, 25 Nov 2017 14:38:08 +0000 (15:38 +0100)] 
Merge pull request #7449 from yuwata/clang-warnings

Several cleanups

6 years agonspawn: adjust path to static resolv.conf to support split usr 7467/head
Yu Watanabe [Sat, 25 Nov 2017 12:11:04 +0000 (21:11 +0900)] 
nspawn: adjust path to static resolv.conf to support split usr

Fixes #7302.

6 years agomeson: remove abbreviations in status
Yu Watanabe [Sat, 25 Nov 2017 11:35:24 +0000 (20:35 +0900)] 
meson: remove abbreviations in status

6 years agofirstboot: do not write vconsole.conf when arg_keymap is empty 7449/head
Yu Watanabe [Sat, 25 Nov 2017 10:11:57 +0000 (19:11 +0900)] 
firstboot: do not write vconsole.conf when arg_keymap is empty

6 years agomachine: remove unused variables
Yu Watanabe [Fri, 24 Nov 2017 01:48:58 +0000 (10:48 +0900)] 
machine: remove unused variables

6 years agojournald: add _printf_ attribute to server_driver_message()
Yu Watanabe [Fri, 24 Nov 2017 01:48:21 +0000 (10:48 +0900)] 
journald: add _printf_ attribute to server_driver_message()

6 years agotests: make "test-execute" work in "sudo ninja -C build test" (#7463)
Lennart Poettering [Fri, 24 Nov 2017 21:56:44 +0000 (22:56 +0100)] 
tests: make "test-execute" work in "sudo ninja -C build test" (#7463)

In this mode USER/LOGNAME still point to the original caller, and our
tests get confused by that.

Follow-up for: #7450

6 years agotmpfiles: check if not too many symbolic links. (#7423)
Lukasz Rubaszewski [Fri, 24 Nov 2017 21:28:14 +0000 (22:28 +0100)] 
tmpfiles: check if not too many symbolic links. (#7423)

Some filesystems do not set d_type value when
readdir is called, so entry type is unknown.
Therefore check if accessing entry does not
return ELOOP error.

6 years agocore: remove empty cgroups (#7457)
Christian Brauner [Fri, 24 Nov 2017 20:05:16 +0000 (21:05 +0100)] 
core: remove empty cgroups (#7457)

When we skip an unwritable cgroup also remove the empty mountpoint.

6 years agonetworkd: auto promote links if "promote_secondaries" is unset (#7167)
Michael Vogt [Fri, 24 Nov 2017 20:03:05 +0000 (21:03 +0100)] 
networkd: auto promote links if "promote_secondaries" is unset (#7167)

The DHCP code in systemd-networkd relies on the
`net.ipv4.conf.{default,all,<if>}.promote_secondaries` sysctl to be set
(the kernels default is that it is unset). If this sysctl is not set
DHCP will work most of the time, however when the IP address changes
between leases then the system will loose its IP.

Because some distributions decided to not ship these defaults (Debian
is an example and via downstream Ubuntu) networkd by default will now
enable this sysctl opton automatically.

6 years agonspawn: hash the machine name, when looking for a suitable UID base (#7437)
Lennart Poettering [Fri, 24 Nov 2017 19:57:19 +0000 (20:57 +0100)] 
nspawn: hash the machine name, when looking for a suitable UID base (#7437)

When "-U" is used we look for a UID range we can use for our container.
We start with the UID the tree is already assigned to, and if that
didn't work we'd pick random ranges so far. With this change we'll first
try to hash a suitable range from the container name, and use that if it
works, in order to make UID assignments more likely to be stable.

This follows a similar logic PID 1 follows when using DynamicUser=1.

6 years agoMerge pull request #7442 from poettering/scope-fixes
Lennart Poettering [Fri, 24 Nov 2017 16:15:09 +0000 (17:15 +0100)] 
Merge pull request #7442 from poettering/scope-fixes

some fixes to the scope unit type

6 years agosystemctl: ignore shutdown's "-t" argument (#7459)
Lennart Poettering [Fri, 24 Nov 2017 16:01:32 +0000 (17:01 +0100)] 
systemctl: ignore shutdown's "-t" argument (#7459)

We should not only ignore "-t" itself, but also whatever is passed to
it.

This pretty much reverts the core of
a4420f7b8ed73b05ef6f31622101e7804daef69f, and adds back in the status
quo ante. What a difference a ':' can make.

This also adds a quick comment for this, so that we don't make this
mistake again.

Fixes: #7413
6 years agoMerge pull request #7446 from poettering/efi-firmware-boot-fixes
Lennart Poettering [Fri, 24 Nov 2017 14:42:32 +0000 (15:42 +0100)] 
Merge pull request #7446 from poettering/efi-firmware-boot-fixes

logind efi boot-into-firmware fixes

6 years agoMerge pull request #7458 from keszybz/two-build-fixes
Lennart Poettering [Fri, 24 Nov 2017 14:40:52 +0000 (15:40 +0100)] 
Merge pull request #7458 from keszybz/two-build-fixes

Two build fixes

6 years agofirstboot: remove some unnecessary code (#7456)
Zbigniew Jędrzejewski-Szmek [Fri, 24 Nov 2017 14:40:24 +0000 (15:40 +0100)] 
firstboot: remove some unnecessary code (#7456)

Inspired by #7449.

6 years agotest: skip DELEGATE test if the kernel can't do cgroupv2 (#7445)
Lennart Poettering [Fri, 24 Nov 2017 14:29:06 +0000 (15:29 +0100)] 
test: skip DELEGATE test if the kernel can't do cgroupv2 (#7445)

Fixes: #7440
6 years agotest: handle gracefully if decompressor tools are not installed (#7455)
Lennart Poettering [Fri, 24 Nov 2017 13:08:51 +0000 (14:08 +0100)] 
test: handle gracefully if decompressor tools are not installed (#7455)

Fixes: #7441
6 years agomeson: restore building of man pages on demand even if -Dman=false 7458/head
Zbigniew Jędrzejewski-Szmek [Fri, 24 Nov 2017 13:00:29 +0000 (14:00 +0100)] 
meson: restore building of man pages on demand even if -Dman=false

I want to configure -Dman=false for speed, but be able to build a specific
man page sometimes to check my edits. Commit 5b316b9ea6c broke this by mistake.
Let's adjust the condition to better match the logic of disabling tests only
if xsltproc is really not found.

6 years agoFix build without libkmod
Zbigniew Jędrzejewski-Szmek [Fri, 24 Nov 2017 12:53:36 +0000 (13:53 +0100)] 
Fix build without libkmod

All other places where libkmod.h is included are guarded. Build would
fail with:

In file included from ../src/core/kmod-setup.c:35:0:
../src/basic/module-util.h:23:10: fatal error: libkmod.h: No such file or directory
 #include <libkmod.h>
          ^~~~~~~~~~~
compilation terminated.

6 years agoMerge pull request #7415 from keszybz/udev-alloca
Lennart Poettering [Fri, 24 Nov 2017 12:32:03 +0000 (13:32 +0100)] 
Merge pull request #7415 from keszybz/udev-alloca

udev: modernize style in path_id

6 years agoMerge pull request #7453 from neosilky/coccinelle-fixes
Lennart Poettering [Fri, 24 Nov 2017 12:29:48 +0000 (13:29 +0100)] 
Merge pull request #7453 from neosilky/coccinelle-fixes

Applied fixes from Coccinelle

6 years agoMerge pull request #7454 from neosilky/cocci-fixes
Lennart Poettering [Fri, 24 Nov 2017 12:29:32 +0000 (13:29 +0100)] 
Merge pull request #7454 from neosilky/cocci-fixes

Apply more fixes from Coccinelle

6 years agoefivars: if OsIndicationsSupported does not exist, assume that reboot-to-firmware... 7446/head
Lennart Poettering [Thu, 23 Nov 2017 21:05:46 +0000 (22:05 +0100)] 
efivars: if OsIndicationsSupported does not exist, assume that reboot-to-firmware is not available

It's not advertised and hence not available.

Fixes: #7424
6 years agoefivars: minor coding style improvements
Lennart Poettering [Thu, 23 Nov 2017 21:05:34 +0000 (22:05 +0100)] 
efivars: minor coding style improvements

6 years agologind: don't propagate firmware misbehaviours to bus clients
Lennart Poettering [Thu, 23 Nov 2017 21:02:10 +0000 (22:02 +0100)] 
logind: don't propagate firmware misbehaviours to bus clients

If for some reason we can't query the firmware state, don't propagate
that to clients, but instead log about it, and claim that
reboot-to-firmware is not available (which is the right answer, since it
is not working).

Let's log about this though, as this is certainly relevant to know, even
though not for the client.

6 years agoRemove NULL as last parameter to strjoin 7454/head
Daniel Lockyer [Fri, 24 Nov 2017 10:37:08 +0000 (10:37 +0000)] 
Remove NULL as last parameter to strjoin

6 years agoReplace use of snprintf with xsprintf
Daniel Lockyer [Fri, 24 Nov 2017 10:36:04 +0000 (10:36 +0000)] 
Replace use of snprintf with xsprintf

6 years agoReplace free and reassignment with free_and_replace
Daniel Lockyer [Fri, 24 Nov 2017 10:33:41 +0000 (10:33 +0000)] 
Replace free and reassignment with free_and_replace

6 years agoReplace free and return NULL with return mfree
Daniel Lockyer [Fri, 24 Nov 2017 10:31:49 +0000 (10:31 +0000)] 
Replace free and return NULL with return mfree

6 years agoReplace free and nullify by mfree 7453/head
Daniel Lockyer [Fri, 24 Nov 2017 09:37:50 +0000 (09:37 +0000)] 
Replace free and nullify by mfree

6 years agoReplace empty ternary with helper method
Daniel Lockyer [Fri, 24 Nov 2017 09:31:08 +0000 (09:31 +0000)] 
Replace empty ternary with helper method

6 years agotest-execute: test more % specifiers (#7450)
Yu Watanabe [Fri, 24 Nov 2017 09:17:28 +0000 (18:17 +0900)] 
test-execute: test more % specifiers (#7450)

6 years ago__attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448)
Shawn Landden [Fri, 24 Nov 2017 09:08:12 +0000 (01:08 -0800)] 
__attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448)

That is version 7 or greater
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

Fix regression of https://github.com/systemd/systemd/pull/7389
82a27ba8217d09e4fef4c9550f8b733d174c5705
on older gccs

bumping to re-run CI
upstream             FAIL timed out
boot-smoke           FAIL non-zero exit status 1

6 years agojournalctl: add --output-fields= to --help text (#7443)
Lennart Poettering [Fri, 24 Nov 2017 09:04:14 +0000 (10:04 +0100)] 
journalctl: add --output-fields= to --help text (#7443)

Follow-up for #7181

6 years agocore: track scope controllers on the bus 7442/head
Lennart Poettering [Thu, 23 Nov 2017 19:15:48 +0000 (20:15 +0100)] 
core: track scope controllers on the bus

This watches controllers on the bus, and unsets them automatically when
they disappear.

Note that this is primarily a cosmetical fix. Since unique bus names are not
recycled, there's strictly no need to forget about them, but it's a lot
nicer to do so.

6 years agocore: refuse accepting a scope controller unless we are called on the API bus
Lennart Poettering [Thu, 23 Nov 2017 19:02:00 +0000 (20:02 +0100)] 
core: refuse accepting a scope controller unless we are called on the API bus

Let's make sure clients get early errors if they try something weird.

6 years agonspawn: make use of the RequestStop logic of scope units
Lennart Poettering [Thu, 23 Nov 2017 18:27:47 +0000 (19:27 +0100)] 
nspawn: make use of the RequestStop logic of scope units

Since time began, scope units had a concept of "Controllers", a bus peer
that would be notified when somebody requested a unit to stop. None of
our code used that facility so far, let's change that.

This way, nspawn can print a nice message when somebody invokes
"systemctl stop" on the container's scope unit, and then react with the
right action to shut it down.

6 years agocore: serialize the "controller" field in scope units
Lennart Poettering [Thu, 23 Nov 2017 11:51:54 +0000 (12:51 +0100)] 
core: serialize the "controller" field in scope units

We forgot to serialize it previously, hence daemon reload flushed it
out, since we also didn't write it to any unit file...

6 years agoman: reorder/add sections to systemd.exec(5) (#7412)
Lennart Poettering [Thu, 23 Nov 2017 20:20:48 +0000 (21:20 +0100)] 
man: reorder/add sections to systemd.exec(5) (#7412)

The long long list of settings is getting too confusing, let's add some
sections and reorder things in them.

This makes no changes regarding contents, it only reorders things,
sometimes reindents them, and adds sections that made sense to me to
some degree.

Within each sections the settings are ordered by relevance (at least
according to how relevant I personally find them), and not
alphabetically.

6 years agoMerge pull request #7436 from poettering/mount-util-fixup
Lennart Poettering [Thu, 23 Nov 2017 20:01:12 +0000 (21:01 +0100)] 
Merge pull request #7436 from poettering/mount-util-fixup

mount-util.c fixes regarding name_to_handle_at()

6 years agonetworkd: fix commit 5f04a209eae0a2a04eb60fd7235b3fcdf3cc81ba (#7432)
Susant Sahani [Thu, 23 Nov 2017 16:38:08 +0000 (22:08 +0530)] 
networkd: fix commit 5f04a209eae0a2a04eb60fd7235b3fcdf3cc81ba (#7432)

If classless route not provided configure default routes.
Something went wrong in the rebase.

6 years agosmack: allow comments on smack rules (#7438)
WaLyong Cho [Thu, 23 Nov 2017 15:27:19 +0000 (00:27 +0900)] 
smack: allow comments on smack rules (#7438)

6 years agohwdb: Add accel mount settings for Axxo TW-1011 2-in-1 (#7439)
Hans de Goede [Thu, 23 Nov 2017 15:25:42 +0000 (16:25 +0100)] 
hwdb: Add accel mount settings for Axxo TW-1011 2-in-1 (#7439)

Add accel mount settings for the SMO8500 accelerometer found in
Axxo TW-1011 2-in-1 devices to 60-sensor.hwdb.

6 years agomeson: do not install RPM macros if rpmmacrosdir is set to no (#7430)
Yu Watanabe [Thu, 23 Nov 2017 13:20:22 +0000 (22:20 +0900)] 
meson: do not install RPM macros if rpmmacrosdir is set to no (#7430)

Fixes #7427.

6 years agotests: install `test` as part of BASICTOOLS (#7434)
Evgeny Vereshchagin [Thu, 23 Nov 2017 12:28:12 +0000 (15:28 +0300)] 
tests: install `test` as part of BASICTOOLS (#7434)

This makes TEST-19-DELEGATE, which is currently failing, work.

Closes https://github.com/systemd/systemd/issues/7425.

6 years agotest: fix test-mount-util when handling duplicate mounts on the same location 7436/head
Lennart Poettering [Thu, 23 Nov 2017 11:48:42 +0000 (12:48 +0100)] 
test: fix test-mount-util when handling duplicate mounts on the same location

The test was written so far under the assumption that if two mounts are
placed onto the same location the "upper" mount is listed later in
/proc/self/mountinfo. This appears not to be guaranteed however, as
running the tests in a normal nspawn shows.

This patch fixes that: it reverses the hashmap of mounts we build:
instead of keying by path, we key by mnt_id, and if we notice that
path_get_mnt_id() doesn't match what a line in /proc/self/mountinfo
says, we use the returned ID to check if maybe another line agrees.

Fixes: #7431
6 years agomount-util: fix bad indenting
Lennart Poettering [Thu, 23 Nov 2017 11:48:12 +0000 (12:48 +0100)] 
mount-util: fix bad indenting

6 years agomount-util: EOVERFLOW might have other causes than buffer size issues
Lennart Poettering [Thu, 23 Nov 2017 11:44:49 +0000 (12:44 +0100)] 
mount-util: EOVERFLOW might have other causes than buffer size issues

When we get EOVERFLOW this might be caused by untriggered nfs4 mounts
(see discussion at
https://github.com/systemd/systemd/pull/7395#issuecomment-346164481 and
further down).

Handle this nicely by falling back to fdinfo-based mntid determination.

Fixes: #7082
6 years agomount-util: fix error propagation in fd_fdinfo_mnt_id()
Lennart Poettering [Thu, 23 Nov 2017 11:44:17 +0000 (12:44 +0100)] 
mount-util: fix error propagation in fd_fdinfo_mnt_id()

6 years agomount-util: drop exponential buffer growing in name_to_handle_at_loop()
Lennart Poettering [Thu, 23 Nov 2017 11:42:24 +0000 (12:42 +0100)] 
mount-util: drop exponential buffer growing in name_to_handle_at_loop()

So, it appears name_to_handle_at() always returns the right buffer size
on EOVERFLOW, when it's returned due to a too small buffer. Let's rely
on that exclusively for sizing the buffer, and let's drop the
exponential buffer growing.

The new logic is now: if we see EOVERFLOW and the returned size has
increased, resize our buffer and try again. But if it didn't increase,
then propagate the EOVERFLOW as it likely has other causes.

6 years agocore/manager: check the existance of the special units (#7433)
Yu Watanabe [Thu, 23 Nov 2017 12:25:56 +0000 (21:25 +0900)] 
core/manager: check the existance of the special units (#7433)

In the user mode, not all special units exist.
So, we need to check whether the units exist or not before operate
something to the units.
Such the check was mistakenly dropped by e68537f0ba1a4433ecdf58e609b1701ed7091abc.

Fixes #7426.

6 years agoFixed Type nmnds-ipv4 -> nmdns-ipv4 (#7435)
Carsten Strotmann [Thu, 23 Nov 2017 12:12:00 +0000 (12:12 +0000)] 
Fixed Type nmnds-ipv4 -> nmdns-ipv4 (#7435)

6 years agocgroup: downgrade the log level of "invocation id" messages to debug (#7422)
Evgeny Vereshchagin [Thu, 23 Nov 2017 10:07:20 +0000 (13:07 +0300)] 
cgroup: downgrade the log level of "invocation id" messages to debug (#7422)

Now that d3070fbdf6077d7d has been merged, these errors are not as
critical as they used to be.

6 years agoMerge pull request #7420 from brauner/2017-11-22/systemd_in_container_unified_cgroup_...
Evgeny Vereshchagin [Thu, 23 Nov 2017 01:11:04 +0000 (04:11 +0300)] 
Merge pull request #7420 from brauner/2017-11-22/systemd_in_container_unified_cgroup_hierarchy

cgroup: skip unwritable cgroups

6 years agocgroup: test whether pure unified hierarchy is writable 7420/head
Christian Brauner [Wed, 22 Nov 2017 16:27:03 +0000 (17:27 +0100)] 
cgroup: test whether pure unified hierarchy is writable

If it is not writable we should not mount it.

6 years agocgroup: check whether unified hierarchy is writable
Christian Brauner [Wed, 22 Nov 2017 16:20:35 +0000 (17:20 +0100)] 
cgroup: check whether unified hierarchy is writable

When systemd is running inside a container employing user
namespaces it currently mounts the unified cgroup hierarchy
without being able to write to it. This causes systemd to
freeze during boot.
This patch checks whether the unified cgroup hierarchy
is writable. If it is not it will not mount it.

This solution is based on a patch by Evgeny Vereshchagin.

Closes #6408.
Closes https://github.com/lxc/lxc/issues/1678 .

6 years agoMerge pull request #7416 from keszybz/readd-lost-test
Lennart Poettering [Wed, 22 Nov 2017 16:24:21 +0000 (17:24 +0100)] 
Merge pull request #7416 from keszybz/readd-lost-test

Readd lost test