]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agohomed: don't insist on authentication against host-copy user record 15869/head
Lennart Poettering [Wed, 20 May 2020 16:38:07 +0000 (18:38 +0200)] 
homed: don't insist on authentication against host-copy user record

homed maintains two or three copies of the user's identity record per
home directory: one on the host, one inside the LUKS header, and one
embedded in the home directory.

Previously we'd insist that if a user logs in they have to authenticate
against all three, as a safety feature. This broke logging into
unfixated records however, since in that case the host version is
synthetic and thus does not carry any authentication data.

Let's hence losen the strictness here: accept authentication against
host records that carry no auth data. This should be safe as we know
after all that the second/third record will catch invalid accesses.

Fixes: #15178
3 years agohomed: include error string when in log message if quota doesn't work
Lennart Poettering [Wed, 20 May 2020 16:12:41 +0000 (18:12 +0200)] 
homed: include error string when in log message if quota doesn't work

3 years agobus-util: actually register the object manager
Lennart Poettering [Wed, 20 May 2020 16:07:23 +0000 (18:07 +0200)] 
bus-util: actually register the object manager

3 years agohomed: also fsync private/public key pair when storing it
Lennart Poettering [Wed, 20 May 2020 16:06:56 +0000 (18:06 +0200)] 
homed: also fsync private/public key pair when storing it

3 years agohomed: fix typo
Lennart Poettering [Wed, 20 May 2020 16:06:27 +0000 (18:06 +0200)] 
homed: fix typo

3 years agohomed: make sure we log about invalid user records we load
Lennart Poettering [Wed, 20 May 2020 15:26:17 +0000 (17:26 +0200)] 
homed: make sure we log about invalid user records we load

3 years agohomed: automatically clean up empty user record files
Lennart Poettering [Wed, 20 May 2020 15:25:50 +0000 (17:25 +0200)] 
homed: automatically clean up empty user record files

See: #15178

3 years agohomed: when updating local copy of user record, sync to disk
Lennart Poettering [Wed, 20 May 2020 15:14:51 +0000 (17:14 +0200)] 
homed: when updating local copy of user record, sync to disk

Apparently xfs needs us to sync explicitly, see #15178.

3 years agofileio: sync directory after rename, too
Lennart Poettering [Wed, 20 May 2020 15:14:48 +0000 (17:14 +0200)] 
fileio: sync directory after rename, too

3 years agohomed: return a better error when a home has no authentication information defined
Lennart Poettering [Wed, 20 May 2020 15:02:12 +0000 (17:02 +0200)] 
homed: return a better error when a home has no authentication information defined

We can't log into home entries that have no password or PKCS#11 token.
Return a proper, useful error in that case.

See: #15178

3 years agoMerge pull request #15433 from mrc0mmand/test-reintroduce-parallelization
Zbigniew Jędrzejewski-Szmek [Thu, 21 May 2020 15:56:33 +0000 (17:56 +0200)] 
Merge pull request #15433 from mrc0mmand/test-reintroduce-parallelization

test: copy the test image instead of symlinking it

3 years agoMerge pull request #15873 from evverx/pointer-overflow-oss-fuzz
Zbigniew Jędrzejewski-Szmek [Thu, 21 May 2020 13:55:42 +0000 (15:55 +0200)] 
Merge pull request #15873 from evverx/pointer-overflow-oss-fuzz

oss-fuzz: turn on the pointer-overflow check

3 years agoUpdate resolvectl zsh completion
codicodi [Thu, 21 May 2020 10:37:43 +0000 (12:37 +0200)] 
Update resolvectl zsh completion

3 years agoshared: treat generator units as vendor units
Jeremy Cline [Fri, 15 May 2020 20:28:35 +0000 (16:28 -0400)] 
shared: treat generator units as vendor units

Units created with "systemctl edit --full" from generator units aren't
removed with "systemctl revert" because units in the generator,
generator_early, and generator_late paths aren't considered vendor
units.

Alter path_is_vendor() to return true if the given path is a
generator unit, which in turn causes "systemctl revert" to remove units
created with "systemctl edit --full" as they now have vendor versions.

Fixes #10053

3 years agoudev: rename the persistent link for ATA devices
Lidong Zhong [Tue, 14 Apr 2020 16:54:57 +0000 (00:54 +0800)] 
udev: rename the persistent link for ATA devices

ATA devices should use the ATA ids like port number and (possibly)
master/slave or multiplier id, not the generic SCSI ID.
Currently only port number is included in the link. With this patch
the link would be able to support more cases, which are a) when the
device is behind a port multiplexer b) the distinction between master
and slave (distinguished by target id).

I tried to verify scenario a) with this patch, but I failed to find a
machine with PMP SATA devices attached. But the link below
https://github.com/systemd/systemd/issues/3943
could show what's the difference. Here is my test for scenario b)

Current version:
linux-ql21:~ # ll /sys/class/block/sd[ab]
lrwxrwxrwx 1 root root 0 May  8 20:46 /sys/class/block/sda ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 May  8 20:46 /sys/class/block/sdb ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb
linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-1
lrwxrwxrwx 1 root root 9 May  8 20:44
/dev/disk/by-path/pci-0000:00:01.1-ata-1 -> ../../sdb
linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-path/pci-0000:00:01.1-ata-1
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1
E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-path/pci-0000:00:01.1-ata-1

After patch applied:
linux-ql21:~ # ll /sys/class/block/sd[ab]
lrwxrwxrwx 1 root root 0 May  8 21:07 /sys/class/block/sda ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:0/3:0:0:0/block/sda
lrwxrwxrwx 1 root root 0 May  8 21:07 /sys/class/block/sdb ->
../../devices/pci0000:00/0000:00:01.1/ata4/host3/target3:0:1/3:0:1:0/block/sdb
linux-ql21:~ # ll /dev/disk/by-path/pci-0000\:00\:01.1-ata-*
lrwxrwxrwx 1 root root  9 May  8 21:07
/dev/disk/by-path/pci-0000:00:01.1-ata-1.0 -> ../../sda
lrwxrwxrwx 1 root root  9 May  8 21:07
/dev/disk/by-path/pci-0000:00:01.1-ata-1.1 -> ../../sdb
linux-ql21:~ # udevadm info /sys/class/block/sda |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1.0
E: DEVLINKS=/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-id/ata-VBOX_HARDDISK_VB3649e885-3e0cdd64
/dev/disk/by-path/pci-0000:00:01.1-ata-1.0
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VB3649e885-3e0cdd64
linux-ql21:~ # udevadm info /sys/class/block/sdb |grep by-path
S: disk/by-path/pci-0000:00:01.1-ata-1.1
E: DEVLINKS=/dev/disk/by-id/scsi-0ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/ata-VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-1ATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-id/scsi-SATA_VBOX_HARDDISK_VBc53b2498-d84ae8de
/dev/disk/by-path/pci-0000:00:01.1-ata-1.1

Changelog:
v5: add another parameter compat_link in handle_scsi()
v4: comment for ID_PATH_ATA_COMPAT
    get string length with pointer difference
    (suggested by Franck Bui<fbui@suse.com>)
v3: creating compatible link from env
    variables type change
v2: remove udev rules modification for compatible link
    setup a test scenario of master/slave ATA devices
v1: initial patch

3 years agorules: automatically pull in smartcard.target from all CCID devices
Lennart Poettering [Tue, 19 May 2020 22:35:30 +0000 (00:35 +0200)] 
rules: automatically pull in smartcard.target from all CCID devices

We apparently never matched the USB interface class. Let's fix that.

Prompted by: #15676

3 years agoMerge pull request #15870 from poettering/proc-cmdline-efi-fix
Zbigniew Jędrzejewski-Szmek [Thu, 21 May 2020 07:07:27 +0000 (09:07 +0200)] 
Merge pull request #15870 from poettering/proc-cmdline-efi-fix

udev /proc/cmdline handling fixes

3 years agodocs: add a link to the Fossies codespell report 15873/head
Evgeny Vereshchagin [Thu, 21 May 2020 07:00:53 +0000 (09:00 +0200)] 
docs: add a link to the Fossies codespell report

3 years agooss-fuzz: turn on the pointer-overflow check
Evgeny Vereshchagin [Thu, 21 May 2020 06:20:01 +0000 (08:20 +0200)] 
oss-fuzz: turn on the pointer-overflow check

It's off by default on OSS-Fuzz but it should be safe to turn it on
manually: https://github.com/google/oss-fuzz/issues/659#issuecomment-631897889

Just a follow-up to https://github.com/systemd/systemd/pull/15865.

3 years agohomed: fix return value mix-up
Lennart Poettering [Wed, 20 May 2020 17:55:39 +0000 (19:55 +0200)] 
homed: fix return value mix-up

We generally return > 1 if any of the actions we are doing is instantly
complete and == 0 when we started doing it asynchronously (by forking
off homework), in our functions that execute operations on homes.

Fix a mix-up where the test for this was reversed in
home_dispatch_release() and home_dispatch_lock_all().

Fixes: #15684
3 years agoMerge pull request #15557 from poettering/journal-zero-fix
Anita Zhang [Thu, 21 May 2020 01:14:51 +0000 (18:14 -0700)] 
Merge pull request #15557 from poettering/journal-zero-fix

journal: deal better with reading from zeroed out journal mmaps

3 years agoMerge pull request #15865 from evverx/ubsan-to-the-rescue
Evgeny Vereshchagin [Thu, 21 May 2020 00:17:20 +0000 (03:17 +0300)] 
Merge pull request #15865 from evverx/ubsan-to-the-rescue

build-system: build the fuzz targets with both ASan and UBSan

3 years agoMerge pull request #15854 from poettering/call-method-ret-error
Anita Zhang [Wed, 20 May 2020 22:12:37 +0000 (15:12 -0700)] 
Merge pull request #15854 from poettering/call-method-ret-error

explain async bus method callback ret_error parameter

3 years agoMerge pull request #15864 from poettering/pam-sudo-fixes-part3
Anita Zhang [Wed, 20 May 2020 22:01:52 +0000 (15:01 -0700)] 
Merge pull request #15864 from poettering/pam-sudo-fixes-part3

two more pam_systemd fixes, split out of #15742

3 years agoMerge pull request #15868 from keszybz/fix-failed-to-fix-up-pid1-environment
Lennart Poettering [Wed, 20 May 2020 19:07:47 +0000 (21:07 +0200)] 
Merge pull request #15868 from keszybz/fix-failed-to-fix-up-pid1-environment

Fix bad errno checks

3 years agoproc-cmdline: make checking of EFI options variable optional 15870/head
Lennart Poettering [Wed, 20 May 2020 17:22:09 +0000 (19:22 +0200)] 
proc-cmdline: make checking of EFI options variable optional

And do not use it in the IMPORT{cmdline} udev code. Wherever we expose
direct interfaces to check the kernel cmdline, let's not consult our
systemd-specific EFI variable, but strictly use the actual kernel
variable, because that's what we claim we do. i.e. it's fine to use the
EFI variable for our own settings, but for the generic APIs to the
kernel cmdline we should not use it.

Specifically, this applies to IMPORT{cmdline} and
ConditionKernelCommandLine=. In the latter case we weren#t checking the
EFI variable anyway, hence let's do the same for the udev case, too.

Fixes: #15739
3 years agoproc-cmdline: add checking of EFI options variable in proc_cmdline_get_key_many(...
Lennart Poettering [Wed, 20 May 2020 17:18:45 +0000 (19:18 +0200)] 
proc-cmdline: add checking of EFI options variable in proc_cmdline_get_key_many() too

3 years agoproc-cmdline: fix return value clobbering in proc_cmdline_get_key()
Lennart Poettering [Wed, 20 May 2020 17:17:44 +0000 (19:17 +0200)] 
proc-cmdline: fix return value clobbering in proc_cmdline_get_key()

Let's make sure proc_cmdline_get_key() follows our coding style: never
clobber return values on failure, and always initialize on success.

3 years agotree-wide: fix bad errno checks 15868/head
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 16:10:58 +0000 (18:10 +0200)] 
tree-wide: fix bad errno checks

3 years agobasic/efivars: fix errno propagation
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 16:08:05 +0000 (18:08 +0200)] 
basic/efivars: fix errno propagation

Fixup for 484f4e5b2d62e885998fa3c09ed4d58b6c38f987. Should fix #15730.

3 years agoMerge pull request #15274 from ssahani/network-issue-9610
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 14:39:41 +0000 (16:39 +0200)] 
Merge pull request #15274 from ssahani/network-issue-9610

DHCP4: Allow lease time to be set when missing from offer

3 years agoMerge pull request #15490 from ssahani/dhcpv6-vendor-class
Lennart Poettering [Wed, 20 May 2020 14:18:18 +0000 (16:18 +0200)] 
Merge pull request #15490 from ssahani/dhcpv6-vendor-class

network: DHCPv6 - Add support to send vendor class information

3 years agofuzzit: turn on the pointer-overflow check 15865/head
Evgeny Vereshchagin [Wed, 20 May 2020 14:05:32 +0000 (16:05 +0200)] 
fuzzit: turn on the pointer-overflow check

Now that https://github.com/systemd/systemd/issues/15583 is gone, it
should be safe to turn it on.

3 years agobuild-system: build the fuzz targets with both ASan and UBSan
Evgeny Vereshchagin [Wed, 20 May 2020 09:33:12 +0000 (11:33 +0200)] 
build-system: build the fuzz targets with both ASan and UBSan

Just a follow-up to https://github.com/systemd/systemd/pull/15860

3 years agoman: let's document explicitly that method reply handlers won't get ret_error set... 15854/head
Lennart Poettering [Tue, 19 May 2020 17:06:22 +0000 (19:06 +0200)] 
man: let's document explicitly that method reply handlers won't get ret_error set to method error

Fixes: #8108
3 years agoman: include sd_bus_message_handler_t prototype in synopsys of all man pages that...
Lennart Poettering [Tue, 19 May 2020 17:05:03 +0000 (19:05 +0200)] 
man: include sd_bus_message_handler_t prototype in synopsys of all man pages that reference the type

The type is not trivial, and kinda important to understand things, hence
import it everywhere where appropriate.

3 years agoMerge pull request #15860 from keszybz/bus-message-empty-fields
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 13:53:28 +0000 (15:53 +0200)] 
Merge pull request #15860 from keszybz/bus-message-empty-fields

Fix crash on message with empty fields structure

3 years agoMerge pull request #15661 from hundeboll/mount-read-write-only
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 13:48:04 +0000 (15:48 +0200)] 
Merge pull request #15661 from hundeboll/mount-read-write-only

Mount read write only

3 years agosd-network: DHCPv4 - Add user class, extra option and send generic options in request...
Susant Sahani [Sun, 19 Apr 2020 23:34:36 +0000 (01:34 +0200)] 
sd-network: DHCPv4 - Add user class, extra option and send generic options in request state

3 years agoMerge pull request #15535 from fbuihuu/update-runtime-watchdog-on-reload
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 13:40:34 +0000 (15:40 +0200)] 
Merge pull request #15535 from fbuihuu/update-runtime-watchdog-on-reload

pid1: update RuntimeWatchogSec setting on daemon-reload as well

3 years agoload-fragment: fix a typo
ExtinctFire [Wed, 20 May 2020 08:39:09 +0000 (16:39 +0800)] 
load-fragment: fix a typo

Correct the typo of “priority” in log message

3 years agoman: document x-systemd.rw-only fstab option 15661/head
Martin Hundebøll [Mon, 4 May 2020 08:03:54 +0000 (10:03 +0200)] 
man: document x-systemd.rw-only fstab option

3 years agofstab-generator: add x-systemd.rw-only option support
Martin Hundebøll [Mon, 4 May 2020 08:02:19 +0000 (10:02 +0200)] 
fstab-generator: add x-systemd.rw-only option support

Support enabling the ReadwriteOnly= unit setting from fstab using
'x-systemd.rw-only'

3 years agoman: document ReadWriteOnly property for mount units
Martin Hundebøll [Fri, 1 May 2020 08:27:06 +0000 (10:27 +0200)] 
man: document ReadWriteOnly property for mount units

3 years agobus-message: immediately reject messages with invalid type 15860/head
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 07:25:11 +0000 (09:25 +0200)] 
bus-message: immediately reject messages with invalid type

For whatever reason, we were very permissive with accepting messages
of unknown type. Let's just reject any unknown types as early as
possible.

3 years agobus-message: fix negative offset with ~empty message
Zbigniew Jędrzejewski-Szmek [Wed, 20 May 2020 07:05:17 +0000 (09:05 +0200)] 
bus-message: fix negative offset with ~empty message

In the linked reproducer, m->fields_size == 0, and we calculate ri == -1, which
of course doesn't end well. Skip the whole calculation if m->fields_size == 0,
and also check that we don't go negative even if it is non-zero.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19446 and #15583.

3 years agoudev: when random MACs are requested, generate them with genuine randomness
Lennart Poettering [Tue, 19 May 2020 21:07:15 +0000 (23:07 +0200)] 
udev: when random MACs are requested, generate them with genuine randomness

This is a security feature, and we thus shouldn't derive the random MACs
from a potentially guessable source. MAC addresses are after all facing
to the outside, and can be interacted with from untrusted environments.
Hence, let's generate them the same way as we generate UUIDs: from
getrandom() or /dev/urandom, and optionally with RDRAND if that's
supported.

RDRAND should be fine, since this is not cryptographic key material, but
ultimately public information. We just want to make sure conflicts are
not likely.

Previously we'd generate the MACs via rand(), which means given the
short seed they are a little bit too guessable, making collisions too
likely. See #14355 in particular.

Fixes: #14355
(Note that #14355 was already fixed by
a0f11d1d11a546f791855ec9c47c2ff830e6a5aa, but I think we should do
better even, and not rely on rand() and uninitialized random pools)

3 years agoDHCPv6: MUD URL lengh - use UINT8_MAX instead of 255 15490/head
Susant Sahani [Wed, 20 May 2020 05:59:01 +0000 (07:59 +0200)] 
DHCPv6: MUD URL lengh - use UINT8_MAX instead of 255

3 years agonetwork: DHCPv6 - Add support to send vendor class information
Susant Sahani [Sun, 17 May 2020 15:14:47 +0000 (17:14 +0200)] 
network: DHCPv6 - Add support to send vendor class information

Frame 1: 177 bytes on wire (1416 bits), 177 bytes captured (1416 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x5ca46b
    Rapid Commit
    Identity Association for Non-temporary Address
    Fully Qualified Domain Name
    Vendor Class
        Option: Vendor Class (16)
        Length: 23
        Value: 0000ab11000048656c6c6f3a686f773a6172653a796f75
        Enterprise ID: Tom Gundersen (systemd) (43793)
        vendor-class-data: Hello:how:are:you
    Identity Association for Prefix Delegation
    Option Request
    Client Identifier
    Elapsed time

3 years agosd-network: DHCPv6 - Add support to send vendor class data
Susant Sahani [Mon, 20 Apr 2020 07:04:58 +0000 (09:04 +0200)] 
sd-network: DHCPv6 - Add support to send vendor class data

```
21.16.  Vendor Class Option

   This option is used by a client to identify the vendor that
   manufactured the hardware on which the client is running.  The
   information contained in the data area of this option is contained in
   one or more opaque fields that identify details of the hardware
   configuration.  The format of the Vendor Class option is:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      OPTION_VENDOR_CLASS      |           option-len          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       enterprise-number                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                       vendor-class-data                       .
      .                             . . .                             .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Figure 28: Vendor Class Option Format

      option-code          OPTION_VENDOR_CLASS (16).

      option-len           4 + length of vendor-class-data field.

      enterprise-number    The vendor's registered Enterprise Number as
                           maintained by IANA [IANA-PEN].  A 4-octet
                           field containing an unsigned integer.

      vendor-class-data    The hardware configuration of the node on
                           which the client is running.  A
                           variable-length field (4 octets less than the
                           value in the option-len field).

   The vendor-class-data field is composed of a series of separate
   items, each of which describes some characteristic of the client's
   hardware configuration.  Examples of vendor-class-data instances
   might include the version of the operating system the client is
   running or the amount of memory installed on the client.

   Each instance of vendor-class-data is formatted as follows:

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
      |       vendor-class-len        |          opaque-data          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+

               Figure 29: Format of vendor-class-data Field

   The vendor-class-len field is 2 octets long and specifies the length
   of the opaque vendor-class-data in network byte order.

   Servers and clients MUST NOT include more than one instance of
   OPTION_VENDOR_CLASS with the same Enterprise Number.  Each instance
   of OPTION_VENDOR_CLASS can carry multiple vendor-class-data
   instances.
   ```

3 years agonetwork: DHCPv4- Allow to set DHCP lease lifetime 15274/head
Susant Sahani [Wed, 20 May 2020 04:23:36 +0000 (06:23 +0200)] 
network: DHCPv4- Allow to set DHCP lease lifetime

3 years agosd-dhcpv4: Allow to configure lease lifetime
Susant Sahani [Wed, 20 May 2020 04:30:05 +0000 (06:30 +0200)] 
sd-dhcpv4: Allow to configure lease lifetime

3 years agopam_systemd: clean up success path 15864/head
Lennart Poettering [Thu, 7 May 2020 10:53:51 +0000 (12:53 +0200)] 
pam_systemd: clean up success path

Let's make sure we always apply the process properties from the user
record, in all our three successful paths:

1. when we register a regular session
2. when we run for the systemd --user session
3. when we have no logind (but might still have complex user records
   from elsewhere) and thus exit early

3 years agoman_systemd_home: intrdouce SYSTEMD_HOME_SUSPEND env var
Lennart Poettering [Thu, 7 May 2020 10:38:05 +0000 (12:38 +0200)] 
man_systemd_home: intrdouce SYSTEMD_HOME_SUSPEND env var

This variable is read by the module and can be used instead of the
suspend= PAM module parameter.

It is also set for the session itself to make debugging easy.

3 years agoupdate TODO
Lennart Poettering [Tue, 19 May 2020 17:58:26 +0000 (19:58 +0200)] 
update TODO

3 years agoMerge pull request #15482 from ssahani/dhcpv6-userclass
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 17:38:06 +0000 (19:38 +0200)] 
Merge pull request #15482 from ssahani/dhcpv6-userclass

network: DHCPv6 Introduce  user class

3 years agosystemctl: Fix frozen state coloring
Michal Koutný [Wed, 6 May 2020 17:17:04 +0000 (19:17 +0200)] 
systemctl: Fix frozen state coloring

When unit is in an unhighlighted state, freezer coloring won't be turned off
(active_off is empty) until the end of the TTY output.

3 years agoMerge pull request #15637 from poettering/cryptsetup-literal
Lennart Poettering [Tue, 19 May 2020 17:28:42 +0000 (19:28 +0200)] 
Merge pull request #15637 from poettering/cryptsetup-literal

a number of cryptsetup fixes and additions

3 years agoman: document the newly acquired cryptsetup features 15637/head
Lennart Poettering [Wed, 29 Apr 2020 21:10:22 +0000 (23:10 +0200)] 
man: document the newly acquired cryptsetup features

3 years agocryptsetup: fix minor indentation issue
Lennart Poettering [Wed, 29 Apr 2020 19:27:53 +0000 (21:27 +0200)] 
cryptsetup: fix minor indentation issue

3 years agocryptsetup: optionally, see if empty password works for unlocking the file system
Lennart Poettering [Wed, 29 Apr 2020 17:41:02 +0000 (19:41 +0200)] 
cryptsetup: optionally, see if empty password works for unlocking the file system

This adds a new switch try-empty-password. If set and none of PKCS#11 or
key files work, it is attempted to unlock the volume with an empty
password, before the user is asked for a password.

Usecase: an installer generates an OS image on one system, which is the
booted up for the first time in a possibly different system. The image
is encrypted using a random volume key, but an empty password. A tool
that runs on first boot then queries the user for a password to set or
enrols the volume in the TPM, removing the empty password. (Of course, in
such a scenario it is important to never reuse the installer image on
multiple systems as they all will have the same volume key, but that's a
different question.)

3 years agocryptsetup: fix minor memory leak
Lennart Poettering [Wed, 29 Apr 2020 17:08:03 +0000 (19:08 +0200)] 
cryptsetup: fix minor memory leak

3 years agocryptsetup: also check for /dev/hwrng as random device node
Lennart Poettering [Wed, 29 Apr 2020 16:23:02 +0000 (18:23 +0200)] 
cryptsetup: also check for /dev/hwrng as random device node

3 years agocryptsetup: make sure to return EAGAIN on wrong tcrypt password too
Lennart Poettering [Wed, 29 Apr 2020 16:17:33 +0000 (18:17 +0200)] 
cryptsetup: make sure to return EAGAIN on wrong tcrypt password too

Only then we'll try again to ask the user for a password.

Fixes: #12152
3 years agocryptsetup: automatically load luks keys off disk
Lennart Poettering [Wed, 29 Apr 2020 14:37:14 +0000 (16:37 +0200)] 
cryptsetup: automatically load luks keys off disk

Let's make loading of keys a bit more automatic and define a common
place where key files can be placed. Specifically, whenever a volume of
name "foo" is attempted, search for a key file in
/etc/cryptsetup-keys.d/foo.key and /run/cryptsetup-keys.d/foo.key,
unless a key file is declared explicitly.

With this scheme we have a simple discovery in place that should make it
more straightfoward wher to place keys, and requires no explicit
configuration to be used.

3 years agocryptsetup: split out key loading from pkcs11 code and teach search path logic
Lennart Poettering [Wed, 29 Apr 2020 12:50:38 +0000 (14:50 +0200)] 
cryptsetup: split out key loading from pkcs11 code and teach search path logic

Let's do some rearrangements, so that we can later on use this to
automatically search for a key file.

3 years agocryptsetup: optionally remove key file after use
Lennart Poettering [Wed, 29 Apr 2020 12:01:44 +0000 (14:01 +0200)] 
cryptsetup: optionally remove key file after use

This is useful when the key file is acquired dynamically in some form
and should be erased after use.

Note that this code tries to be robust, and removes the key file both on
success and on failure.

3 years agocryptsetup: catch up with debian crypttab options a bit
Lennart Poettering [Wed, 29 Apr 2020 08:22:39 +0000 (10:22 +0200)] 
cryptsetup: catch up with debian crypttab options a bit

Support some aliases Debian added, and drop some options that Debian
dropped from our list of unsupported options.

3 years agofs-util: teach unlinkat_deallocate() a simple scheme for overwriting for erasing
Lennart Poettering [Wed, 29 Apr 2020 11:58:53 +0000 (13:58 +0200)] 
fs-util: teach unlinkat_deallocate() a simple scheme for overwriting for erasing

With that it becomes useful for deleting password files and such.

3 years agoMerge pull request #15845 from poettering/btrfs-encrypted-fix
Lennart Poettering [Tue, 19 May 2020 15:15:22 +0000 (17:15 +0200)] 
Merge pull request #15845 from poettering/btrfs-encrypted-fix

make path_is_encrypted() test pass on btrfs inside container

3 years agoMerge pull request #15843 from poettering/busctl-duplicate-tweaks
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 14:33:46 +0000 (16:33 +0200)] 
Merge pull request #15843 from poettering/busctl-duplicate-tweaks

busctl: improve log messages on duplicate members or interfaces

3 years agoMerge pull request #15848 from keszybz/small-doc-tweaks
Lennart Poettering [Tue, 19 May 2020 14:29:58 +0000 (16:29 +0200)] 
Merge pull request #15848 from keszybz/small-doc-tweaks

A few tweaks to docs

3 years agoNEWS: retroactively document Family= 15848/head
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 14:21:52 +0000 (16:21 +0200)] 
NEWS: retroactively document Family=

Requested in https://github.com/systemd/systemd/issues/13233#issuecomment-630800112.

3 years agopid1: make manager_deserialize_{uid,gid}_refs() static 15535/head
Franck Bui [Mon, 27 Apr 2020 07:01:18 +0000 (09:01 +0200)] 
pid1: make manager_deserialize_{uid,gid}_refs() static

No functional change.

3 years agopid1: make manager_serialize_{uid,gid}_refs() static
Franck Bui [Mon, 27 Apr 2020 06:59:43 +0000 (08:59 +0200)] 
pid1: make manager_serialize_{uid,gid}_refs() static

No functional change.

3 years agopid1: make manager_vacuum_{uid,gid}_refs() static
Franck Bui [Mon, 27 Apr 2020 06:54:44 +0000 (08:54 +0200)] 
pid1: make manager_vacuum_{uid,gid}_refs() static

No functional change.

3 years agopid1: make manager_flip_auto_status() static
Franck Bui [Mon, 27 Apr 2020 06:49:53 +0000 (08:49 +0200)] 
pid1: make manager_flip_auto_status() static

No functional change.

3 years agopid1: fold load_configuration() into main()
Franck Bui [Mon, 27 Apr 2020 06:36:47 +0000 (08:36 +0200)] 
pid1: fold load_configuration() into main()

That's reduce the number of functions dealing with configuration
parsing/loading and should make the code simpler especially since this function
was used only once.

No functional change.

3 years agopid1: update manager settings on reload too
Franck Bui [Wed, 22 Apr 2020 14:16:47 +0000 (16:16 +0200)] 
pid1: update manager settings on reload too

Most complexity of this patch is due to the fact that some manager settings
(basically the watchdog properties) can be set at runtime and in this case the
runtime values must be retained over daemon-reload or daemon-reexec.

For consistency sake, all watchdog properties behaves now the same way, that
is:

  - Values defined by config files can be overridden by writing the new value
    through their respective D-BUS properties. In this case, these values are
    preserved over reload/reexec until the special value '0' or USEC_INFINITY
    is written, which will then restore the last values loaded from the config
    files. If the restored value is '0' or 'USEC_INFINITY', the watchdogs will
    be disabled and the corresponding device will be closed.

  - Reading the properties from a user instance will return the USEC_INFINITY
    value as these properties are only meaningful for PID1.

  - Writing to one of the watchdog properties of a user instance's will be a
    NOP.

Fixes: #15453
3 years agojournalctl,elsewhere: make sure --file=foo fails with sane error msg if foo is not...
Lennart Poettering [Tue, 12 May 2020 21:36:27 +0000 (23:36 +0200)] 
journalctl,elsewhere: make sure --file=foo fails with sane error msg if foo is not readable

It annoyed me for quite a while that running "journalctl --file=…" on a
file that is not readable failed with a "File not found" error instead
of a permission error. Let's fix that.

We make this work by using the GLOB_NOCHECK flag for glob() which means
that files are not accessible will be returned in the array as they are
instead of being filtered away. This then means that our later attemps
to open the files will fail cleanly with a good error message.

3 years agoMerge pull request #15836 from poettering/makefs-lock
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 13:23:23 +0000 (15:23 +0200)] 
Merge pull request #15836 from poettering/makefs-lock

lock whole block device file running makefs

3 years agorepart: don't insist on coming up on partition label ourselves
Lennart Poettering [Tue, 19 May 2020 07:23:00 +0000 (09:23 +0200)] 
repart: don't insist on coming up on partition label ourselves

If the user specified a label, use that.

Fixes: #15841
3 years agobtrfs-util: tweak error code a bit 15845/head
Lennart Poettering [Tue, 19 May 2020 10:11:04 +0000 (12:11 +0200)] 
btrfs-util: tweak error code a bit

3 years agotest-fs-util: don't fail on btrfs file systems in containers
Lennart Poettering [Tue, 19 May 2020 10:10:11 +0000 (12:10 +0200)] 
test-fs-util: don't fail on btrfs file systems in containers

Fixes: #15821
3 years agoDHCP: Use UINT8_MAX instead of 255 15482/head
Susant Sahani [Tue, 19 May 2020 09:16:57 +0000 (11:16 +0200)] 
DHCP: Use UINT8_MAX instead of 255

3 years agonetwork: DHCPv6 - Add support to send user class
Susant Sahani [Mon, 18 May 2020 12:49:47 +0000 (14:49 +0200)] 
network: DHCPv6 - Add support to send user class

Frame 115: 171 bytes on wire (1368 bits), 171 bytes captured (1368 bits) on interface veth-peer, id 0
Ethernet II, Src: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
Internet Protocol Version 6, Src: fe80::1c04:f8ff:feb8:2fd4, Dst: ff02::1:2
User Datagram Protocol, Src Port: 546, Dst Port: 547
DHCPv6
    Message type: Solicit (1)
    Transaction ID: 0x673257
    Rapid Commit
        Option: Rapid Commit (14)
        Length: 0
    Identity Association for Non-temporary Address
        Option: Identity Association for Non-temporary Address (3)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Fully Qualified Domain Name
        Option: Fully Qualified Domain Name (39)
        Length: 6
        Value: 01045a657573
        0000 0... = Reserved: 0x00
        .... .0.. = N bit: Server should perform DNS updates
        .... ..0. = O bit: Server has not overridden client's S bit preference
        .... ...1 = S bit: Server should perform forward DNS updates
        Client FQDN: Zeus
    User Class
        Option: User Class (15)
        Length: 17
        Value: 000f68656c6c6f30313233343031323334
    Identity Association for Prefix Delegation
        Option: Identity Association for Prefix Delegation (25)
        Length: 12
        Value: d0cc94090000000000000000
        IAID: d0cc9409
        T1: 0
        T2: 0
    Option Request
        Option: Option Request (6)
        Length: 10
        Value: 001700180038001f000e
        Requested Option code: DNS recursive name server (23)
        Requested Option code: Domain Search List (24)
        Requested Option code: NTP Server (56)
        Requested Option code: Simple Network Time Protocol Server (31)
        Requested Option code: Rapid Commit (14)
    Client Identifier
        Option: Client Identifier (1)
        Length: 14
        Value: 00020000ab11d258482fc7eee651
        DUID: 00020000ab11d258482fc7eee651
        DUID Type: assigned by vendor based on Enterprise number (2)
        Enterprise ID: Tom Gundersen (systemd) (43793)
        Identifier: d258482fc7eee651
    Elapsed time
        Option: Elapsed time (8)
        Length: 2
        Value: 0bd0
        Elapsed time: 30240ms

3 years agosd-network: DHCPv6 - add support to send userclass option
Susant Sahani [Mon, 18 May 2020 12:46:50 +0000 (14:46 +0200)] 
sd-network: DHCPv6 - add support to send userclass option

sd-network: DHCPv6 - add support to send userclass option

21.15.  User Class Option

   The User Class option is used by a client to identify the type or
   category of users or applications it represents.

   The format of the User Class option is:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |       OPTION_USER_CLASS       |          option-len           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                          user-class-data                      .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Figure 26: User Class Option Format

      option-code          OPTION_USER_CLASS (15).

      option-len           Length of user-class-data field.

      user-class-data      The user classes carried by the client.  The
                           length, in octets, is specified by
                           option-len.

The information contained in the data area of this option is
   contained in one or more opaque fields that represent the user class
   or classes of which the client is a member.  A server selects
   configuration information for the client based on the classes
   identified in this option.  For example, the User Class option can be
   used to configure all clients of people in the accounting department
   with a different printer than clients of people in the marketing
   department.  The user class information carried in this option MUST
   be configurable on the client.

   The data area of the User Class option MUST contain one or more
   instances of user-class-data information.  Each instance of
   user-class-data is formatted as follows:

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+
      |        user-class-len         |          opaque-data          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...-+-+-+-+-+-+-+

                Figure 27: Format of user-class-data Field

3 years agoMerge pull request #15842 from evverx/cifuzz
Frantisek Sumsal [Tue, 19 May 2020 08:30:32 +0000 (10:30 +0200)] 
Merge pull request #15842 from evverx/cifuzz

cifuzz: protect forks from CIFuzz

3 years agoallow removal of initrd services
Norbert Lange [Wed, 8 Apr 2020 21:59:13 +0000 (23:59 +0200)] 
allow removal of initrd services

3 years agoMerge pull request #15794 from poettering/pam-sudo-fixes-part2
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 08:09:14 +0000 (10:09 +0200)] 
Merge pull request #15794 from poettering/pam-sudo-fixes-part2

pam_systemd/pam_systemd_home: fix caching

3 years agoMerge pull request #15166 from ssahani/networkctl-ipvlan
Lennart Poettering [Tue, 19 May 2020 07:29:45 +0000 (09:29 +0200)] 
Merge pull request #15166 from ssahani/networkctl-ipvlan

networkctl: Add support to display ipvlan

3 years agohomed: use right config section in example config
Lennart Poettering [Tue, 12 May 2020 20:09:13 +0000 (22:09 +0200)] 
homed: use right config section in example config

We really should get this right, otherwise it's a pretty useless vendor
default example configuration file.

Follow-up for: c76dd733afe04b36cdac16322a07201c5793f2df

3 years agobusctl: improve error messages on duplicate members/interfaces 15843/head
Lennart Poettering [Tue, 19 May 2020 07:04:03 +0000 (09:04 +0200)] 
busctl: improve error messages on duplicate members/interfaces

Prompted by: #15833

3 years agobusctl: use structured initialization
Lennart Poettering [Tue, 19 May 2020 07:03:43 +0000 (09:03 +0200)] 
busctl: use structured initialization

3 years agoTODO: drop some external items
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 06:59:53 +0000 (08:59 +0200)] 
TODO: drop some external items

Those are either implemented or obsolete.

3 years agoTODO: drop some networkd items
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 06:55:46 +0000 (08:55 +0200)] 
TODO: drop some networkd items

DUID/IAID — #2818, #2890, #3156,
Scope – #6449,
bond options — #10542,
option 119: sd_network_get_domains/sd_network_get_search_domains,
/proc/cmdline parsing – 426c1d385212e11cb,
wait states — #14536.

3 years agoMerge pull request #15810 from poettering/override-first-boot
Lennart Poettering [Tue, 19 May 2020 06:45:59 +0000 (08:45 +0200)] 
Merge pull request #15810 from poettering/override-first-boot

core: allow overriding needs-update/first-boot/system clock via kernel cmdline

3 years agodhcp6: slightly improve log message
Lennart Poettering [Mon, 18 May 2020 19:36:45 +0000 (21:36 +0200)] 
dhcp6: slightly improve log message

Let's clarify that we proceed anyway.

Prompted-by: #15830
3 years agoREADME: add a CIFuzz badge 15842/head
Evgeny Vereshchagin [Tue, 19 May 2020 06:03:09 +0000 (08:03 +0200)] 
README: add a CIFuzz badge

Just a follow-up to https://github.com/systemd/systemd/pull/15760

3 years agocifuzz: protect forks from CIFuzz
Evgeny Vereshchagin [Tue, 19 May 2020 05:58:14 +0000 (07:58 +0200)] 
cifuzz: protect forks from CIFuzz

CIFuzz isn't compatible with forks: https://github.com/google/oss-fuzz/issues/3731