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

3 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

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

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

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

3 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()

3 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

3 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>
3 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

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

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

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

3 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

3 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

3 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

3 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

3 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

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

3 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)

3 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

3 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

3 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

3 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

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

3 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

3 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

3 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

3 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
3 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

3 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

3 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

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

3 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 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 agoMerge pull request #15785 from poettering/pam-sudo-fixes-part1
Lennart Poettering [Tue, 12 May 2020 13:54:42 +0000 (15:54 +0200)] 
Merge pull request #15785 from poettering/pam-sudo-fixes-part1

some simple PAM fixes split out of #15742

4 years agoMerge pull request #15789 from poettering/homed-bus-api
Zbigniew Jędrzejewski-Szmek [Tue, 12 May 2020 09:42:40 +0000 (11:42 +0200)] 
Merge pull request #15789 from poettering/homed-bus-api

man: document homed bus API

4 years agoupdate TODO 15785/head
Lennart Poettering [Mon, 11 May 2020 21:12:56 +0000 (23:12 +0200)] 
update TODO

4 years agopam_systemd: also print debug lines when ending a session
Lennart Poettering [Thu, 7 May 2020 08:35:48 +0000 (10:35 +0200)] 
pam_systemd: also print debug lines when ending a session

4 years agopam_systemd: drop unused uid argument from export_legacy_dbus_address()
Lennart Poettering [Thu, 7 May 2020 08:01:29 +0000 (10:01 +0200)] 
pam_systemd: drop unused uid argument from export_legacy_dbus_address()

4 years agopam_systemd_home: use correct macro for converting ptr to fd
Lennart Poettering [Thu, 7 May 2020 08:49:52 +0000 (10:49 +0200)] 
pam_systemd_home: use correct macro for converting ptr to fd

4 years agoman: document homed D-Bus API 15789/head
Lennart Poettering [Tue, 12 May 2020 06:55:28 +0000 (08:55 +0200)] 
man: document homed D-Bus API

4 years agohomed: fix parameter names on D-Bus methods
Lennart Poettering [Tue, 12 May 2020 07:02:47 +0000 (09:02 +0200)] 
homed: fix parameter names on D-Bus methods

These arguments contain UserRecord structures serialized to JSON,
however only the "secret" part of it, not a whole user record. We do
this since the secret part is conceptually part of the user record and
in some contexts we need a user record in full with both secret and
non-secret part, and in others just the secret and in other just the
non-secret part, but we want to keep this in memory in the same logic.

Hence, let's rename the arguments where we expect a user record
consisting only of the secret part to "secret".

4 years agoman: run man/update-dbus-docs again
Lennart Poettering [Tue, 12 May 2020 08:37:28 +0000 (10:37 +0200)] 
man: run man/update-dbus-docs again

4 years agonetlink: port to recvmsg_safe()
Lennart Poettering [Thu, 23 Apr 2020 17:47:38 +0000 (19:47 +0200)] 
netlink: port to recvmsg_safe()

This also makes sure the control buffer is properly aligned. This
matters, as otherwise the control buffer might not be aligned and the
cmsg buffer counting might be off. The incorrect alignment is becoming
visible by using recvmsg_safe() as we suddenly notice the MSG_CTRUNC bit
set because of this.

That said, apparently this isn't enough to make this work on all
kernels. Since I couldn't figure this out, we now add 1K to the buffer
to be sure. We do this once already, also for a pktinfo structure
(though an IPv4/IPv6) one. I am puzzled by this, but this shouldn't
matter much. it works locally just fine, except for those ubuntu CI
kernels...

While we are at it, make some other changes too, to simplify and
modernize the function.

4 years agoFix misuse of PAM_PROMPT_ECHO_OFF in systemd-homed
Joel Shapiro [Sat, 9 May 2020 05:38:41 +0000 (00:38 -0500)] 
Fix misuse of PAM_PROMPT_ECHO_OFF in systemd-homed

Previously pam_systemd_home.so was relying on `PAM_PROMPT_ECHO_OFF` to
display error messages to the user and also display the next prompt.
`PAM_PROMPT_ECHO_OFF` was never meant as a way to convey information to
the user, and following the example set in pam_unix.so you can see that
it's meant to _only_ display the prompt. Details about why the
authentication failed should be done in a `PAM_ERROR_MSG` before
displaying a short prompt as per usual using `PAM_PROMPT_ECHO_OFF`.

4 years agoMerge pull request #15762 from keszybz/gcc-10-build
Zbigniew Jędrzejewski-Szmek [Mon, 11 May 2020 17:43:40 +0000 (19:43 +0200)] 
Merge pull request #15762 from keszybz/gcc-10-build

Fix build with -O3 with gcc 10

4 years agoDHCP client: make SendOption work for DHCPv6 too.
Andrew Doran [Fri, 1 May 2020 14:30:31 +0000 (10:30 -0400)] 
DHCP client: make SendOption work for DHCPv6 too.

4 years agoMerge pull request #15460 from elmarco/network-dhcp-resolve1
Lennart Poettering [Mon, 11 May 2020 14:16:06 +0000 (16:16 +0200)] 
Merge pull request #15460 from elmarco/network-dhcp-resolve1

network: fallback on resolve1 DNS for DHCP

4 years agoshared/ethtool-util: hush gcc warnings about array bounds 15762/head
Zbigniew Jędrzejewski-Szmek [Sat, 9 May 2020 07:09:11 +0000 (09:09 +0200)] 
shared/ethtool-util: hush gcc warnings about array bounds

[127/1355] Compiling C object 'src/shared/5afaae1@@systemd-shared-245@sta/ethtool-util.c.o'
../src/shared/ethtool-util.c: In function ‘ethtool_get_permanent_macaddr’:
../src/shared/ethtool-util.c:260:60: warning: array subscript 5 is outside the bounds of an interior zero-length array ‘__u8[0]’ {aka ‘unsigned char[]’} [-Wzero-length-bounds]
  260 |                 ret->ether_addr_octet[i] = epaddr.addr.data[i];
      |                                            ~~~~~~~~~~~~~~~~^~~
In file included from ../src/shared/ethtool-util.c:5:
../src/shared/linux/ethtool.h:704:7: note: while referencing ‘data’
  704 |  __u8 data[0];
      |       ^~~~
../src/shared/ethtool-util.c: In function ‘ethtool_set_features’:
../src/shared/ethtool-util.c:488:31: warning: array subscript 0 is outside the bounds of an interior zero-length array ‘__u32[0]’ {aka ‘unsigned int[]’} [-Wzero-length-bounds]
  488 |         len = buffer.info.data[0];
      |               ~~~~~~~~~~~~~~~~^~~
In file included from ../src/shared/ethtool-util.c:5:
../src/shared/linux/ethtool.h:631:8: note: while referencing ‘data’
  631 |  __u32 data[0];
      |        ^~~~

The kernel should not define the length of the array, but it does. We can't fix
that, so let's use a cast to avoid the warning.

For https://github.com/systemd/systemd/issues/6119#issuecomment-626073743.

v2:
- use #pragma instead of a cast. It seems the cast only works in some cases, and
  gcc is "smart" enough to see beyond the cast. Unfortunately clang does not support
  this warning, so we need to do a config check whether to try to suppress.

4 years agoMerge pull request #15768 from poettering/grnd-insecure
Zbigniew Jędrzejewski-Szmek [Mon, 11 May 2020 10:49:00 +0000 (12:49 +0200)] 
Merge pull request #15768 from poettering/grnd-insecure

random-util: make use of GRND_INSECURE if we have it

4 years agoMerge pull request #15769 from poettering/man-tmpfiles-boot-override
Zbigniew Jędrzejewski-Szmek [Mon, 11 May 2020 10:46:36 +0000 (12:46 +0200)] 
Merge pull request #15769 from poettering/man-tmpfiles-boot-override

man: document how "!" and conflicting lines play together in tmpfiles.d

4 years agoman: clarify that exit status name mappings are unaffected by SuccessExitStatus=
Lennart Poettering [Mon, 11 May 2020 08:36:28 +0000 (10:36 +0200)] 
man: clarify that exit status name mappings are unaffected by SuccessExitStatus=

Fixes: #15757
(Note there's quite some confusion regarding "exit status" vs. "exit
code" in the docs here. We should clean this up fully one day. This
change tries to fix some occasions of the wrong use, but not all.)

4 years agoAdded Chuwi Hibook Pro (Model: CWI526) (#15770)
Benjamin Dahlhoff [Mon, 11 May 2020 08:25:02 +0000 (10:25 +0200)] 
Added Chuwi Hibook Pro (Model: CWI526) (#15770)

4 years agoseccomp-util: add new syscalls from kernel 5.6 to syscall filter table
Lennart Poettering [Sun, 10 May 2020 07:19:29 +0000 (09:19 +0200)] 
seccomp-util: add new syscalls from kernel 5.6 to syscall filter table

4 years agocore: Update prototype of notify_message, tags list is read only
Benjamin Robin [Sun, 10 May 2020 16:38:08 +0000 (18:38 +0200)] 
core: Update prototype of notify_message, tags list is read only

Indicates that the tags list cannot be modified by notify_message function.
Since the tags list is created only once for multiple call to
notify_message functions.

4 years agobasic: Allow to call STRV_FOREACH_BACKWARDS() with a char * const * strv
Benjamin Robin [Sun, 10 May 2020 16:33:16 +0000 (18:33 +0200)] 
basic: Allow to call STRV_FOREACH_BACKWARDS() with a char * const * strv

4 years agotmpfiles: clarify that "!" lines are filtered before collisions are checked 15769/head
Lennart Poettering [Sun, 10 May 2020 09:45:52 +0000 (11:45 +0200)] 
tmpfiles: clarify that "!" lines are filtered before collisions are checked

Fixes: #15675
4 years agoman: mention the exclamation mark and minus sign literally, to make things searchable
Lennart Poettering [Sun, 10 May 2020 09:44:53 +0000 (11:44 +0200)] 
man: mention the exclamation mark and minus sign literally, to make things searchable

I was looking for the explanation for the exclamation mark in the text,
and couldn't find it, searching for "!". Let's make this easier, and
indicate the character meant.

4 years agoupdate TODO 15768/head
Lennart Poettering [Sun, 10 May 2020 09:20:01 +0000 (11:20 +0200)] 
update TODO

4 years agorandom-util: make use of GRND_INSECURE when it is defined
Lennart Poettering [Sun, 10 May 2020 09:15:16 +0000 (11:15 +0200)] 
random-util: make use of GRND_INSECURE when it is defined

kernel 5.6 added support for a new flag for getrandom(): GRND_INSECURE.
If we set it we can get some random data out of the kernel random pool,
even if it is not yet initializated. This is great for us to initialize
hash table seeds and such, where it is OK if they are crap initially. We
used RDRAND for these cases so far, but RDRAND is only available on
newer CPUs and some archs. Let's now use GRND_INSECURE for these cases
as well, which means we won't needlessly delay boot anymore even on
archs/CPUs that do not have RDRAND.

Of course we never set this flag when generating crypto keys or uuids.
Which makes it different from RDRAND for us (and is the reason I think
we should keep explicit RDRAND support in): RDRAND we don't trust enough
for crypto keys. But we do trust it enough for UUIDs.

4 years agorandom-util: use ERRNO_IS_NOT_SUPPORTED() macro
Lennart Poettering [Sun, 10 May 2020 09:14:10 +0000 (11:14 +0200)] 
random-util: use ERRNO_IS_NOT_SUPPORTED() macro

Some container mgr or sandbox solution might block it with an unexpected
error code, hence let's be tolerant here.

4 years agorandom-util: actually encode our expectations on RAND_MAX
Lennart Poettering [Sun, 10 May 2020 09:13:49 +0000 (11:13 +0200)] 
random-util: actually encode our expectations on RAND_MAX

4 years agoupdate TODO
Lennart Poettering [Sun, 10 May 2020 08:19:05 +0000 (10:19 +0200)] 
update TODO

4 years agofs-util: beef up path_is_encrypted() to deal with LVM block devices
Lennart Poettering [Thu, 7 May 2020 13:34:50 +0000 (15:34 +0200)] 
fs-util: beef up path_is_encrypted() to deal with LVM block devices

Let's iterate through the slaves/ directory to find backing devices of
the block devices we care about.

4 years agotree-wide: Replace assert() by assert_se() when there is side effect
Benjamin Robin [Fri, 8 May 2020 11:32:11 +0000 (13:32 +0200)] 
tree-wide: Replace assert() by assert_se() when there is side effect

4 years agoupdate TODO
Lennart Poettering [Sat, 9 May 2020 09:10:56 +0000 (11:10 +0200)] 
update TODO

4 years agoupdate TODO
Lennart Poettering [Sat, 9 May 2020 08:37:32 +0000 (10:37 +0200)] 
update TODO

4 years agocore: fix compilation with gcc -O3
Zbigniew Jędrzejewski-Szmek [Sat, 9 May 2020 06:53:27 +0000 (08:53 +0200)] 
core: fix compilation with gcc -O3

../src/core/path.c: In function ‘path_serialize’:
../src/core/path.c:616:24: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  616 |                 (void) serialize_item_format(f, "path-spec", "%s %%i %%s",
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  617 |                                              path_type_to_string(s->type) //,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618 |                                              //                                             s->previous_exists,
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |                                              //                                             s->path
      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  620 |                 );
      |                 ~
In function ‘path_spec_dump’,
    inlined from ‘path_dump’ at ../src/core/path.c:392:17:
../src/core/path.c:226:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  226 |         fprintf(f,
      |         ^~~~~~~~~~
  227 |                 "%s%s: %s\n",
      |                 ~~~~~~~~~~~~~
  228 |                 prefix,
      |                 ~~~~~~~
  229 |                 path_type_to_string(s->type),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  230 |                 s->path);
      |                 ~~~~~~~~

s->type should be valid here, so let's just add an assert.

For https://github.com/systemd/systemd/issues/6119#issuecomment-626073743.

4 years agonetworkctl: use uint64_t for link speed throughout
наб [Thu, 7 May 2020 19:34:39 +0000 (21:34 +0200)] 
networkctl: use uint64_t for link speed throughout

format-table used size_t/uint64_t interchangeably for TABLE_BPS,
and ethtool-util used SIZE_MAX to indicate SPEED_UNKNOWN,
which worked only on ABIs with 64-bit pointers.

For example, the tg3 driver returns SPEED_UNKNOWN with no link (cf.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/broadcom/tg3.c?id=3eb2efbea193789397c36f52b17d8692ac79bf68#n12190)
which on x32 (and other 32-bit ABIs, presumably) caused
"networkctl status" to mark it with "Speed: 4Gbps":

nabijaczleweli@szarotka:~$ networkctl --version
systemd 245 (245.5-2)
nabijaczleweli@szarotka:~$ file $(which networkctl)
/bin/networkctl: ELF 32-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /libx32/ld-linux-x32.so.2,
BuildID[sha1]=36d684cb1fc8fb5060050d32b969e5aa172fa607, for GNU/Linux
3.4.0, stripped
nabijaczleweli@szarotka:~$ networkctl status onboard1
● 4: onboard1
                Driver: tg3
                 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express
                 Speed: 4Gbps

Whereas on 64-bit-pointer ABIs (here: amd64):

nabijaczleweli@szarotka:~$ networkctl --version
systemd 245 (245.5-2)
nabijaczleweli@szarotka:~$ file $(which networkctl)
/bin/networkctl: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=7a3e406e54968d7774ad467fc3f6a9d35ff7aea2, for GNU/Linux
3.2.0, stripped
nabijaczleweli@szarotka:~$ networkctl status onboard1
● 4: onboard1
                Driver: tg3
                 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express
                 Speed: n/a

With this patch, networkctl returns, for x32:

nabijaczleweli@szarotka:~$ networkctl --version
systemd 245 (245.5-2.1~networkctl-4g-v2)
nabijaczleweli@szarotka:~$ file $(which networkctl)
/bin/networkctl: ELF 32-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /libx32/ld-linux-x32.so.2,
BuildID[sha1]=36d684cb1fc8fb5060050d32b969e5aa172fa607, for GNU/Linux
3.4.0, stripped
nabijaczleweli@szarotka:~$ networkctl status onboard1
● 4: onboard1
                Driver: tg3
                 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express
                 Speed: n/a

And for amd64:

nabijaczleweli@szarotka:~$ file $(which networkctl)
/bin/networkctl: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=7a3e406e54968d7774ad467fc3f6a9d35ff7aea2, for GNU/Linux
3.2.0, stripped
nabijaczleweli@szarotka:~$ networkctl status onboard1
● 4: onboard1
                Driver: tg3
                 Model: NetXtreme BCM5755 Gigabit Ethernet PCI Express
                 Speed: n/a

4 years agocifuzz: fuzz the master branch on push
Frantisek Sumsal [Fri, 8 May 2020 18:14:19 +0000 (20:14 +0200)] 
cifuzz: fuzz the master branch on push

Apart from running CIFuzz for each relevant PR, let's run it
unconditionally for each push to master to detect possible issues
(caused by ignored PRs, etc.).

Followup to 94f660a8fe6144b9153c8acaf9e6bb9e47e14b97.

4 years agocifuzz: run only for relevant PRs
Frantisek Sumsal [Fri, 8 May 2020 16:46:46 +0000 (18:46 +0200)] 
cifuzz: run only for relevant PRs

Fuzz only PRs with relevant changes (source code and fuzzer corpora) to
save resources.

4 years agoMerge pull request #15703 from poettering/homed-tweak-default-storage
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 14:57:14 +0000 (16:57 +0200)] 
Merge pull request #15703 from poettering/homed-tweak-default-storage

homed: avoid double encryption

4 years agonetwork: fallback on resolved resolv.conf for DHCP server settings 15460/head
Marc-André Lureau [Tue, 28 Apr 2020 15:59:47 +0000 (17:59 +0200)] 
network: fallback on resolved resolv.conf for DHCP server settings

4 years agoMerge pull request #15651 from poettering/newlocale-check
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:31:34 +0000 (11:31 +0200)] 
Merge pull request #15651 from poettering/newlocale-check

check if locales are installed before using them

4 years agohomectl: color disk free output if low on free space
Lennart Poettering [Thu, 7 May 2020 16:47:28 +0000 (18:47 +0200)] 
homectl: color disk free output if low on free space

4 years agohwdb: Fix accel orientation quirk for Medion Akoya E2215T MD60198
Hans de Goede [Thu, 7 May 2020 21:16:21 +0000 (23:16 +0200)] 
hwdb: Fix accel orientation quirk for Medion Akoya E2215T MD60198

Commit 3d864658ea01 ("hwdb: assume all Medion Akoya E-models have the
same matrix"), unified the entries for most Medion Akoya E* modes,
including the entry for the Medion Akoya E2215T MD60198.

But the accelerometer on the E2215T has an ACPI-id of KIOX000A, rather
then KIOX010A as the other models have, so that commit broke the
ACCEL_MOUNT_MATRIX for the E2215T.

Add a separate match for the E2215T so that it gets the correct
ACCEL_MOUNT_MATRIX again.

4 years agoMerge pull request #15718 from poettering/tmpfiles-offline
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:22:19 +0000 (11:22 +0200)] 
Merge pull request #15718 from poettering/tmpfiles-offline

tmpfiles: read /etc/passwd + /etc/group with fgetpwent()/fgetgrent() if --root= is specified

4 years agoMerge pull request #15623 from poettering/cmsg-cleanup
Zbigniew Jędrzejewski-Szmek [Fri, 8 May 2020 09:05:06 +0000 (11:05 +0200)] 
Merge pull request #15623 from poettering/cmsg-cleanup

various CMSG_xyz clean-ups, split out of #15571

4 years agoupdate TODO 15703/head
Lennart Poettering [Tue, 5 May 2020 06:38:29 +0000 (08:38 +0200)] 
update TODO

4 years agoman: document homed.conf
Lennart Poettering [Tue, 5 May 2020 09:02:12 +0000 (11:02 +0200)] 
man: document homed.conf

4 years agohomed: make default storage/file system type configurable in homed.conf
Lennart Poettering [Tue, 5 May 2020 07:57:04 +0000 (09:57 +0200)] 
homed: make default storage/file system type configurable in homed.conf

4 years agohomed: move supported_fstype() to home-util.c
Lennart Poettering [Tue, 5 May 2020 07:55:53 +0000 (09:55 +0200)] 
homed: move supported_fstype() to home-util.c

That way we can use it from other modules too. Just some shifting
around, no change in behaviour.

4 years agohomed: tweak logic for picking a default storage and file system
Lennart Poettering [Fri, 1 May 2020 17:42:56 +0000 (19:42 +0200)] 
homed: tweak logic for picking a default storage and file system

Let's make the logic a bit smarter: if we detect that /home is
encrypted, let's avoid double encryption and prefer plain
directory/subvolumes instead of our regular luks images.

Also, allow configuration go storage/file system via an env var passed
to homework. In a later commit, let's then change homed to initialize
that env var from a config file setting, when invoking homework.

4 years agohome: when adding a binding for a user record, use common code for determining automa...
Lennart Poettering [Fri, 1 May 2020 17:40:39 +0000 (19:40 +0200)] 
home: when adding a binding for a user record, use common code for determining automatic image path

Make use of the new user_record_build_image_path() helper the previous
commit added to share some code.

Also, let's make sure we update all parsed-out fields with the new data
from the binding, so that the parsed-out fields are definitely
up-to-date.

4 years agouser-record: split out code that generates automatic image path for records
Lennart Poettering [Fri, 1 May 2020 17:39:07 +0000 (19:39 +0200)] 
user-record: split out code that generates automatic image path for records

No change of behaviour, just some refactoring, so that we can use this
new helper function elswhere, too.

4 years agofs-util: add helper path_is_encrypted() that checks if a file system is encrypted
Lennart Poettering [Fri, 1 May 2020 17:37:24 +0000 (19:37 +0200)] 
fs-util: add helper path_is_encrypted() that checks if a file system is encrypted

4 years agoupdate TODO
Lennart Poettering [Thu, 7 May 2020 21:30:06 +0000 (23:30 +0200)] 
update TODO

4 years agoshared: move in_addr_ifindex_name_from_string_auto() there
Marc-André Lureau [Tue, 28 Apr 2020 15:58:24 +0000 (17:58 +0200)] 
shared: move in_addr_ifindex_name_from_string_auto() there

4 years agocore/cgroup: fix return value of unit_cgorup_freezer_action()
Michal Sekletar [Thu, 7 May 2020 15:23:30 +0000 (17:23 +0200)] 
core/cgroup: fix return value of unit_cgorup_freezer_action()

We should return 0 only if current freezer state, as reported by the
kernel, is already the desired state. Otherwise, we would dispatch
return dbus message prematurely in bus_unit_method_freezer_generic().

Thanks to Frantisek Sumsal for reporting the issue.