]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
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 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 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

3 years agojournal: fix dropping first record during upload to remote journal
Vladyslav Tronko [Thu, 14 May 2020 02:26:23 +0000 (05:26 +0300)] 
journal: fix dropping first record during upload to remote journal

3 years agoMerge pull request #15838 from poettering/hostnamed-instant-part2
Zbigniew Jędrzejewski-Szmek [Tue, 19 May 2020 05:54:47 +0000 (07:54 +0200)] 
Merge pull request #15838 from poettering/hostnamed-instant-part2

more hostnamed fixes, split out of #15624

3 years agoman: fix dir name in sysctl.d(5)
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2020 19:14:42 +0000 (21:14 +0200)] 
man: fix dir name in sysctl.d(5)

Pointed out by Коренберг Марк in
https://github.com/systemd/systemd/commit/e0f424790d3dbde136a29a7fa4c2777c2e3fd695#commitcomment-39259499.

3 years agohostnamed: call our destructor _destroy(), not _clear() 15838/head
Lennart Poettering [Tue, 28 Apr 2020 15:43:43 +0000 (17:43 +0200)] 
hostnamed: call our destructor _destroy(), not _clear()

3 years agohostnamed: don't cache system UUID
Lennart Poettering [Tue, 28 Apr 2020 15:03:12 +0000 (17:03 +0200)] 
hostnamed: don't cache system UUID

There's no point in caching this. Let's always get this directly from
sysfs, so that we can never get out-of-date data here (after all this is
going to be cheap, and people might overmount it or so)

3 years agohostnamed: don't cache uname() data
Lennart Poettering [Tue, 28 Apr 2020 15:01:56 +0000 (17:01 +0200)] 
hostnamed: don't cache uname() data

Let's not cache the uname(), it's very cheap to get it, and just means
we might get out of sync with what is current. After all, the data might
change IRL, due to setarch and stuff.

3 years agocryptsetup-generator: use systemd-makefs for implementation of "swap" and "tmp" options 15836/head
Lennart Poettering [Mon, 18 May 2020 16:37:02 +0000 (18:37 +0200)] 
cryptsetup-generator: use systemd-makefs for implementation of "swap" and "tmp" options

This way we can take benefit of the correct block device locking we just
added.

I was thinking whether to instead pull in a regular
systemd-makefs@.service instance, but I couldn't come up with a reason
to, and thus opted for just doing the minimal patch and just replacing
the simply mkfs calls.

Fixes: #10179
Replaces: #13162

3 years agomakefs: normalize logging a bit
Lennart Poettering [Mon, 18 May 2020 16:32:17 +0000 (18:32 +0200)] 
makefs: normalize logging a bit

3 years agomakefs: lock device while we operate
Lennart Poettering [Mon, 18 May 2020 16:31:45 +0000 (18:31 +0200)] 
makefs: lock device while we operate

Let's implement our own specs, i.e.

https://systemd.io/BLOCK_DEVICE_LOCKING/

This should address issues like this: #13162

3 years agoupdate TODO 15810/head
Lennart Poettering [Thu, 14 May 2020 08:13:40 +0000 (10:13 +0200)] 
update TODO

3 years agocore: allow overriding the system hostname with systemd.hostname= on the kernel comma...
Lennart Poettering [Thu, 14 May 2020 09:01:31 +0000 (11:01 +0200)] 
core: allow overriding the system hostname with systemd.hostname= on the kernel command line

3 years agomain: add a kernel command line option for setting the system clock early during...
Lennart Poettering [Thu, 14 May 2020 08:41:47 +0000 (10:41 +0200)] 
main: add a kernel command line option for setting the system clock early during boot

3 years agocondition: introduce systemd.condition-first-boot= kernel command line switch
Lennart Poettering [Thu, 14 May 2020 08:11:56 +0000 (10:11 +0200)] 
condition: introduce systemd.condition-first-boot= kernel command line switch

Much like systemd.condition-needs-update= this new switch allows
overriding of a unit file condition, but this time its
ConditionFirstBoot=.

Usecase is also primarily debugging, but could be useful for other
schemes too.

3 years agocondition: debug log if F_OK check on /run/systemd/first-boot fails unexpectedly
Lennart Poettering [Thu, 14 May 2020 08:07:34 +0000 (10:07 +0200)] 
condition: debug log if F_OK check on /run/systemd/first-boot fails unexpectedly

3 years agocondition: reverse if check to lower indentation level
Lennart Poettering [Mon, 18 May 2020 18:11:27 +0000 (20:11 +0200)] 
condition: reverse if check to lower indentation level

No change in behaviour. Let's just prefer early exit over deeper
indentation.

3 years agocondition: allow overriding of ConditionNeedsUpdate= on the kernel command line
Lennart Poettering [Thu, 14 May 2020 07:55:57 +0000 (09:55 +0200)] 
condition: allow overriding of ConditionNeedsUpdate= on the kernel command line

This should be useful for addressing #15724.

3 years agoproc-cmdline: add some explanatory comments
Lennart Poettering [Thu, 14 May 2020 07:37:27 +0000 (09:37 +0200)] 
proc-cmdline: add some explanatory comments

3 years agocondition: when reading /etc/ modification timestamp, let's actualy compare it as-is
Lennart Poettering [Thu, 14 May 2020 07:27:59 +0000 (09:27 +0200)] 
condition: when reading /etc/ modification timestamp, let's actualy compare it as-is

Previously, we'd only compare the nsec component of it, which sounds
needlessly fragile. Let's instead compare the timestamp as it is.

3 years agocondition: downgrade a few log messages to debug
Lennart Poettering [Thu, 14 May 2020 07:27:04 +0000 (09:27 +0200)] 
condition: downgrade a few log messages to debug

Condition checks shouldn't log loudly, since they run all the time.
Let's make things debuggable, by keeping the messages in LOG_DEBUG in,
but don't make more noise than necessary.

3 years agocondition: add debug log messages on unexpected errors
Lennart Poettering [Thu, 14 May 2020 07:20:24 +0000 (09:20 +0200)] 
condition: add debug log messages on unexpected errors

3 years agocondition: check if path is absolute first
Lennart Poettering [Thu, 14 May 2020 07:18:58 +0000 (09:18 +0200)] 
condition: check if path is absolute first

We should do this check first since it is done on the string itself
without any conditioning of system state otherwise. It is a weird to do
this test only if /etc is read-only.

3 years agonetworkctl: Add support to display ipvlan 15166/head
Susant Sahani [Thu, 19 Mar 2020 10:29:10 +0000 (11:29 +0100)] 
networkctl: Add support to display ipvlan

```
build/networkctl status myipvlan1                                                                                                                                                        ─╯
● 26: myipvlan1
             Link File: /usr/lib/systemd/network/99-default.link
          Network File: n/a
                  Type: ether
                 State: off (unmanaged)
                Driver: ipvlan
            HW Address: 4e:c5:88:28:c1:c0
                   MTU: 1500 (min: 68, max: 65535)
                 QDisc: noop
                  Mode: L2 (bridge)
  Queue Length (Tx/Rx): 1/1

```

3 years agoblockdev: add helper for locking whole block device
Lennart Poettering [Mon, 18 May 2020 16:31:04 +0000 (18:31 +0200)] 
blockdev: add helper for locking whole block device

3 years agodissect: use log_debug_errno() where appropriate
Lennart Poettering [Mon, 18 May 2020 16:30:49 +0000 (18:30 +0200)] 
dissect: use log_debug_errno() where appropriate

3 years agomakefs: log about OOM condition
Lennart Poettering [Mon, 18 May 2020 16:30:18 +0000 (18:30 +0200)] 
makefs: log about OOM condition

3 years agoblockdev: propagate one more unexpected error
Lennart Poettering [Mon, 18 May 2020 16:29:57 +0000 (18:29 +0200)] 
blockdev: propagate one more unexpected error

3 years agoupdate TODO
Lennart Poettering [Mon, 18 May 2020 16:29:38 +0000 (18:29 +0200)] 
update TODO

3 years agoMerge pull request #15804 from poettering/hostnamed-instant-part1
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2020 13:26:24 +0000 (15:26 +0200)] 
Merge pull request #15804 from poettering/hostnamed-instant-part1

four likely safe commits split out of #15624

3 years agoMerge pull request #15494 from ssahani/dhcpv6-request-options
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2020 11:14:36 +0000 (13:14 +0200)] 
Merge pull request #15494 from ssahani/dhcpv6-request-options

DHCPv6: Allow to add arbitrary request option

3 years agoMerge pull request #15165 from ssahani/bonding
Zbigniew Jędrzejewski-Szmek [Mon, 18 May 2020 06:52:13 +0000 (08:52 +0200)] 
Merge pull request #15165 from ssahani/bonding

network: Move common functions of bonding to bond-util

3 years agomeson: initialize time-epoch to reproducible builds compatible value
Dimitri John Ledkov [Fri, 15 May 2020 18:16:05 +0000 (19:16 +0100)] 
meson: initialize time-epoch to reproducible builds compatible value

Debian Policy encourages to preserve timestamps whenever possible in the
tarballs, thus stable release updates of systemd usually do not bump NEWS file
timestamp. And thus time-epoch remains the same for the lifetime of a release.

It would be better, if each new stable release rebuild of systemd would bump
the time epoch a bit. But at the same time remain
reproducible. SOURCE_DATE_EPOCH is an environmnet variable defined for this
purpose. Thus if available, prefer that, instead of the NEWS file modification
time.

For example, on Debian/Ubuntu under the reproducible builds the
SOURCE_DATE_EPOCH is set to the timestamp from the packaging metadata, thus it
is incremented on every new stable release update, whilst preserving
reproducible builds capability.

Reference: https://reproducible-builds.org/docs/timestamps/

3 years agodhcpv6 tests: Update since we allow arbitrary options to be set 15494/head
Susant Sahani [Sun, 17 May 2020 09:18:46 +0000 (11:18 +0200)] 
dhcpv6 tests: Update since we allow arbitrary options to be set

3 years agonetwork: DHCPv6 - Add support set arbitary request options
Susant Sahani [Thu, 23 Apr 2020 12:31:47 +0000 (14:31 +0200)] 
network: DHCPv6 - Add support set arbitary request options

3 years agosd-dhcp6: Allow to add arbitary request option
Susant Sahani [Mon, 20 Apr 2020 12:57:34 +0000 (14:57 +0200)] 
sd-dhcp6: Allow to add arbitary request option

3 years agonetworkctl: Use bond util common functions 15165/head
Susant Sahani [Sun, 17 May 2020 04:17:25 +0000 (06:17 +0200)] 
networkctl: Use bond util common functions

3 years agonetwork: Introduce bond util
Susant Sahani [Sun, 17 May 2020 04:14:49 +0000 (06:14 +0200)] 
network: Introduce bond util

3 years agonetworkctl: VXLan - display more properties
Susant Sahani [Mon, 23 Mar 2020 15:24:04 +0000 (16:24 +0100)] 
networkctl: VXLan - display more properties

3 years agonetwork: Introduce ipvlan util
Susant Sahani [Thu, 19 Mar 2020 09:59:08 +0000 (10:59 +0100)] 
network: Introduce ipvlan util

Move ipvlan common to shared

3 years agopstore: introduce tmpfiles.d/systemd-pstore.conf
Eric DeVolder [Mon, 13 Apr 2020 21:22:04 +0000 (16:22 -0500)] 
pstore: introduce tmpfiles.d/systemd-pstore.conf

The systemd pstore service archives the contents of /sys/fs/pstore
upon boot so that there is room for a subsequent dump.  The issue is
that while the service is present, the kernel still needs to be
configured to write data into the pstore. The kernel has two
parameters, crash_kexec_post_notifiers and printk.always_kmsg_dump,
that control writes into pstore.

The crash_kexec_post_notifiers parameter enables the kernel to write
dmesg (including stack trace) into pstore upon a panic, and
printk.always_kmsg_dump parameter enables the kernel to write dmesg
upon a shutdown (shutdown, reboot, halt).

As it stands today, these parameters are not managed/manipulated by
the systemd pstore service, and are solely reliant upon the user [to
have the foresight] to set them on the kernel command line at boot, or
post boot via sysfs. Furthermore, the user would need to set these
parameters in a persistent fashion so that that they are enabled on
subsequent reboots.

This patch introduces the setting of these two kernel parameters via
the systemd tmpfiles technique.

3 years agoIncrease size of /run to 20%
Topi Miettinen [Fri, 15 May 2020 15:33:45 +0000 (18:33 +0300)] 
Increase size of /run to 20%

For low memory machines (256MB), 10% of RAM for /run may not be enough for
re-exec of PID1 because 16MB of free space is required and /run may already
contain something.

3 years agodocs: policy for systemd-security subscriptions
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2020 16:26:10 +0000 (18:26 +0200)] 
docs: policy for systemd-security subscriptions

Replaces #14325.

3 years agoMerge pull request #15817 from poettering/more-conditions
Lennart Poettering [Fri, 15 May 2020 18:25:34 +0000 (20:25 +0200)] 
Merge pull request #15817 from poettering/more-conditions

Add ConditionEnvironment= and ConditionIsEncrypted=

3 years agoudev: get rid of "Could not set flow control of" message on "lo" interface
Lennart Poettering [Tue, 12 May 2020 21:48:27 +0000 (23:48 +0200)] 
udev: get rid of "Could not set flow control of" message on "lo" interface

When setting flow control attributes of an interface we first acquire
the current settings and then add in the new settings before applying
them again. This only works on interfaces that implement the ethtool
ioctls. on others we'll see an ugly "Could not set flow control of"
message, simply because we issue the SIOCETHTOOL ioctl once, for getting
the data. In particular we'll get it for the "lo" interface all the
time, which sucks hard. Let's get rid of it.

3 years agoshared: fix integer overflow in calendarspec
Frantisek Sumsal [Fri, 15 May 2020 10:02:43 +0000 (12:02 +0200)] 
shared: fix integer overflow in calendarspec

Fixes: oss-fuzz#22208
```
test/fuzz/fuzz-calendarspec/oss-fuzz-22208... ../src/shared/calendarspec.c:666:48: runtime error: signed integer overflow: 2147000000 + 1000000 cannot be represented in type 'int'
    #0 0x7f0b9f6cc56a in prepend_component ../src/shared/calendarspec.c:666
    #1 0x7f0b9f6cd03a in parse_chain ../src/shared/calendarspec.c:718
    #2 0x7f0b9f6cea1c in parse_calendar_time ../src/shared/calendarspec.c:845
    #3 0x7f0b9f6d1397 in calendar_spec_from_string ../src/shared/calendarspec.c:1084
    #4 0x401570 in LLVMFuzzerTestOneInput ../src/fuzz/fuzz-calendarspec.c:17
    #5 0x401ae0 in main ../src/fuzz/fuzz-main.c:39
    #6 0x7f0b9e31b1a2 in __libc_start_main (/lib64/libc.so.6+0x271a2)
    #7 0x40122d in _start (/home/fsumsal/repos/systemd/build/fuzz-calendarspec+0x40122d)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/shared/calendarspec.c:666:48 in
```

3 years agoupdate TODO 15817/head
Lennart Poettering [Thu, 14 May 2020 17:24:49 +0000 (19:24 +0200)] 
update TODO

3 years agoman: document the two new condition types
Lennart Poettering [Thu, 14 May 2020 17:24:08 +0000 (19:24 +0200)] 
man: document the two new condition types

3 years agocondition: add ConditionEnvironment=
Lennart Poettering [Thu, 14 May 2020 17:13:03 +0000 (19:13 +0200)] 
condition: add ConditionEnvironment=

Prompted by the discussions in #15180.

This is a bit more complex than I hoped, since for PID 1 we need to pass
in the synethetic environment block in we generate on demand.

3 years agolimit-util: quieten a very common debug message that is misleading
Lennart Poettering [Thu, 14 May 2020 17:11:18 +0000 (19:11 +0200)] 
limit-util: quieten a very common debug message that is misleading

3 years agocondition: return (Condition*) NULL from condition_free()
Lennart Poettering [Thu, 14 May 2020 16:43:46 +0000 (18:43 +0200)] 
condition: return (Condition*) NULL from condition_free()

Follow our usual coding style.

3 years agocondition: introduce generic function type for condition_to_string()-like functions
Lennart Poettering [Thu, 14 May 2020 16:40:16 +0000 (18:40 +0200)] 
condition: introduce generic function type for condition_to_string()-like functions

Let's add a typedef for a function type we use at multiple places.

3 years agocondition: add ConditionPathIsEncrypted=
Lennart Poettering [Thu, 14 May 2020 16:30:23 +0000 (18:30 +0200)] 
condition: add ConditionPathIsEncrypted=

It's easy to add, and should be pretty useful, in particular as in
AssertPathIsEncrypted= as it can be used for checking that
some path is encrypted before some service is invoked that might want to
place secure material there.

3 years agonetwork: Add support to group links.
Susant Sahani [Tue, 7 Apr 2020 12:36:55 +0000 (14:36 +0200)] 
network: Add support to group links.

Link groups are similar to port ranges found in managed switches.
You can add network interfaces to a numbered group and perform operations
on all the interfaces from that group at once.

3 years agoMerge pull request #15792 from poettering/repart-allocate
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2020 09:40:24 +0000 (11:40 +0200)] 
Merge pull request #15792 from poettering/repart-allocate

repart: add --size= and --empty=create options for growing/creating disk images from scratch

3 years agoMerge pull request #15265 from fbuihuu/mount-fixes
Lennart Poettering [Fri, 15 May 2020 09:13:45 +0000 (11:13 +0200)] 
Merge pull request #15265 from fbuihuu/mount-fixes

Mount fixes

3 years agoMerge pull request #15052 from jaankit/journal-send
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2020 08:42:25 +0000 (10:42 +0200)] 
Merge pull request #15052 from jaankit/journal-send

journal-send: Fix the limitation of LINE_MAX

4 years agoMerge pull request #15812 from poettering/deprecate-stdout-syslog
Zbigniew Jędrzejewski-Szmek [Fri, 15 May 2020 07:23:24 +0000 (09:23 +0200)] 
Merge pull request #15812 from poettering/deprecate-stdout-syslog

Get rid of StandardOutput=syslog

4 years agohwdb: fix microphone shortcut on HP EliteBook 840 G1
Frantisek Sumsal [Thu, 14 May 2020 18:55:18 +0000 (20:55 +0200)] 
hwdb: fix microphone shortcut on HP EliteBook 840 G1

Fixes: #15774