]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agoMerge pull request #12441 from ssahani/bridge-fdb
Chris Down [Fri, 3 May 2019 13:50:47 +0000 (09:50 -0400)] 
Merge pull request #12441 from ssahani/bridge-fdb

networkd: add support for bridge fdb destination address.

4 years agofstab-generator: Prevent double free of reused FILE*
Wieland Hoffmann [Thu, 2 May 2019 18:10:08 +0000 (20:10 +0200)] 
fstab-generator: Prevent double free of reused FILE*

When the .automount unit file already existed for any reason in the
`normal-dir` passed to `systemd-fstab-generator`, but the normal .mount unit
file did not, `f` was closed (but _not_ set to NULL). The call to
`generator_open_unit_file(..., automount_name, &f)` then failed because the
.mount unit file already existed. Now `f` did not point to an open FILE and the
later cleanup from the `_cleanup_fclose_` attribute failed with a double free.
Reset `f` to NULL before reusing it.

4 years agotest-network: add tests for BridgeFDB.Destination= 12441/head
Yu Watanabe [Fri, 3 May 2019 04:08:55 +0000 (06:08 +0200)] 
test-network: add tests for BridgeFDB.Destination=

4 years agonetworkd: Add support to configure destination address for bridge FDB
Susant Sahani [Tue, 30 Apr 2019 09:23:39 +0000 (14:53 +0530)] 
networkd: Add support to configure destination address for bridge FDB

Closes #5145.

Example conf:
```
[Match]
Name=vxlan1309

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.2

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.4

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.5
```

5 years agoudev/cdrom_id: drop unneeded parentheses
Zbigniew Jędrzejewski-Szmek [Tue, 30 Apr 2019 06:37:07 +0000 (08:37 +0200)] 
udev/cdrom_id: drop unneeded parentheses

5 years agoMerge pull request #12218 from keszybz/use-libmount-more
Lennart Poettering [Tue, 30 Apr 2019 17:44:17 +0000 (19:44 +0200)] 
Merge pull request #12218 from keszybz/use-libmount-more

Use libmount more

5 years agomeson: make source files including nspawn-settings.h depend on libseccomp
Franck Bui [Tue, 30 Apr 2019 14:10:13 +0000 (16:10 +0200)] 
meson: make source files including nspawn-settings.h depend on libseccomp

Since nspawn-settings.h includes seccomp.h, any file that includes
nspawn-settings.h should depend on libseccomp so the correct header path where
seccomp.h lives is added to the header search paths.

It's especially important for distros such as openSUSE where seccomp.h is not
shipped in /usr/include but /usr/include/libseccomp.

This patch is similar to 8238423095ca54c48d9408a5da13e0325b31e6f6.

5 years agoudev: drop unnecessary brackets
Yu Watanabe [Tue, 30 Apr 2019 16:45:29 +0000 (18:45 +0200)] 
udev: drop unnecessary brackets

Follow-up for ed0cb346821972ec2c505ee11ed3d383aba6256e.

5 years agoMerge pull request #12420 from mrc0mmand/coccinelle-tweaks
Lennart Poettering [Tue, 30 Apr 2019 09:37:19 +0000 (11:37 +0200)] 
Merge pull request #12420 from mrc0mmand/coccinelle-tweaks

Coccinelle improvements

5 years agoMerge pull request #12439 from poettering/simplify-umask-util
Lennart Poettering [Tue, 30 Apr 2019 09:36:55 +0000 (11:36 +0200)] 
Merge pull request #12439 from poettering/simplify-umask-util

simplify RUN_WITH_UMASK()

5 years agotests: add test for umask-util.h 12439/head
Lennart Poettering [Tue, 30 Apr 2019 07:53:09 +0000 (09:53 +0200)] 
tests: add test for umask-util.h

5 years agoumask-util: simplify RUN_WITH_UMASK()
Lennart Poettering [Tue, 30 Apr 2019 07:52:35 +0000 (09:52 +0200)] 
umask-util: simplify RUN_WITH_UMASK()

Why have a struct to store the iteration bit if we actually have plenty
place in mode_t?

5 years agococcinelle: further restrict certain transformations 12420/head
Frantisek Sumsal [Mon, 29 Apr 2019 14:12:41 +0000 (16:12 +0200)] 
coccinelle: further restrict certain transformations

Some transformations generate results we don't want to keep, so
let's disable such transformations for specific files.

Also, disable const-strlen.cocci everywhere, as the STRLEN macro has a
pretty limited scope, so the transformation generates false positives in
most cases.

5 years agococcinelle: exclude JsonVariant* from the IN_SET transformation
Frantisek Sumsal [Mon, 29 Apr 2019 11:15:27 +0000 (13:15 +0200)] 
coccinelle: exclude JsonVariant* from the IN_SET transformation

JsonVariant* doesn't work with the current IN_SET implementation, so
let's exclude it from the transformation altogether

5 years agotree-wide: code improvements suggested by Coccinelle
Frantisek Sumsal [Mon, 29 Apr 2019 16:22:22 +0000 (18:22 +0200)] 
tree-wide: code improvements suggested by Coccinelle

5 years agonetword: fdb fix coding style
Susant Sahani [Tue, 30 Apr 2019 07:36:10 +0000 (13:06 +0530)] 
netword: fdb fix coding style

5 years agoMerge pull request #12434 from poettering/rm-rf-children-take-ptr
Zbigniew Jędrzejewski-Szmek [Tue, 30 Apr 2019 06:23:13 +0000 (08:23 +0200)] 
Merge pull request #12434 from poettering/rm-rf-children-take-ptr

minor rm_rf_children() modernizations

5 years agoalloc-util: don't use malloc_usable_size() to determine allocated size
Aaron Barany [Mon, 29 Apr 2019 22:00:30 +0000 (15:00 -0700)] 
alloc-util: don't use malloc_usable_size() to determine allocated size

This reverts commit d4b604baeadbb2498e4f2c3e260260eed210f5d6.

When realloc() is called, the extra memory between the originally
requested size and the end of malloc_usable_size() isn't copied. (at
least with the version of glibc that currently ships on Arch Linux)
As a result, some elements get lost and use uninitialized memory, most
commonly 0, and can lead to crashes.

fixes #12384

5 years agoMerge pull request #12428 from jwrdegoede/hwdb-logitech-kbds
Lennart Poettering [Mon, 29 Apr 2019 19:34:42 +0000 (21:34 +0200)] 
Merge pull request #12428 from jwrdegoede/hwdb-logitech-kbds

Hwdb: Add key-mappings for various wireless Logitech keyboards

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Mon, 29 Apr 2019 16:06:16 +0000 (19:06 +0300)] 
Update Ukrainian translation

5 years agoMerge pull request #12414 from keszybz/detect-podman
Lennart Poettering [Mon, 29 Apr 2019 17:07:24 +0000 (19:07 +0200)] 
Merge pull request #12414 from keszybz/detect-podman

Detect podman as separate container type

5 years agonetworkd: Add back static routes after DHCPv4 lease expires.
Susant Sahani [Mon, 29 Apr 2019 05:02:34 +0000 (10:32 +0530)] 
networkd: Add back static routes after DHCPv4 lease expires.

1. When the DHCPv4 lease expires kernel removes the route. So add it back
when we gain lease again.

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

2. When UseRoutes=false do not remove router

5 years agohwdb: Fix F12 mapping on the Logitech Internet Navigator 12428/head
Hans de Goede [Mon, 22 Apr 2019 07:15:40 +0000 (09:15 +0200)] 
hwdb: Fix F12 mapping on the Logitech Internet Navigator

Many Logitech keyboards have the following special functions on F9-F12:
F9: file-browser F10: document-browser F11: image-browser F12:
music-browser. These should be bound to:

 #define KEY_FILE               144     /* AL Local Machine Browser */
 #define KEY_DOCUMENTS          235
 #define KEY_IMAGES           0x1ba     /* AL Image Browser */
 #define KEY_AUDIO            0x188     /* AL Audio Browser */

This commit fixes the wrong binding of F12 to KEY_SOUND (which
translates to XF86AudioPreset) and removes the ?? comments from
both F11 and F12.

5 years agohwdb: Add key mappings for Logitech MX5500 keyboard
Hans de Goede [Sun, 28 Apr 2019 19:21:00 +0000 (21:21 +0200)] 
hwdb: Add key mappings for Logitech MX5500 keyboard

Add support for various custom key-codes emitted by the Logitech MX5500
keyboard, both when attached through its Bluetooth-receiver in USB-HID
proxy mode; and when connected as a Bluetooth device.

5 years agohwdb: Add key mappings for Logitech MX5000 keyboard
Hans de Goede [Tue, 2 Apr 2019 15:23:12 +0000 (17:23 +0200)] 
hwdb: Add key mappings for Logitech MX5000 keyboard

Add support for various custom key-codes emitted by the Logitech MX5000
keyboard, both when attached through its Bluetooth-receiver in USB-HID
proxy mode; and when connected as a Bluetooth device.

5 years agohwdb: Add key mappings for Logitech 27 MHz S520 keyboard
Hans de Goede [Fri, 5 Apr 2019 12:47:04 +0000 (14:47 +0200)] 
hwdb: Add key mappings for Logitech 27 MHz S520 keyboard

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the S520 keyboard
(modelnumber Y-RBA97).

5 years agohwdb: Add key mappings for Logitech 27 MHz EX100 keyboard
Hans de Goede [Fri, 5 Apr 2019 14:18:03 +0000 (16:18 +0200)] 
hwdb: Add key mappings for Logitech 27 MHz EX100 keyboard

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the EX100 keyboard
(modelnumber Y-RBH94).

5 years agohwdb: Add key mappings for Logitech 27 MHz MX3200 keyboard
Hans de Goede [Thu, 4 Apr 2019 22:40:40 +0000 (00:40 +0200)] 
hwdb: Add key mappings for Logitech 27 MHz MX3200 keyboard

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the MX3200 keyboard
(modelnumber Y-RAV80).

5 years agohwdb: Add key mappings for Logitech 27 MHz MX3000 keyboard
Hans de Goede [Wed, 3 Apr 2019 20:52:06 +0000 (22:52 +0200)] 
hwdb: Add key mappings for Logitech 27 MHz MX3000 keyboard

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the MX3000 keyboard
(modelnumber Y-RAM74).

5 years agohwdb: Add key mappings for Logitech 27 MHz "Cordless Rechargeable Desktop" keyboard
Hans de Goede [Fri, 29 Mar 2019 22:42:56 +0000 (23:42 +0100)] 
hwdb: Add key mappings for Logitech 27 MHz "Cordless Rechargeable Desktop" keyboard

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the "Logitech Rechargeable
Desktop" keyboard (modelnumber Y-RK49).

5 years agohwdb: Add key mappings for Logitech 27 MHz "Cordless Access Keyboard"
Hans de Goede [Fri, 22 Mar 2019 21:10:32 +0000 (22:10 +0100)] 
hwdb: Add key mappings for Logitech 27 MHz "Cordless Access Keyboard"

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This allows us to add per model keymappings for the special keys on these
keyboards. This commit adds such mappings for the "Logitech Cordless
Access Keyboard" (modelnumber Y-RH35).

5 years agohwdb: Add generic key mapping for Logitech 27 MHz keyboards
Hans de Goede [Thu, 4 Apr 2019 20:39:24 +0000 (22:39 +0200)] 
hwdb: Add generic key mapping for Logitech 27 MHz keyboards

The upcoming kernel enumerates Logitech 27 MHz wireless keyboards and
mice by there wireless-PID, rather then using the PID of the receiver
which is the same for all 27MHz Logitech devices.

This will allow us to add per model keymappings for the special keys on
these keyboards, which may differ per model.

This commit adds a default / fallback mapping, assigning the most common
meaning of the custom Logitech c10XX keycodes.

5 years agounits: drop reference to sushell man page
Lennart Poettering [Mon, 29 Apr 2019 14:10:51 +0000 (16:10 +0200)] 
units: drop reference to sushell man page

sushell was a Fedoraism, and has been removed since. Hence our upstream
unit files shouldn't reference it either.

5 years agocodespell: fix spelling errors
Ben Boeckel [Sat, 27 Apr 2019 00:22:40 +0000 (20:22 -0400)] 
codespell: fix spelling errors

5 years agorm-rf: simplify rm_rf_children() a bit by using _cleanup_close_ 12434/head
Lennart Poettering [Mon, 29 Apr 2019 14:21:01 +0000 (16:21 +0200)] 
rm-rf: simplify rm_rf_children() a bit by using _cleanup_close_

5 years agoswitch-root: modernize rm_rf_children() invocation a bit
Lennart Poettering [Mon, 29 Apr 2019 13:45:19 +0000 (15:45 +0200)] 
switch-root: modernize rm_rf_children() invocation a bit

5 years agococcinelle: exclude certain paths from the transformations
Frantisek Sumsal [Sun, 28 Apr 2019 18:43:00 +0000 (20:43 +0200)] 
coccinelle: exclude certain paths from the transformations

There's no point in running these transformation for certain files,
mainly anything from src/boot/efi and src/shared/linux, as this code
doesn't have access to our internal utility functions

5 years agococcinelle: ignore function transformations causing recursion
Frantisek Sumsal [Sun, 28 Apr 2019 15:13:29 +0000 (17:13 +0200)] 
coccinelle: ignore function transformations causing recursion

For example, following transformation:

- isempty(s) ? NULL : s
+ empty_to_null(s)

would get applied to the empty_to_null function itself as well,
causing an infinite recursion, like:

--- src/basic/string-util.h
+++ /tmp/cocci-output-307-9f76e6-string-util.h
@@ -50,11 +50,11 @@ static inline bool isempty(const char *p
 }

 static inline const char *empty_to_null(const char *p) {
-        return isempty(p) ? NULL : p;
+        return empty_to_null(p);
 }

Let's avoid that by checking the current match position

5 years agobasic/virt: treat "podman" as separate container type 12414/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 12:13:53 +0000 (14:13 +0200)] 
basic/virt: treat "podman" as separate container type

We would detect podman as container-other. Let's assign a name to it.
Inspired by https://github.com/containers/libpod/issues/2996.

5 years agobasic/virt: try the /proc/1/sched hack also for PID1
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 11:37:31 +0000 (13:37 +0200)] 
basic/virt: try the /proc/1/sched hack also for PID1

If a container manager does not set $container, we could end up
in a strange situation when detect-virt returns container-other when
run as non-pid-1 and none when run as pid-1.

5 years agococcinelle: ignore macro transformations in the macros themselves
Frantisek Sumsal [Sun, 28 Apr 2019 13:03:47 +0000 (15:03 +0200)] 
coccinelle: ignore macro transformations in the macros themselves

For example, the following transformation:

- sizeof(s)-1
+ STRLEN(s)

would replace sizeof by STRLEN even in the STRLEN macro definition
itself, which generates following nonsensical patch:

--- src/basic/macro.h
+++ /tmp/cocci-output-8753-b50773-macro.h
@@ -182,7 +182,7 @@ static inline unsigned long ALIGN_POWER2
  *          Contrary to strlen(), this is a constant expression.
  * @x: a string literal.
  */
-#define STRLEN(x) (sizeof(""x"") - 1)
+#define STRLEN(x) (STRLEN("" x ""))

 /*
  * container_of - cast a member of a structure out to the containing structure

Let's exclude the macro itself from the transformation to avoid this

5 years agonetwork: drop invalid assertion
Yu Watanabe [Sun, 28 Apr 2019 07:06:13 +0000 (09:06 +0200)] 
network: drop invalid assertion

The link may not have corresponding .network file.
Note that in that case, link_ipv4ll_enabled() and link_dhcp4_enabled()
returns false. So, it is safe to drop the assertion.

Fixes #12422.

5 years agoMerge pull request #12322 from ljmf00/hwdb-accel-location-patch
Lennart Poettering [Sun, 28 Apr 2019 15:43:54 +0000 (17:43 +0200)] 
Merge pull request #12322 from ljmf00/hwdb-accel-location-patch

Add support for ACCEL_LOCATION udev property to deal with 2 sensors

5 years agotree-wide: drop !! casts to booleans
Frantisek Sumsal [Sun, 28 Apr 2019 12:32:19 +0000 (14:32 +0200)] 
tree-wide: drop !! casts to booleans

Done by coccinelle/bool-cast.cocci

5 years agotree-wide: replace explicit NULL checks with their shorter variants
Frantisek Sumsal [Sun, 28 Apr 2019 12:28:49 +0000 (14:28 +0200)] 
tree-wide: replace explicit NULL checks with their shorter variants

Done by coccinelle/equals-null.cocci

5 years agohwdb: add ACCEL_LOCATION property to parse_hwdb.py 12322/head
Luís Ferreira [Sat, 13 Apr 2019 18:12:51 +0000 (19:12 +0100)] 
hwdb: add ACCEL_LOCATION property to parse_hwdb.py

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
5 years agohwdb: add ACCEL_LOCATION to the allowed properties
Luís Ferreira [Sat, 13 Apr 2019 18:12:45 +0000 (19:12 +0100)] 
hwdb: add ACCEL_LOCATION to the allowed properties

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
5 years agococcinelle: avoid matching 'errno' as a file descriptor
Frantisek Sumsal [Sat, 27 Apr 2019 10:26:22 +0000 (12:26 +0200)] 
coccinelle: avoid matching 'errno' as a file descriptor

The `coccinelle/take-fd.cocci` transformation file attempts to rewrite

r = fd;
fd = -1;

to

r = TAKE_FD(fd);

Unfortunately, using `identifier` or `idexpression` as a metavariable
type in this case wouldn't match more complex location descriptions,
like:

x->fd = fd
fd = -1;

Using 'expression' metavariable type generates false positives,
as you can't specify scope of such expression. The only real example
from the current codebase is the global 'errno' variable, which results
in following patch generated by `spatch`:

--- src/basic/errno-util.h
+++ /tmp/cocci-output-28263-971baa-errno-util.h
@@ -15,8 +15,7 @@ static inline void _reset_errno_(int *sa

 #define UNPROTECT_ERRNO                         \
         do {                                    \
-                errno = _saved_errno_;          \
-                _saved_errno_ = -1;             \
+                errno = TAKE_FD(_saved_errno_);             \
         } while (false)

 static inline int negative_errno(void) {

Let's explicitly state that the matched expression should not equal
'errno' to avoid this. It's not particularly nice, but it should be
enough, at least for now.

5 years agococcinelle: add explicit statement isomorphisms
Frantisek Sumsal [Fri, 26 Apr 2019 19:42:16 +0000 (21:42 +0200)] 
coccinelle: add explicit statement isomorphisms

Coccinelle needs a custom isomorphism file with rules (isomorphisms) how
to correctly rewrite conditions with explicit NULL checks (i.e.
if (ptr == NULL)) to their shorter form (i.e. if (!ptr)). Coccinelle
already contains such isomorphisms in its default .iso file, however,
they're in the opposite direction, which results in useless output from
coccinelle/equals-null.cocci.

With this fix, `spatch` should no longer report patches like:

@@ -628,8 +628,9 @@ static int path_deserialize_item(Unit *u
                 f = path_result_from_string(value);
                 if (f < 0)
                         log_unit_debug(u, "Failed to parse result value: %s", value);
-                else if (f != PATH_SUCCESS)
-                        p->result = f;
+                else {if (f != PATH_SUCCESS)
+                                p->result = f;
+                }

         } else
                 log_unit_debug(u, "Unknown serialization key: %s", key);

5 years agoMerge pull request #12407 from keszybz/two-unrelated-cleanups
Lennart Poettering [Fri, 26 Apr 2019 21:43:27 +0000 (23:43 +0200)] 
Merge pull request #12407 from keszybz/two-unrelated-cleanups

Two unrelated cleanups

5 years agonspawn-expose-ports: fix a typo in error message
Ben Boeckel [Fri, 26 Apr 2019 19:15:09 +0000 (15:15 -0400)] 
nspawn-expose-ports: fix a typo in error message

5 years agoresolve: use bridge or bonding interfaces in degraded-carrier state
Yu Watanabe [Wed, 24 Apr 2019 19:52:13 +0000 (21:52 +0200)] 
resolve: use bridge or bonding interfaces in degraded-carrier state

Fixes #12285.

5 years agosd-bus: bump message queue size again
Franck Bui [Thu, 25 Apr 2019 05:52:16 +0000 (07:52 +0200)] 
sd-bus: bump message queue size again

Simliarly to issue #4068, the current limit turns out to be too small for a
big storage setup that uses many small disks. Let's bump it further.

5 years agoudevd: notify when max number value of children is reached only once per batch of...
Franck Bui [Wed, 24 Apr 2019 09:26:42 +0000 (11:26 +0200)] 
udevd: notify when max number value of children is reached only once per batch of events

When booting with "udev.log-priority=debug" for example, the output might be
spammed with messages like this:

    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached
    systemd-udevd[23545]: maximum number (248) of children reached

While the message itself is useful, printing it per batch of events should be
enough.

5 years agoMerge pull request #12394 from poettering/oncalendar-tweak
Zbigniew Jędrzejewski-Szmek [Fri, 26 Apr 2019 06:48:28 +0000 (08:48 +0200)] 
Merge pull request #12394 from poettering/oncalendar-tweak

systemd-run --on-calendar= follow-up

5 years agochown-recursive: also check mode before we bypass
Lennart Poettering [Tue, 16 Apr 2019 16:44:12 +0000 (18:44 +0200)] 
chown-recursive: also check mode before we bypass

5 years agojson: let's not accept embedded NUL bytes when allocating JSON strings
Lennart Poettering [Tue, 8 Jan 2019 17:34:38 +0000 (18:34 +0100)] 
json: let's not accept embedded NUL bytes when allocating JSON strings

Let's add an additional paranoia check, and not accept embedded NUL
bytes in strings, just in case.

5 years agojson: make log message more focussed
Lennart Poettering [Tue, 23 Apr 2019 13:26:09 +0000 (15:26 +0200)] 
json: make log message more focussed

5 years agobash-completion: accept files for --bind/--bind-ro options
Frantisek Sumsal [Thu, 25 Apr 2019 18:07:03 +0000 (20:07 +0200)] 
bash-completion: accept files for --bind/--bind-ro options

5 years agobash-completion: process only non-template units for systemctl isolate
Frantisek Sumsal [Thu, 25 Apr 2019 17:16:06 +0000 (19:16 +0200)] 
bash-completion: process only non-template units for systemctl isolate

5 years agobash-completion: don't sort syslog priorities
Frantisek Sumsal [Thu, 25 Apr 2019 17:37:54 +0000 (19:37 +0200)] 
bash-completion: don't sort syslog priorities

By default, the available completions are sorted alphabetically, which
is counterproductive in case of syslog priorities. Override the default
behavior using the `nosort` option

5 years agoDocument /etc/initrd-release
Jérémy Rosen [Thu, 25 Apr 2019 22:49:57 +0000 (00:49 +0200)] 
Document /etc/initrd-release

When systemd is started, it detects initrd by checking for that file
The usage of that file is not documented anywhere, so mention it early
in the most relevant man-page I could find.

5 years agoRevert "Revert "README: remove Coverity Scan badge""
Evgeny Vereshchagin [Thu, 25 Apr 2019 19:17:59 +0000 (22:17 +0300)] 
Revert "Revert "README: remove Coverity Scan badge""

This reverts commit 93e4163e912b6895e61c43452a629f30a28eb70c.

5 years agorun: when we determine a timer cannot elapse anymore, really just warn, nothing else 12394/head
Lennart Poettering [Thu, 25 Apr 2019 11:22:55 +0000 (13:22 +0200)] 
run: when we determine a timer cannot elapse anymore, really just warn, nothing else

When we determine that a calendar expression cannot elapse anymore,
print a warning but proceed regardless like we normally would.

Quite possibly a remote system has a different understanding of time
(timezone, system clock) than we have, hence we really shouldn't change
behaviour here client side, but log at best, and then leave the decision
what to do to the server side.

Follow-up for #12299

5 years agocalendarspec: make return time value of calendar_spec_next_usec() optional
Lennart Poettering [Thu, 25 Apr 2019 11:21:54 +0000 (13:21 +0200)] 
calendarspec: make return time value of calendar_spec_next_usec() optional

If noone is interested, there's no reason to return it.

(Also document the ENOENT error code in a comment)

5 years agoMerge pull request #12074 from poettering/io-acct
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 09:59:37 +0000 (11:59 +0200)] 
Merge pull request #12074 from poettering/io-acct

expose IO stats on the bus and in "systemctl status" and "systemd-run --wait"

5 years agorun: check if the specified calendar event is not in the past
Frantisek Sumsal [Fri, 12 Apr 2019 18:57:51 +0000 (20:57 +0200)] 
run: check if the specified calendar event is not in the past

Check if calendar event specification passed by --on-calendar runs in
some time in the future. If not, execute the given command immediately

5 years agonetwork: drop "return 1" when the return value is ignored by all callers 12407/head
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:41:59 +0000 (10:41 +0200)] 
network: drop "return 1" when the return value is ignored by all callers

The reader is tricked into thinking that this has some meaning...

5 years agocore: adjust unit_get_ancestor_memory_{low,min}() to work with units which don't...
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2019 08:54:44 +0000 (10:54 +0200)] 
core: adjust unit_get_ancestor_memory_{low,min}() to work with units which don't have a CGroupContext

Coverity doesn't like the fact that unit_get_cgroup_context() returns NULL for
unit types that don't have a CGroupContext. We don't expect to call those
functions with such unit types, so this isn't an immediate problem, but we can
make things more robust by handling this case.

CID #1400683, #1400684.

5 years agoMerge pull request #12332 from cdown/default_min
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 09:06:45 +0000 (11:06 +0200)] 
Merge pull request #12332 from cdown/default_min

cgroup: Add support for propagation of memory.min

5 years agohwdb: add axis range corrections for the Dell Latitude e7250
Dave Ross [Sat, 20 Apr 2019 20:27:22 +0000 (16:27 -0400)] 
hwdb: add axis range corrections for the Dell Latitude e7250

Based on touchpad-edge-detector and dimensions confirmed with the owner's manual (https://content.etilize.com/User-Manual/1037738079.pdf)

5 years agoMerge pull request #12382 from yuwata/wireguard-12377
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:55:53 +0000 (10:55 +0200)] 
Merge pull request #12382 from yuwata/wireguard-12377

network: fix ListenPort= in [WireGuard] section

5 years agoMerge pull request #12316 from yuwata/network-prevent-multiple-initialization-12315
Zbigniew Jędrzejewski-Szmek [Thu, 25 Apr 2019 08:54:28 +0000 (10:54 +0200)] 
Merge pull request #12316 from yuwata/network-prevent-multiple-initialization-12315

network: prevent interfaces to be initialized multiple times

5 years agonetwork: fix ref/unref logic for Link object 12316/head
Yu Watanabe [Mon, 15 Apr 2019 07:38:45 +0000 (16:38 +0900)] 
network: fix ref/unref logic for Link object

- bridge or bonding master takes a reference of slave links.
- drop link from bridge or bonding master's slave list when slave link
  is removed.
- change type of Link::slaves to Set*,

Fixes #12315.

5 years agonetwork: prevent interfaces to be initialized multiple times
Yu Watanabe [Mon, 15 Apr 2019 08:34:00 +0000 (17:34 +0900)] 
network: prevent interfaces to be initialized multiple times

When a uevent is received during the relevant interface is in
LINK_STATE_PENDING, then the interface may be initialized twice.
To prevent that, this introduces LINK_STATE_INITIALIZED.

5 years agoudev,network: warn when .link or .network file has no [Match] section
Yu Watanabe [Sat, 20 Apr 2019 12:40:24 +0000 (14:40 +0200)] 
udev,network: warn when .link or .network file has no [Match] section

Closes #12098.

5 years agonetwork: fix ListenPort= in [WireGuard] section 12382/head
Yu Watanabe [Wed, 24 Apr 2019 22:39:04 +0000 (00:39 +0200)] 
network: fix ListenPort= in [WireGuard] section

This fixes a bug introduced by f1368a333e5e08575f0b45dfe41e936b106a8627.

Fixes #12377.

5 years agotest-network: fix invalid assertions
Yu Watanabe [Wed, 24 Apr 2019 22:29:20 +0000 (00:29 +0200)] 
test-network: fix invalid assertions

5 years agoMerge pull request #12376 from mrc0mmand/deal-with-backslashes-in-completion
Zbigniew Jędrzejewski-Szmek [Wed, 24 Apr 2019 17:45:47 +0000 (19:45 +0200)] 
Merge pull request #12376 from mrc0mmand/deal-with-backslashes-in-completion

bash-completion: properly autocomplete escaped unit names

5 years agobash-completion: unify indentation 12376/head
Frantisek Sumsal [Wed, 24 Apr 2019 16:03:30 +0000 (18:03 +0200)] 
bash-completion: unify indentation

5 years agobash-completion: properly autocomplete escaped unit names
Frantisek Sumsal [Wed, 24 Apr 2019 12:22:44 +0000 (14:22 +0200)] 
bash-completion: properly autocomplete escaped unit names

5 years agoNEWS: List getty@tty1.service as not being enabled anymore
Paul Menzel [Tue, 23 Apr 2019 15:11:51 +0000 (17:11 +0200)] 
NEWS: List getty@tty1.service as not being enabled anymore

Fixes: https://github.com/systemd/systemd/issues/12345
5 years agoMerge pull request #12351 from keszybz/sd-bus-add-symbol
Lennart Poettering [Wed, 24 Apr 2019 08:23:10 +0000 (10:23 +0200)] 
Merge pull request #12351 from keszybz/sd-bus-add-symbol

Add symbol to tell the linker that new libsystemd version is needed

5 years agoman: describe interaction with ProtectHome=/InaccessiblePaths= in BindMount=
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 08:28:38 +0000 (10:28 +0200)] 
man: describe interaction with ProtectHome=/InaccessiblePaths= in BindMount=

https://github.com/systemd/systemd/issues/7153#issuecomment-485252308

Apparently this is still confusing for people.

Longer-term, I think we should just make BindMount= automatically "upgrade"
(or "downgrade", depending on how you look at this), any InaccessiblePath=
mountpoints to "tmpfs". I don't see much point in forcing users to remember
this interaction. But let's at least document the status quo, we can always
update the docs if the code changes.

5 years agocore: immediately trigger watchdog action on WATCHDOG=trigger
Jan Klötzke [Wed, 7 Mar 2018 13:16:49 +0000 (14:16 +0100)] 
core: immediately trigger watchdog action on WATCHDOG=trigger

A service might be able to detect errors by itself that may require the
system to take the same action as if the service locked up. Add a
WATCHDOG=trigger state change notification to sd_notify() to let the
service manager know about the self-detected misery and instantly
trigger the configured watchdog behaviour.

5 years agoMerge pull request #12366 from lkundrak/lr/olpc-xo-175-keyboard
Lennart Poettering [Wed, 24 Apr 2019 08:15:54 +0000 (10:15 +0200)] 
Merge pull request #12366 from lkundrak/lr/olpc-xo-175-keyboard

Add support for OLPC XO-1.75 keyboard

5 years agoMerge pull request #12367 from keszybz/accept-check
Lennart Poettering [Wed, 24 Apr 2019 08:14:51 +0000 (10:14 +0200)] 
Merge pull request #12367 from keszybz/accept-check

Put a limit on the loop to flush connections

5 years agosemaphore: merge semaphore scripts to avoid code duplication (#12365)
Frantisek Sumsal [Wed, 24 Apr 2019 05:52:49 +0000 (07:52 +0200)] 
semaphore: merge semaphore scripts to avoid code duplication (#12365)

5 years agoshared/mount-util: make sure utab is ignored in umount_recursive() 12218/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 21:52:15 +0000 (23:52 +0200)] 
shared/mount-util: make sure utab is ignored in umount_recursive()

See https://github.com/systemd/systemd/pull/12218#pullrequestreview-226029985.

5 years agoAdd helper function for mnt_table_parse_{stream,mtab}
Zbigniew Jędrzejewski-Szmek [Fri, 5 Apr 2019 12:43:06 +0000 (14:43 +0200)] 
Add helper function for mnt_table_parse_{stream,mtab}

This wraps a few common steps. It is defined as inline function instead of in a
.c file to avoid having a .c file. With a .c file, we would have three choices:
- either link it into libshared, but then then libshared would have to be
  linked to libmount.
- or compile the .c file into each target separately. This has the disdvantage
  that configuration of every target has to be updated and stuff will be compiled
  multiple times anyway, which is not too different from keeping this in the
  header file.
- or create a new convenience library just for this. This also has the disadvantage
  that the every target would have to be updated, and a separate library for a
  10 line function seems overkill.

By keeping everything in a header file, we compile this a few times, but
otherwise it's the least painful option. The compiler can optimize most of the
function away, because it knows if 'source' is set or not.

5 years agomount-tool: use libmount to parse /proc/self/mountinfo
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2019 11:41:47 +0000 (13:41 +0200)] 
mount-tool: use libmount to parse /proc/self/mountinfo

Same motivation as in other places: let's use a single logic to parse this.

Use path_equal() to compare the path.

A bug in error handling is fixed: if we failed after the GREEDY_REALLOC but
before the line that sets the last item to NULL, we would jump to
_cleanup_strv_free_ with the strv unterminated. Let's use GREEDY_REALLOC0
to avoid the issue.

5 years agoshared/mount-util: convert to libmount
Zbigniew Jędrzejewski-Szmek [Thu, 4 Apr 2019 11:36:19 +0000 (13:36 +0200)] 
shared/mount-util: convert to libmount

It seems better to use just a single parsing algorithm for /proc/self/mountinfo.

Also, unify the naming of variables in all places that use mnt_table_next_fs().
It makes it easier to compare the different call sites.

5 years agomeson: do not use f-strings 12351/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 12:09:18 +0000 (14:09 +0200)] 
meson: do not use f-strings

Our travis CI still uses python3.5. I'm making this into a separate
commit to make it easy to revert later.

5 years agoman: document sd_bus_add_{object,fallback}_vtable
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:39:30 +0000 (22:39 +0200)] 
man: document sd_bus_add_{object,fallback}_vtable

The interface provided by those two functions is huge, so this text could
probably be made two or three times as long if all details were described.
But I think it's a good start.

5 years agosd-bus: when running user find function don't trust the value to be initialized
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:25:03 +0000 (22:25 +0200)] 
sd-bus: when running user find function don't trust the value to be initialized

The find function is externally provided, and we shouldn't trust that the
authors remember to set the output parameter in all cases.

5 years agobusctl: add introspect --xml-interface
Zbigniew Jędrzejewski-Szmek [Sun, 21 Apr 2019 20:23:45 +0000 (22:23 +0200)] 
busctl: add introspect --xml-interface

This wraps the call to org.freedesktop.DBus.Introspectable.Introspect.
Using "busctl call" directly is inconvenient because busctl escapes the
string before printing.

Example:
$ busctl introspect --xml org.freedesktop.systemd1 /org/freedesktop/systemd1 | pygmentize -lxml | less -RF

5 years agotest-bus-{vtable,introspect}: share data and test introspect_path()
Zbigniew Jędrzejewski-Szmek [Fri, 19 Apr 2019 11:30:09 +0000 (13:30 +0200)] 
test-bus-{vtable,introspect}: share data and test introspect_path()

test-bus-introspect is also applied to the tables from test-bus-vtable.c.

test-bus-vtable.c is also used as C++ sources to produce test-bus-vtable-cc,
and our hashmap headers are not C++ compatible. So let's do the introspection
part only in the C version.

5 years agoMerge pull request #12320 from mrc0mmand/tweak-start-timeout-in-TEST-16-EXTEND-TIMEOUT
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:48:47 +0000 (15:48 +0200)] 
Merge pull request #12320 from mrc0mmand/tweak-start-timeout-in-TEST-16-EXTEND-TIMEOUT

test: don't timeout while waiting for other test units

5 years agobasic/socket-util: put a limit on the loop to flush connections 12367/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Apr 2019 13:24:56 +0000 (15:24 +0200)] 
basic/socket-util: put a limit on the loop to flush connections

Follow-up for #12346.

5 years agohwdb: Fix the key codes of the OLPC XO button pad 12366/head
Lubomir Rintel [Tue, 23 Apr 2019 13:09:17 +0000 (15:09 +0200)] 
hwdb: Fix the key codes of the OLPC XO button pad

These are not on a key pad. These codes are sent by the "rocker" buttons
that resemble a game pad.