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

4 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

4 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.

4 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

4 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.

4 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.

4 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

4 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.

4 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.

4 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

4 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.

4 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

```

4 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

4 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

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

4 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

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

4 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

4 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

4 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

4 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/

4 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

4 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

4 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

4 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

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

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

4 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

4 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.

4 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.

4 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.

4 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=

4 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.

4 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
```

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

4 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

4 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.

4 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

4 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.

4 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.

4 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.

4 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.

4 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

4 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

4 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
4 years agocore: automatically update StandardOuput=syslog to =journal (and similar for Standard... 15812/head
Lennart Poettering [Thu, 14 May 2020 10:20:39 +0000 (12:20 +0200)] 
core: automatically update StandardOuput=syslog to =journal (and similar for StandardError=)

Let's go one step further and upgrade implicitly. Usually =syslog
assignments are historic artifacts only. Let's upgrade the lines
automatically, and politely suggest people update their unit
files/configuration (and drop the lines altogether, without
replacement).

Fixes: #15807
4 years agoman: drop some left-over mentions of StandardOutput=syslog
Lennart Poettering [Thu, 14 May 2020 10:19:46 +0000 (12:19 +0200)] 
man: drop some left-over mentions of StandardOutput=syslog

We dropped them from the StandardOuput= documentation long ago, but
elswhere some references where lurking.

4 years agoupdate TODO 15792/head
Lennart Poettering [Tue, 12 May 2020 15:11:47 +0000 (17:11 +0200)] 
update TODO

4 years agoman: document new --empty=create and --size= switches to repart
Lennart Poettering [Tue, 12 May 2020 15:11:27 +0000 (17:11 +0200)] 
man: document new --empty=create and --size= switches to repart

4 years agotest: update tests to use new repart features
Lennart Poettering [Tue, 12 May 2020 15:11:41 +0000 (17:11 +0200)] 
test: update tests to use new repart features

4 years agorepart: add support for create/growing loopback files
Lennart Poettering [Tue, 12 May 2020 15:09:06 +0000 (17:09 +0200)] 
repart: add support for create/growing loopback files

This adds --empty=create and --size= for creating loopback files from
scratch of a specified size, or growing loopback files to the specified
size when they already exist.

This is useful when operating on disk image files, as a manual
invocation of fallocate(1) becomes unnecessary.

4 years agorepart: suppress complaints about lack of BLKRRPART when operating on regular file
Lennart Poettering [Tue, 12 May 2020 15:08:39 +0000 (17:08 +0200)] 
repart: suppress complaints about lack of BLKRRPART when operating on regular file

4 years agorepart: explain when we exit early and don't do a thing
Lennart Poettering [Tue, 12 May 2020 09:20:39 +0000 (11:20 +0200)] 
repart: explain when we exit early and don't do a thing

4 years agosd-netlink: remove unused RTNL_WQUEUE_MAX define
Andreas Rammhold [Thu, 14 May 2020 17:23:33 +0000 (19:23 +0200)] 
sd-netlink: remove unused RTNL_WQUEUE_MAX define

While investigating why some of my netlink calls would timeout I
stumbled upon the definition of the max write queue length. Finding this
constant made me believe we still had a write queue in the code - which
isn't true. The netlink write queue code was removed in #189.

4 years agosysctl: check correct error code
Lennart Poettering [Tue, 12 May 2020 21:43:48 +0000 (23:43 +0200)] 
sysctl: check correct error code

4 years agojournal-send: Fix the limitation of LINE_MAX 15052/head
Ankit Jain [Fri, 6 Mar 2020 12:57:50 +0000 (18:27 +0530)] 
journal-send: Fix the limitation of LINE_MAX

- If length of formatted string >= LONG_LINE_MAX then return -ENOBUFS
- Normal Case:
  - length of formatted string < POSIX defined LINE_MAX
  - Allocate sbuf to accomodate the message
- Rare case:
  - LINE_MAX < length of formatted string < LONG_LINE_MAX
  - Allocate the required length using alloca()

4 years agotest-journal-send: send printing of long lines
Zbigniew Jędrzejewski-Szmek [Tue, 21 Apr 2020 14:42:03 +0000 (16:42 +0200)] 
test-journal-send: send printing of long lines

4 years agonetwork: allow setting VLAN protocol on bridges
Rubens Figueiredo [Fri, 20 Mar 2020 15:09:36 +0000 (16:09 +0100)] 
network: allow setting VLAN protocol on bridges

Signed-off-by: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
4 years agonetworkctl: Add support to display macvlan/macvtap mode
Susant Sahani [Thu, 19 Mar 2020 04:24:49 +0000 (05:24 +0100)] 
networkctl: Add support to display macvlan/macvtap mode

4 years agonetwork: Introduce macvlan util
Susant Sahani [Thu, 19 Mar 2020 09:31:45 +0000 (10:31 +0100)] 
network: Introduce macvlan util

4 years agoman: document $LOG_NAMESPACE
Lennart Poettering [Thu, 14 May 2020 14:38:02 +0000 (16:38 +0200)] 
man: document $LOG_NAMESPACE

4 years agosd-dhcp-server: some function prototype fix-ups
Lennart Poettering [Thu, 14 May 2020 12:16:43 +0000 (14:16 +0200)] 
sd-dhcp-server: some function prototype fix-ups

Let's use size_t for numbers of entries in memory.

Let's use const wherever appropriate.

Drop `_server` suffix from function name where we don't have it for
similar other cases.

4 years agocifuzz: set allowed-broken-targets-percentage to 0
Evgeny Vereshchagin [Wed, 13 May 2020 20:17:37 +0000 (20:17 +0000)] 
cifuzz: set allowed-broken-targets-percentage to 0

4 years agoMerge pull request #15765 from benjarobin/fix_kw
Lennart Poettering [Thu, 14 May 2020 07:08:47 +0000 (09:08 +0200)] 
Merge pull request #15765 from benjarobin/fix_kw

Various bug fixes

4 years agoMerge pull request #15660 from benjarobin/perf_barrier_fd
Lennart Poettering [Thu, 14 May 2020 07:07:41 +0000 (09:07 +0200)] 
Merge pull request #15660 from benjarobin/perf_barrier_fd

Faster manager_process_barrier_fd and drop message if BARRIER=1 found

4 years agoMerge pull request #15801 from poettering/journal-pid-change-fix
Lennart Poettering [Thu, 14 May 2020 07:04:23 +0000 (09:04 +0200)] 
Merge pull request #15801 from poettering/journal-pid-change-fix

journald: stream pid change newline fix

4 years agoselinux: add parenthesis to function names in log messages
Christian Göttsche [Wed, 13 May 2020 19:28:04 +0000 (21:28 +0200)] 
selinux: add parenthesis to function names in log messages

4 years agoci: install fdisk on Debian
Evgeny Vereshchagin [Thu, 14 May 2020 00:44:46 +0000 (00:44 +0000)] 
ci: install fdisk on Debian

To judge from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=947134 and
https://salsa.debian.org/debian/util-linux/-/commit/44ec91ef110e7131d8a0467374797bc2e0f30e51,
`util-linux` no longer depends on `fdisk` so it seems it should be installed
manually.

4 years agotest: Add return 0 to main() function (even it is not strictly necessary) 15765/head
Benjamin Robin [Sun, 10 May 2020 14:49:30 +0000 (16:49 +0200)] 
test: Add return 0 to main() function (even it is not strictly necessary)

4 years agosystemctl: Check clean_or_freeze_unit(): Add assert if unknown method
Benjamin Robin [Sat, 9 May 2020 19:19:17 +0000 (21:19 +0200)] 
systemctl: Check clean_or_freeze_unit(): Add assert if unknown method

4 years agonetwork: 'cur' variable cannot be null, so simplify code
Benjamin Robin [Sat, 9 May 2020 19:19:12 +0000 (21:19 +0200)] 
network: 'cur' variable cannot be null, so simplify code

4 years agotree-wide: Initialize _cleanup_ variables if needed
Benjamin Robin [Sat, 9 May 2020 17:51:23 +0000 (19:51 +0200)] 
tree-wide: Initialize _cleanup_ variables if needed

4 years agonetlink: Fix assert condition on n_containers
Benjamin Robin [Sat, 9 May 2020 16:12:21 +0000 (18:12 +0200)] 
netlink: Fix assert condition on n_containers

4 years agocore: Parse the tags list sooner, and use it for multiple function 15660/head
Benjamin Robin [Sun, 10 May 2020 16:46:45 +0000 (18:46 +0200)] 
core: Parse the tags list sooner, and use it for multiple function

 - Parse the tags list using strv_split_newlines() which remove any
   unnecessary empty string at the end of the strv.
 - Use this parsed list for manager_process_barrier_fd() and every call
   to manager_invoke_notify_message().
 - This also allow to simplify the manager_process_barrier_fd() function.

4 years agoman: document the new _LINE_BREAK= type 15801/head
Lennart Poettering [Tue, 12 May 2020 22:09:43 +0000 (00:09 +0200)] 
man: document the new _LINE_BREAK= type

4 years agotest: Stricter test case for #15654 (Add more checks)
Benjamin Robin [Sat, 9 May 2020 10:01:07 +0000 (12:01 +0200)] 
test: Stricter test case for #15654 (Add more checks)

Check:
 - There is only 3 messages logged with type stdout
 - Check all messages logged does not have new line: LINE_BREAK=eof
 - Check that the 3 messages are logged from a different PID
 - Check the 3 MESSAGE= content

4 years agotest: Add a test case for #15654
Benjamin Robin [Wed, 6 May 2020 21:28:02 +0000 (23:28 +0200)] 
test: Add a test case for #15654

4 years agojournald: rework pid change handling
Lennart Poettering [Tue, 12 May 2020 16:56:34 +0000 (18:56 +0200)] 
journald: rework pid change handling

Let's introduce an explicit line ending marker for line endings due to
pid change.

Let's also make sure we don't get confused with buffer management.

Fixes: #15654
4 years agojournald: use the fact that client_context_release() returns NULL
Lennart Poettering [Tue, 12 May 2020 17:15:38 +0000 (19:15 +0200)] 
journald: use the fact that client_context_release() returns NULL

4 years agojournald: rework end of line marker handling to use a field table
Lennart Poettering [Tue, 12 May 2020 16:53:35 +0000 (18:53 +0200)] 
journald: rework end of line marker handling to use a field table

4 years agojournald: use log_warning_errno() where appropriate
Lennart Poettering [Tue, 12 May 2020 16:52:33 +0000 (18:52 +0200)] 
journald: use log_warning_errno() where appropriate

4 years agojournald: Increase stdout buffer size sooner, when almost full
Benjamin Robin [Sun, 3 May 2020 16:37:21 +0000 (18:37 +0200)] 
journald: Increase stdout buffer size sooner, when almost full

If the previous received buffer length is almost equal to the allocated
buffer size, before this change the next read can only receive a couple
of bytes (in the worst case only 1 byte), which is not efficient.

4 years agosemaphore: use dots instead of dashes
Evgeny Vereshchagin [Sat, 4 Apr 2020 19:50:41 +0000 (19:50 +0000)] 
semaphore: use dots instead of dashes

Borrowed from https://salsa.debian.org/systemd-team/systemd/-/commit/511d5d5452d29bd3af7.

4 years agoman: complete vtable flag documentation 15804/head
Lennart Poettering [Tue, 28 Apr 2020 17:23:50 +0000 (19:23 +0200)] 
man: complete vtable flag documentation

4 years agosd-bus: introduce new SD_BUS_VTABLE_ABSOLUTE_OFFSET vtable flag
Lennart Poettering [Tue, 28 Apr 2020 15:04:08 +0000 (17:04 +0200)] 
sd-bus: introduce new SD_BUS_VTABLE_ABSOLUTE_OFFSET vtable flag

When set, the offset specified for the vtable entry is passed to the
handler as-is, and is not added to the userdata pointer. This is useful
in case methods/properties are mixed on the same vtable, that expect to
operate relative to some object in memory and that expect pointers to
absolute memory, or that just want a number passed.

4 years agoresolved: port to stat_inode_unmodified()
Lennart Poettering [Tue, 28 Apr 2020 16:16:47 +0000 (18:16 +0200)] 
resolved: port to stat_inode_unmodified()

4 years agostat-util: add stat_inode_unmodified() helper that checks if an inode was modified
Lennart Poettering [Tue, 28 Apr 2020 16:16:25 +0000 (18:16 +0200)] 
stat-util: add stat_inode_unmodified() helper that checks if an inode was modified

4 years agodocs: add some backticks and more formatting to PASSWORD_AGENTS.md (#15803)
Дамјан Георгиевски [Wed, 13 May 2020 12:52:09 +0000 (14:52 +0200)] 
docs: add some backticks and more formatting to PASSWORD_AGENTS.md (#15803)

docs: add some backticks and more formatting to PASSWORD_AGENTS.md

4 years agoMerge pull request #15795 from gdamjan/master
Zbigniew Jędrzejewski-Szmek [Wed, 13 May 2020 06:32:57 +0000 (08:32 +0200)] 
Merge pull request #15795 from gdamjan/master

docs: import password agents documentation

4 years agosystemctl: fix indentation of 'Active:' field in status output
Lennart Poettering [Tue, 12 May 2020 20:03:51 +0000 (22:03 +0200)] 
systemctl: fix indentation of 'Active:' field in status output

Somehow two spaces got lost in d9e45bc3abb here, which made the status
output all unaligned. Let's put them back in.

4 years agoTidy up the Fedora mkosi Package list
Jeremy Cline [Tue, 12 May 2020 14:12:57 +0000 (10:12 -0400)] 
Tidy up the Fedora mkosi Package list

libzstd is a new dependency for systemd that's not in a stable release
yet, so it's not pulled in by the RPM package dependency. Manually
include it in the package section so the image mkosi produces works. It
can be removed when the RPM depends on it.

Additionally, a number of packages in the list appear to be pulled in
because they're dependencies in the systemd rpm, so remove them.
Finally, mkosi v5 adds the proper fs utilities for bootable images type
so drop that dependency as well.

4 years agofix WikiWord not-links 15795/head
Дамјан Георгиевски [Wed, 13 May 2020 02:56:50 +0000 (04:56 +0200)] 
fix WikiWord not-links

4 years agotree-wide: add size limits for tmpfs mounts
Topi Miettinen [Tue, 14 Apr 2020 13:39:36 +0000 (16:39 +0300)] 
tree-wide: add size limits for tmpfs mounts

Limit size of various tmpfs mounts to 10% of RAM, except volatile root and /var
to 25%. Another exception is made for /dev (also /devs for PrivateDevices) and
/sys/fs/cgroup since no (or very few) regular files are expected to be used.

In addition, since directories, symbolic links, device specials and xattrs are
not counted towards the size= limit, number of inodes is also limited
correspondingly: 4MB size translates to 1k of inodes (assuming 4k each), 10% of
RAM (using 16GB of RAM as baseline) translates to 400k and 25% to 1M inodes.

Because nr_inodes option can't use ratios like size option, there's an
unfortunate side effect that with small memory systems the limit may be on the
too large side. Also, on an extremely small device with only 256MB of RAM, 10%
of RAM for /run may not be enough for re-exec of PID1 because 16MB of free
space is required.

4 years agoupdate TODO
Lennart Poettering [Tue, 12 May 2020 18:14:08 +0000 (20:14 +0200)] 
update TODO

4 years agocore: don't bind varlink socket if running in test mode
Lennart Poettering [Tue, 12 May 2020 15:28:27 +0000 (17:28 +0200)] 
core: don't bind varlink socket if running in test mode

Fixes: #15748
4 years agodocs: import password agents documentation
Дамјан Георгиевски [Tue, 12 May 2020 18:28:04 +0000 (20:28 +0200)] 
docs: import password agents documentation

imported from:
https://cgit.freedesktop.org/wiki/www/plain/Software/systemd/PasswordAgents.mdwn

4 years agopam_systemd_home: also store acquirement fd per user 15794/head
Lennart Poettering [Thu, 7 May 2020 09:01:42 +0000 (11:01 +0200)] 
pam_systemd_home: also store acquirement fd per user

We might pin a home through authentication and a different one through a
session, all from the same PAM context, like sudo does. Hence also store
the referencing fd keyed by the user name.

4 years agopam_systemd/pam_systemd_home: rework how we cache user records
Lennart Poettering [Thu, 7 May 2020 08:38:38 +0000 (10:38 +0200)] 
pam_systemd/pam_systemd_home: rework how we cache user records

Since acquiring user records involves plenty of IPC we try to cache user
records in the PAM context between our various hooks. Previously we'd
just cache whatever we acquired, and use it from the on, forever until
the context is destroyed.

This is problematic however, since some programs (notably sudo) use the
same PAM context for multiple different operations. Specifically, sudo
first authenticates the originating user before creating a session for
the destination user, all with the same PAM context. Thankfully, there
was a safety check for this case in place that re-validated that the
cached user record actually matched our current idea of the user to
operate on, but this just meant the hook would fail entirely.

Let's rework this: let's key the cache by the user name, so that we do
not confused by the changing of the user name during the context's
lifecycle and always, strictly use the cached user record of the user we
operate on.

Essentially this just means we now include the user name in the PAM data
field.

Secondly, this gets rid of the extra PAM data field that indicates
whether a user record is from homed or something else. To simplify
things we instead just cache the user record twice: once for consumption
by pam_systemd_home (which only wants homed records) and once shared by
pam_systemd and pam_systemd_home (and whoever else wants it). The cache
entries simply have different field names.