platform/upstream/systemd.git
4 years agosd-device: allow sd_device_get_devtype to be called with NULL arg and do not assert
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 15:49:03 +0000 (17:49 +0200)]
sd-device: allow sd_device_get_devtype to be called with NULL arg and do not assert

We shouldn't call assert() on user-specified arguments in public functions.
While at it, let's return 1 if the type exists, and 0 otherwise.

4 years agoMove PLYMOUTH_SOCKET define to def.h and nuke plymouth-util.h
Zbigniew Jędrzejewski-Szmek [Thu, 24 Oct 2019 09:18:35 +0000 (11:18 +0200)]
Move PLYMOUTH_SOCKET define to def.h and nuke plymouth-util.h

Let's not have a file with a single define.

4 years agoRemove unused plymouth_running() function
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 20:56:24 +0000 (22:56 +0200)]
Remove unused plymouth_running() function

4 years agotest: drop duplicated 's'
Yu Watanabe [Thu, 24 Oct 2019 02:08:48 +0000 (11:08 +0900)]
test: drop duplicated 's'

This fixes the following log message
```
Container TEST-07-ISSUE-1981 terminated by signal KILL.
E: test timed out after 30s s
```

4 years agoMerge pull request #13828 from keszybz/networkctl-print-wlan
Yu Watanabe [Thu, 24 Oct 2019 02:12:39 +0000 (11:12 +0900)]
Merge pull request #13828 from keszybz/networkctl-print-wlan

networkctl support for ssid and bssid

4 years agoudev/cdrom_id: Do not open CD-rom in exclusive mode.
Michal Suchanek [Sun, 20 Oct 2019 10:12:20 +0000 (12:12 +0200)]
udev/cdrom_id: Do not open CD-rom in exclusive mode.

When you have a CD automunt solution that talks directly to the kernel
independently of udev it races with cdrom_id for exclusive access to the
device failing unpredictably.

The whole is_mounted function in cdrom_id is broken: there is no saying
what happens between calling is_mounted and opening the device.

Hence assume that the device can be mounted asynchronously at any time,
do not use exclusive access, and do away with is_mouted.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
4 years agonetworkctl: print ssid and bssid
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 15:05:33 +0000 (17:05 +0200)]
networkctl: print ssid and bssid

4 years agonetworkctl: create the sd_device structure just once
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 15:02:18 +0000 (17:02 +0200)]
networkctl: create the sd_device structure just once

This is mostly in preparation for future changes: a proper freeing function
is now called on the LinkInfo items.

4 years agonetwork: split out functions to get ssid and bssid
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 11:01:35 +0000 (13:01 +0200)]
network: split out functions to get ssid and bssid

4 years agoMerge pull request #13807 from 1848/ip6gre_key_fix
Yu Watanabe [Wed, 23 Oct 2019 14:18:59 +0000 (23:18 +0900)]
Merge pull request #13807 from 1848/ip6gre_key_fix

networkd: Set key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces.

4 years agol10n(zh_TW): update translations
pan93412 [Wed, 23 Oct 2019 11:19:54 +0000 (19:19 +0800)]
l10n(zh_TW): update translations

4 years agorun: add -u as a synonym for --unit
David Tardon [Wed, 23 Oct 2019 07:13:15 +0000 (09:13 +0200)]
run: add -u as a synonym for --unit

Other tools that do have --unit= option (journalctl and systemd-cgls)
already do this, so let's be consistent.

4 years agoMerge pull request #13825 from keszybz/nspawn-console-help
Yu Watanabe [Wed, 23 Oct 2019 13:03:53 +0000 (22:03 +0900)]
Merge pull request #13825 from keszybz/nspawn-console-help

nspawn: fix handling of --console=help

4 years agoMerge pull request #13142 from yuwata/network-wifi-ssid-support-nl80211
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 12:51:23 +0000 (14:51 +0200)]
Merge pull request #13142 from yuwata/network-wifi-ssid-support-nl80211

network: wifi ssid support with nl80211

4 years agonetworkctl: split out helper function
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 10:24:42 +0000 (12:24 +0200)]
networkctl: split out helper function

4 years agonetworkctl: show carrier in green for loopback iface
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 09:10:32 +0000 (11:10 +0200)]
networkctl: show carrier in green for loopback iface

We don't ever expect anything different, so let's hightlight
that carrier in this case is OK.

4 years agoman: reorder description of nspawn --console
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 08:13:30 +0000 (10:13 +0200)]
man: reorder description of nspawn --console

The default value was described at the end of two long paragraphs.
Make the first para self contained, and move the description of --console=pipe
into the second para.

4 years agonspawn: fix handling of --console=help
Zbigniew Jędrzejewski-Szmek [Wed, 23 Oct 2019 07:20:46 +0000 (09:20 +0200)]
nspawn: fix handling of --console=help

We shouldn't continue to run the container after printing help.

4 years agoMerge pull request #13820 from keszybz/dead-code-removal
Yu Watanabe [Wed, 23 Oct 2019 07:11:27 +0000 (16:11 +0900)]
Merge pull request #13820 from keszybz/dead-code-removal

Dead code removal

4 years agoAdded ip6gre example to man
1848 [Tue, 22 Oct 2019 15:41:10 +0000 (17:41 +0200)]
Added ip6gre example to man

4 years agoRevert "sysusers: properly mark generated accounts as locked"
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 14:26:42 +0000 (16:26 +0200)]
Revert "sysusers: properly mark generated accounts as locked"

This reverts the gist of commit 636e72bce63e7e99b76357f7d524d16f61558775.
The comment and the tiny cleanup are left alone.

We shouldn't lock the accounts because people actually need to use them, and
if they are locked, various tools will refuse.
See https://github.com/systemd/systemd/pull/13277#issuecomment-529964578
and follow-up comments.

4 years agojournal: Consistently capitalize printed header entries
Thibault Nélis [Mon, 21 Oct 2019 18:37:08 +0000 (20:37 +0200)]
journal: Consistently capitalize printed header entries

Per comments in https://github.com/systemd/systemd/pull/13808.

4 years agoRemove unprintable non-ASCII char from special glyph ASCII fallback table
Marko Myllynen [Mon, 21 Oct 2019 18:58:51 +0000 (21:58 +0300)]
Remove unprintable non-ASCII char from special glyph ASCII fallback table

4 years agoMerge pull request #13811 from keszybz/logind-signal-emitting-fix
Anita Zhang [Tue, 22 Oct 2019 00:13:57 +0000 (17:13 -0700)]
Merge pull request #13811 from keszybz/logind-signal-emitting-fix

Logind signal emitting fix

4 years agoupdate-utmp: remove dead conditional
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 18:58:18 +0000 (20:58 +0200)]
update-utmp: remove dead conditional

Coverity was complaining that runlevel>0 is guaranteed at this point.
CID #1404262.

While at it, shorten the code a bit.

4 years agotty-ask-password: fix dead code path
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 18:52:18 +0000 (20:52 +0200)]
tty-ask-password: fix dead code path

Coverity was complaining that watch==1 always at this point.
CID #1405882.

Use structured initialization while at it.

4 years agojournal-remote: reduce scope of variable
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 17:43:07 +0000 (19:43 +0200)]
journal-remote: reduce scope of variable

https://github.com/systemd/systemd/pull/11953/files#r264188513

4 years agoresolved: fix connection failures with TLS 1.3 and GnuTLS
Peter Wu [Sun, 20 Oct 2019 17:10:31 +0000 (18:10 +0100)]
resolved: fix connection failures with TLS 1.3 and GnuTLS

Prefer TLS 1.3 before TLS 1.2 for DNS-over-TLS support, otherwise
servers compliant with RFC 8446 might end up agreeing TLS 1.2 plus a
downgrade signal which is not expected by GnuTLS clients. This manifests
in the following error:

    Failed to invoke gnutls_handshake: An illegal parameter has been received.

Fixes: #13528
Fixes: v242-962-g9c0624dcdb ("resolved: support TLS 1.3 when using GnuTLS for DNS-over-TLS")

4 years agohwdb: Add Medion Akoya E2215T MD60198 sensor orientation quirk
Hans de Goede [Sat, 19 Oct 2019 11:29:37 +0000 (13:29 +0200)]
hwdb: Add Medion Akoya E2215T MD60198 sensor orientation quirk

Add sensor orientation quirk for the Medion Akoya E2215T so that
desktop-environments show their graphics the right way up.

4 years agomailmap: add entry to fix authorship of commit
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 13:10:50 +0000 (15:10 +0200)]
mailmap: add entry to fix authorship of commit

471cffcfb0e005b7c4044b3b52cc4f25d217efac was committed on a debug VM where I
didn't have git set up properly.

4 years agologind: fix emission of PropertiesChanged for users
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 13:07:36 +0000 (15:07 +0200)]
logind: fix emission of PropertiesChanged for users

The same as parent commit, but users. This is the third and last
foo_object_find() function in logind, so I think that this particular
family of bugs is finally squashed.

4 years agologind: fix emission of PropertiesChanged on seats
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 13:05:58 +0000 (15:05 +0200)]
logind: fix emission of PropertiesChanged on seats

The story is the same as in 471cffcfb0e005b7c4044b3b52cc4f25d217efac:
device_attach() → seat_send_changed() → sd_bus_emit_properties_changed_strv()
→ emit_properties_changed_on_interface() → node_vtable_get_userdata()
→ seat_object_find(), which returns 0 because message == NULL.
But when we are emitting a signal, message is always NULL. Removing the
overeager check and assert in the called function allow the signal to be
emitted.

Fixes #13769.

4 years agologind: drop {}
Zbigniew Jędrzejewski-Szmek [Mon, 21 Oct 2019 07:33:19 +0000 (09:33 +0200)]
logind: drop {}

4 years agoAdd Schneider SCT101CTM to sensor hwdb
Daniel [Sun, 20 Oct 2019 23:48:34 +0000 (01:48 +0200)]
Add Schneider SCT101CTM to sensor hwdb

4 years agoSet key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces.
1848 [Sat, 19 Oct 2019 22:25:58 +0000 (00:25 +0200)]
Set key (IFLA_GRE_IKEY,IFLA_GRE_OKEY) on ip6gre interfaces.

4 years agoudev: tag any display devices as master-of-seat when nomodeset is used
Zbigniew Jędrzejewski-Szmek [Thu, 17 Oct 2019 10:37:12 +0000 (12:37 +0200)]
udev: tag any display devices as master-of-seat when nomodeset is used

Fixes #13773. See also https://bugzilla.redhat.com/show_bug.cgi?id=1728240,
https://github.com/sddm/sddm/issues/1204.

When nomodeset is used on the kernel command line, there is no graphics
device that the kernel knows, so we don't tag anything as master-of-seat,
and seat0 has CanGraphical=no.

$ loginctl seat-status seat0 ; loginctl show-seat seat0
seat0
         Devices:
                  ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
                  │ input:input0 "Power Button"
                  ├─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1
                  │ usb:usb1
                  │ └─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input4
                  │   input:input4 "QEMU QEMU USB Tablet"
                  ├─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb2
                  │ usb:usb2
                  ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card0
                  │ sound:card0 "Intel"
                  ├─/sys/devices/platform/i8042/serio0/input/input1
                  │ input:input1 "AT Translated Set 2 keyboard"
                  │ ├─/sys/devices/platform/i8042/serio0/input/input1/input1::capslock
                  │ │ leds:input1::capslock
                  │ ├─/sys/devices/platform/i8042/serio0/input/input1/input1::numlock
                  │ │ leds:input1::numlock
                  │ └─/sys/devices/platform/i8042/serio0/input/input1/input1::scrolllock
                  │   leds:input1::scrolllock
                  └─/sys/devices/platform/i8042/serio1/input/input3
                    input:input3 "ImExPS/2 Generic Explorer Mouse"
Id=seat0
CanMultiSession=yes
CanTTY=yes
CanGraphical=no
Sessions=
IdleHint=yes
IdleSinceHint=0
IdleSinceHintMonotonic=0

Let's tag the PCI device with "master-of-seat", so we get CanGraphical=yes, and "seat",
so it is show as part of the seat:

[fedora@f31-bios ~]$ loginctl seat-status seat0 ; loginctl show-seat seat0
seat0
         Devices:
                  ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
                  │ input:input0 "Power Button"
                  ├─/sys/devices/pci0000:00/0000:00:01.0
                  │ [MASTER] pci:0000:00:01.0
                  ├─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1
                  │ usb:usb1
                  │ └─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb1/1-1/1-1:1.0/0003:0627:0001.0001/input/input4
                  │   input:input4 "QEMU QEMU USB Tablet"
                  ├─/sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0/usb2
                  │ usb:usb2
                  ├─/sys/devices/pci0000:00/0000:00:1b.0/sound/card0
                  │ sound:card0 "Intel"
                  ├─/sys/devices/platform/i8042/serio0/input/input1
                  │ input:input1 "AT Translated Set 2 keyboard"
                  │ ├─/sys/devices/platform/i8042/serio0/input/input1/input1::capslock
                  │ │ leds:input1::capslock
                  │ ├─/sys/devices/platform/i8042/serio0/input/input1/input1::numlock
                  │ │ leds:input1::numlock
                  │ └─/sys/devices/platform/i8042/serio0/input/input1/input1::scrolllock
                  │   leds:input1::scrolllock
                  └─/sys/devices/platform/i8042/serio1/input/input3
                    input:input3 "ImExPS/2 Generic Explorer Mouse"
Id=seat0
CanMultiSession=yes
CanTTY=yes
CanGraphical=yes
Sessions=
IdleHint=yes
IdleSinceHint=0
IdleSinceHintMonotonic=0

4 years agoMerge pull request #13795 from ddstreet/test-41
Anita Zhang [Sat, 19 Oct 2019 01:36:48 +0000 (18:36 -0700)]
Merge pull request #13795 from ddstreet/test-41

WIP: test: debug TEST-41 failure on Ubuntu CI

4 years agotest: correct TEST-41 StartLimitBurst test
Dan Streetman [Thu, 17 Oct 2019 15:06:18 +0000 (11:06 -0400)]
test: correct TEST-41 StartLimitBurst test

TEST-41 verifies that the StartLimitBurst property will correctly
limit the number of unit restarts, but the test currently doesn't
adjust the StartLimitIntervalSec which defaults to 10 seconds.

On Ubuntu CI, running under un-accelerated qemu, it can take more than
10 seconds to perform all 3 restarts, which avoids the burst limit,
and fails the test.

Instead, specify a long StartLimitIntervalSec in the test, so we can
be sure to correctly test StartLimitBurst even on slow testbeds.

Fixes #13794.

4 years agoadd test for ExecStopPost
David Tardon [Thu, 3 Oct 2019 17:05:06 +0000 (19:05 +0200)]
add test for ExecStopPost

This is a follow-up to #4843.

4 years agosystemd-fsck: fix systemd-fsck/fsck pipe bad closure
Benjamin Bouvier [Tue, 1 Oct 2019 09:12:10 +0000 (12:12 +0300)]
systemd-fsck: fix systemd-fsck/fsck pipe bad closure

Currently, when console is disabled but progress is tracked, pipe opened
for communication between systemd-fsck and fsck may be closed
inadvertently (when opening of /dev/console return in error). That lead
to finish fsck prematurely (because it receives a SIGPIPE) and so fsck
may not check correctly filesystems and do not have time to fix memory
corruptions.

This commit changes the opening of /dev/console to be done previously to
pipe creation and so fix the bug described just above.

4 years agocoredump: Include module offsets in stack traces
Aaron Plattner [Thu, 17 Oct 2019 19:56:15 +0000 (12:56 -0700)]
coredump: Include module offsets in stack traces

These offsets can be useful to decode stack traces through modules that don't
have symbol names. For example, with a simple test that crashes after calling
through several static functions, systemd-coredump reports this:

 Oct 17 : Process 640333 (a.out) of user 1000 dumped core.

          Stack trace of thread 640333:
          #0  0x00005562c2b9f11d n/a (/tmp/a.out)
          #1  0x00005562c2b9f12d n/a (/tmp/a.out)
          #2  0x00005562c2b9f139 n/a (/tmp/a.out)
          #3  0x00005562c2b9f145 n/a (/tmp/a.out)
          #4  0x00007fc768b39153 __libc_start_main (libc.so.6)
          #5  0x00005562c2b9f04e n/a (/tmp/a.out)

With this change:

          Stack trace of thread 666897:
          #0  0x0000555668fbe11d n/a (/tmp/a.out + 0x111d)
          #1  0x0000555668fbe12d n/a (/tmp/a.out + 0x112d)
          #2  0x0000555668fbe139 n/a (/tmp/a.out + 0x1139)
          #3  0x0000555668fbe145 n/a (/tmp/a.out + 0x1145)
          #4  0x00007f7b5c828153 __libc_start_main (libc.so.6 + 0x27153)
          #5  0x0000555668fbe04e n/a (/tmp/a.out + 0x104e)

Disassembling the test binary shows that these offsets line up:

 0000000000001119 <crash>:
     1119:      55                      push   %rbp
     111a:      48 89 e5                mov    %rsp,%rbp
     111d:      0f 0b                   ud2                 <---- #0

 000000000000111f <b>:
     111f:      55                      push   %rbp
     1120:      48 89 e5                mov    %rsp,%rbp
     1123:      b8 00 00 00 00          mov    $0x0,%eax
     1128:      e8 ec ff ff ff          callq  1119 <crash>
     112d:      90                      nop                 <---- #1
     112e:      5d                      pop    %rbp
     112f:      c3                      retq

 0000000000001130 <a>:
     1130:      55                      push   %rbp
     1131:      48 89 e5                mov    %rsp,%rbp
     1134:      e8 e6 ff ff ff          callq  111f <b>
     1139:      90                      nop                 <---- #2
     113a:      5d                      pop    %rbp
     113b:      c3                      retq

 000000000000113c <main>:
     113c:      55                      push   %rbp
     113d:      48 89 e5                mov    %rsp,%rbp
     1140:      e8 eb ff ff ff          callq  1130 <a>
     1145:      b8 00 00 00 00          mov    $0x0,%eax    <---- #3
     114a:      5d                      pop    %rbp
     114b:      c3                      retq
     114c:      0f 1f 40 00             nopl   0x0(%rax)

 (from libc.so.6)
 0000000000027060 <__libc_start_main>:
   27060: f3 0f 1e fa           endbr64
   27064: 41 56                 push   %r14
   27066: 31 c0                 xor    %eax,%eax
   [...]
   2714c: 48 8b 44 24 18        mov    0x18(%rsp),%rax
   27151: ff d0                 callq  *%rax
   27153: 89 c7                 mov    %eax,%edi    <---- #4
   27155: e8 e6 76 01 00        callq  3e840 <exit>

4 years agotest: blacklist TEST-41 on Ubuntu CI
Dan Streetman [Thu, 17 Oct 2019 18:06:43 +0000 (14:06 -0400)]
test: blacklist TEST-41 on Ubuntu CI

This test has been failing on Ubuntu CI since introduced, let's
blacklist it until we can debug what's causing it to fail.

4 years agoceph is a network filesystem
Jonas Jelten [Thu, 17 Oct 2019 10:10:13 +0000 (12:10 +0200)]
ceph is a network filesystem

4 years agorule-syntax-check: add CONST
Jan Synacek [Thu, 17 Oct 2019 08:52:38 +0000 (10:52 +0200)]
rule-syntax-check: add CONST

4 years agoMerge pull request #13743 from anitazha/dropin_all_the_things
Chris Down [Thu, 17 Oct 2019 03:10:05 +0000 (23:10 -0400)]
Merge pull request #13743 from anitazha/dropin_all_the_things

core: support top level drop-ins through -.service.d for service units

4 years agoMerge pull request #13784 from keszybz/constify-unit-pointers
Yu Watanabe [Thu, 17 Oct 2019 00:41:36 +0000 (09:41 +0900)]
Merge pull request #13784 from keszybz/constify-unit-pointers

Constify unit pointers

4 years agoMerge pull request #13754 from claudiozz/master
Anita Zhang [Wed, 16 Oct 2019 21:21:59 +0000 (14:21 -0700)]
Merge pull request #13754 from claudiozz/master

Allow restart for oneshot units

4 years agoMerge pull request #13786 from keszybz/systemctl-start-glob-warning
Anita Zhang [Wed, 16 Oct 2019 20:50:10 +0000 (13:50 -0700)]
Merge pull request #13786 from keszybz/systemctl-start-glob-warning

systemctl: emit warning if start is used with globs

4 years agoAllow restart for oneshot units
Claudio Zumbo [Tue, 8 Oct 2019 22:04:29 +0000 (15:04 -0700)]
Allow restart for oneshot units

Picked up from https://github.com/systemd/systemd/pull/7474 , so
coauthored by @robermorales.

4 years agosystemctl: emit warning if start is used with globs
Zbigniew Jędrzejewski-Szmek [Wed, 16 Oct 2019 15:33:32 +0000 (17:33 +0200)]
systemctl: emit warning if start is used with globs

Fixes #6379.

4 years agocore/load-fragment: remove unnecessary intialization
Zbigniew Jędrzejewski-Szmek [Wed, 16 Oct 2019 14:33:54 +0000 (16:33 +0200)]
core/load-fragment: remove unnecessary intialization

manager_load_unit() better set it on success, and unit_set_slice() asserts
that the argument is not NULL, so initializing it to NULL is not useful.

4 years agocore/load-fragment: constify Unit* arguments where possible
Zbigniew Jędrzejewski-Szmek [Wed, 16 Oct 2019 14:32:45 +0000 (16:32 +0200)]
core/load-fragment: constify Unit* arguments where possible

This makes it easy to tell that the function only uses the Unit* for
reporting, and only makes changes to the other argument (which most likely
also points at the same Unit structure) for modifications.

4 years agocore: mark unit_*_printf() functions as taking a const Unit*
Zbigniew Jędrzejewski-Szmek [Wed, 16 Oct 2019 14:21:56 +0000 (16:21 +0200)]
core: mark unit_*_printf() functions as taking a const Unit*

They should never modify the unit argument, let's make this clear.
Also see 303ee60151.

4 years agoMerge pull request #13663 from ssahani/dhcp-send-option-data
Zbigniew Jędrzejewski-Szmek [Wed, 16 Oct 2019 09:31:22 +0000 (11:31 +0200)]
Merge pull request #13663 from ssahani/dhcp-send-option-data

network: DHCPv4 client- add support to send arbitary option and data

4 years agoAdd Acer Switch SW312-31 to sensor hwdb
RoadrunnerWMC [Tue, 15 Oct 2019 21:43:36 +0000 (14:43 -0700)]
Add Acer Switch SW312-31 to sensor hwdb

See issue #13732

4 years agologind: make session_prepare_vt() static
Franck Bui [Tue, 15 Oct 2019 14:43:17 +0000 (16:43 +0200)]
logind: make session_prepare_vt() static

4 years agoMerge pull request #13726 from bluca/portable_detach_symlink
Anita Zhang [Wed, 16 Oct 2019 00:16:51 +0000 (17:16 -0700)]
Merge pull request #13726 from bluca/portable_detach_symlink

portabled: allow to detach an image with a unit in linked-runtime state

4 years agoshared/dropin: support -.service.d/ top level drop-in for service units
Anita Zhang [Sat, 5 Oct 2019 00:39:34 +0000 (17:39 -0700)]
shared/dropin: support -.service.d/ top level drop-in for service units

Closes #12830

4 years agonetwork: add support matching based on BSSID=
Yu Watanabe [Wed, 24 Jul 2019 06:32:24 +0000 (15:32 +0900)]
network: add support matching based on BSSID=

4 years agonetwork: also read BSSID
Yu Watanabe [Wed, 24 Jul 2019 06:16:26 +0000 (15:16 +0900)]
network: also read BSSID

4 years agonetwork: support matching based on wifi SSID
Yu Watanabe [Wed, 24 Jul 2019 05:46:55 +0000 (14:46 +0900)]
network: support matching based on wifi SSID

4 years agonetwork: introduce link_reconfigure()
Yu Watanabe [Thu, 4 Jul 2019 04:52:03 +0000 (13:52 +0900)]
network: introduce link_reconfigure()

Will be used in later commits.

4 years agonetwork: split link_free() into two parts
Yu Watanabe [Fri, 21 Jun 2019 03:06:56 +0000 (12:06 +0900)]
network: split link_free() into two parts

4 years agosd-netlink: add nl80211 type systems
Yu Watanabe [Tue, 23 Jul 2019 06:59:48 +0000 (15:59 +0900)]
sd-netlink: add nl80211 type systems

4 years agosd-netlink: introduce sd_genl_message_get_family()
Yu Watanabe [Wed, 24 Jul 2019 04:10:12 +0000 (13:10 +0900)]
sd-netlink: introduce sd_genl_message_get_family()

4 years agosd-netlink: support NLMSG_DONE
Yu Watanabe [Tue, 23 Jul 2019 09:27:21 +0000 (18:27 +0900)]
sd-netlink: support NLMSG_DONE

4 years agosd-netlink: save dynamic general netlink message type
Yu Watanabe [Tue, 23 Jul 2019 06:54:06 +0000 (15:54 +0900)]
sd-netlink: save dynamic general netlink message type

4 years agosd-netlink: drop unnecessarily exported variables
Yu Watanabe [Tue, 23 Jul 2019 06:55:03 +0000 (15:55 +0900)]
sd-netlink: drop unnecessarily exported variables

4 years agosd-netlink: introduce sd_netlink_message_read_string_strdup()
Yu Watanabe [Sun, 22 Sep 2019 18:48:50 +0000 (03:48 +0900)]
sd-netlink: introduce sd_netlink_message_read_string_strdup()

4 years agosd-netlink: use structured initializer
Yu Watanabe [Tue, 23 Jul 2019 06:47:33 +0000 (15:47 +0900)]
sd-netlink: use structured initializer

4 years agosd-netlink: drop unused variable
Yu Watanabe [Tue, 23 Jul 2019 06:38:54 +0000 (15:38 +0900)]
sd-netlink: drop unused variable

4 years agosd-netlink: add missing license identifier
Yu Watanabe [Tue, 23 Jul 2019 06:35:29 +0000 (15:35 +0900)]
sd-netlink: add missing license identifier

4 years agobus-util: make map_basic handle SD_BUS_TYPE_OBJECT_PATH type
Yu Watanabe [Fri, 19 Jul 2019 02:14:51 +0000 (11:14 +0900)]
bus-util: make map_basic handle SD_BUS_TYPE_OBJECT_PATH type

4 years agotest-network: disable IPv6AcceptRA= to speed up tests
Yu Watanabe [Mon, 14 Oct 2019 13:51:51 +0000 (22:51 +0900)]
test-network: disable IPv6AcceptRA= to speed up tests

4 years agonetwork: DHCPv4 client: add support to send arbitary option and data
Susant Sahani [Thu, 26 Sep 2019 18:06:02 +0000 (20:06 +0200)]
network: DHCPv4 client: add support to send arbitary option and data

4 years agoMerge pull request #13760 from keszybz/unit-loading-unification
Yu Watanabe [Mon, 14 Oct 2019 14:35:54 +0000 (23:35 +0900)]
Merge pull request #13760 from keszybz/unit-loading-unification

Unit loading unification

4 years agoMerge pull request #13735 from ssahani/ip-nexthop
Yu Watanabe [Mon, 14 Oct 2019 14:25:23 +0000 (23:25 +0900)]
Merge pull request #13735 from ssahani/ip-nexthop

network: introduce ip nexthop routing

4 years agoudev: introduce CONST key name
Jan Synacek [Mon, 7 Oct 2019 08:03:07 +0000 (10:03 +0200)]
udev: introduce CONST key name

Currently, there is no way to match against system-wide constants, such
as architecture or virtualization type, without forking helper binaries.
That potentially results in a huge number of spawned processes which
output always the same answer.

This patch introduces a special CONST keyword which takes a hard-coded
string as its key and returns a value assigned to that key. Currently
implemented are CONST{arch} and CONST{virt}, which can be used to match
against the system's architecture and virtualization type.

4 years agotest-network: add a test case for nexthop
Yu Watanabe [Mon, 14 Oct 2019 12:18:01 +0000 (21:18 +0900)]
test-network: add a test case for nexthop

4 years agonetwork: update comment as DHCP is deprecated now
Yu Watanabe [Mon, 14 Oct 2019 12:19:04 +0000 (21:19 +0900)]
network: update comment as DHCP is deprecated now

4 years agonetwork: introduce ip nexthop routing
Susant Sahani [Fri, 4 Oct 2019 19:40:51 +0000 (21:40 +0200)]
network: introduce ip nexthop routing

Used to manipulate entries in the kernel's nexthop tables.
Example:
```
[NextHop]
Id=3
Gateway=192.168.5.1
```

4 years agonetwork: ndisc: do not drop all prefixes when a prefix matches a blacklist
Yu Watanabe [Sun, 13 Oct 2019 17:00:47 +0000 (02:00 +0900)]
network: ndisc: do not drop all prefixes when a prefix matches a blacklist

Fixes #13767.

4 years agoMerge pull request #13761 from dtardon/program-name
Yu Watanabe [Mon, 14 Oct 2019 11:17:28 +0000 (20:17 +0900)]
Merge pull request #13761 from dtardon/program-name

udev: do not hardcode program name

4 years agoMerge pull request #13765 from yuwata/udev-memleak-13764
Yu Watanabe [Mon, 14 Oct 2019 11:16:58 +0000 (20:16 +0900)]
Merge pull request #13765 from yuwata/udev-memleak-13764

udev,systemctl: fix memleak caused by wrong cleanup function

4 years agosystemctl: fix memleak caused by wrong cleanup func
Yu Watanabe [Sat, 12 Oct 2019 15:54:34 +0000 (00:54 +0900)]
systemctl: fix memleak caused by wrong cleanup func

4 years agoudev: fix memleak caused by wrong cleanup function
Yu Watanabe [Sat, 12 Oct 2019 15:35:49 +0000 (00:35 +0900)]
udev: fix memleak caused by wrong cleanup function

Fixes #13764.

4 years agoudev: do not hardcode program name
David Tardon [Fri, 11 Oct 2019 12:41:58 +0000 (14:41 +0200)]
udev: do not hardcode program name

4 years agoudev/fido_id: fix program name in usage output
David Tardon [Fri, 11 Oct 2019 12:39:56 +0000 (14:39 +0200)]
udev/fido_id: fix program name in usage output

4 years agocore: pass around pointer, not struct
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 09:43:32 +0000 (11:43 +0200)]
core: pass around pointer, not struct

Since this is a static function, the compiler is likely to optimize it away
anyway, but let's do the normal thing here.

4 years agoshared/bus-unit-util: remove some empty lines
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 10:53:31 +0000 (12:53 +0200)]
shared/bus-unit-util: remove some empty lines

We generally don't add empty lines after if. It looks especially strange
when the block has is just a single line without braces.

4 years agocore: adjust load functions for other unit types to be more like service
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 10:48:33 +0000 (12:48 +0200)]
core: adjust load functions for other unit types to be more like service

No functional change, just adjusting code to follow the same pattern
everywhere. In particular, never call _verify() on an already loaded unit,
but return early from the caller instead. This makes the code a bit easier
to follow.

4 years agocore: simplify unit_load() a bit
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 09:10:50 +0000 (11:10 +0200)]
core: simplify unit_load() a bit

Now all unit types define .load. But even if it wasn't defined, we'd need
to call unit_load_fragment_and_dropin() anyway, so this code would not have
worked correctly.

Also, unit_load_fragment_and_dropin() either returns -ENOENT or changes
UNIT_STUB to UNIT_LOADED, so we don't need to repeat this here.

4 years agocore/service: use common implementation of unit_load_fragment_and_dropin()
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 08:53:54 +0000 (10:53 +0200)]
core/service: use common implementation of unit_load_fragment_and_dropin()

There is a slight functional change when load_state == UNIT_MERGED. Before,
we would not call unit_load_dropin(), but now we do. I'm not sure if this
causes an actual difference in behaviour, but since all other unit types do
this, I think it's better to do the same thing here too.

4 years agocore: turn unit_load_fragment_and_dropin_optional() into a flag
Zbigniew Jędrzejewski-Szmek [Fri, 11 Oct 2019 08:41:44 +0000 (10:41 +0200)]
core: turn unit_load_fragment_and_dropin_optional() into a flag

unit_load_fragment_and_dropin() and unit_load_fragment_and_dropin_optional()
are really the same, with one minor difference in behaviour. Let's drop
the second function.

"_optional" in the name suggests that it's the "dropin" part that is optional.
(Which it is, but in this case, we mean the fragment to be optional.)
I think the new version with a flag is easier to understand.

4 years agoMerge pull request #13749 from keszybz/pyparsing-2.4
Yu Watanabe [Thu, 10 Oct 2019 23:43:10 +0000 (08:43 +0900)]
Merge pull request #13749 from keszybz/pyparsing-2.4

Compatibility with pyparsing 2.4

4 years agoparse_hwdb: fix compatibility with pyparsing 2.4.*
Zbigniew Jędrzejewski-Szmek [Tue, 8 Oct 2019 12:44:35 +0000 (14:44 +0200)]
parse_hwdb: fix compatibility with pyparsing 2.4.*

pyparsing 2.3.1/2.4.0 had some changes to grouping of And matches, and as a
result we'd report 0 properties and 0 matches, and not really do any checks.

With this change we get identical behaviour for pyparsing 2.3.1, 2.4.0, 2.4.2:

$ hwdb/parse_hwdb.py
hwdb/60-evdev.hwdb: 72 match groups, 94 matches, 262 properties
hwdb/60-input-id.hwdb: 3 match groups, 3 matches, 4 properties
hwdb/60-keyboard.hwdb: 173 match groups, 256 matches, 872 properties
Keycode KBD_LCD_MENU1 unknown
Keycode KBD_LCD_MENU4 unknown
Keycode KBD_LCD_MENU2 unknown
Keycode KBD_LCD_MENU3 unknown
hwdb/60-sensor.hwdb: 101 match groups, 120 matches, 105 properties
hwdb/70-joystick.hwdb: 2 match groups, 3 matches, 2 properties
hwdb/70-mouse.hwdb: 104 match groups, 119 matches, 123 properties
hwdb/70-pointingstick.hwdb: 8 match groups, 30 matches, 11 properties
hwdb/70-touchpad.hwdb: 6 match groups, 9 matches, 6 properties

4 years agoparse_hwdb: process files in order
Zbigniew Jędrzejewski-Szmek [Tue, 8 Oct 2019 12:22:17 +0000 (14:22 +0200)]
parse_hwdb: process files in order

Also, make the pattern more general. There are some plans to add more files
there, let's make sure we don't miss them.

4 years agoparse_hwdb: bail with an error if no matches or groups are detected
Zbigniew Jędrzejewski-Szmek [Tue, 8 Oct 2019 12:21:26 +0000 (14:21 +0200)]
parse_hwdb: bail with an error if no matches or groups are detected

pyparsing sometimes changes behaviour and stops giving matches. This should
allow us to detect such scenario. With this change, parse_hwdb fails with
pyparsing 2.4 on F31.

4 years agoRename udev's hwdb/ to hwdb.d/
Zbigniew Jędrzejewski-Szmek [Tue, 8 Oct 2019 14:52:10 +0000 (16:52 +0200)]
Rename udev's hwdb/ to hwdb.d/

As in the parent commit, this makes the name consistent with the
rest of the source tree and the actuall installation path.

4 years agoRename udev's rules/ to rules.d/
Zbigniew Jędrzejewski-Szmek [Tue, 8 Oct 2019 14:43:18 +0000 (16:43 +0200)]
Rename udev's rules/ to rules.d/

This change is only about the source tree. We have tmpfiles.d/, modprobe.d/,
sysctl.d/, and sysusers.d/, but for historical reasons, rules/ didn't fit this
pattern. We also *install* it as rules.d/. Let's rename to be consistent.