Commit Graph

47489 Commits

Author SHA1 Message Date
Lennart Poettering fc8bc57f6b
Merge pull request #16968 from yuwata/remove-old-device-on-move-event
core, udev: remove old device on move event
2020-10-14 17:49:37 +02:00
Lennart Poettering 4840807c6d man: update sd_bus_message_read_array() docs to clarify return value 0 vs. 1 2020-10-14 17:36:06 +02:00
Lennart Poettering 6293d958a4 sd-bus: initialize return values on success in sd_bus_message_read_array()
Fixes: #17346
2020-10-14 17:35:00 +02:00
Zbigniew Jędrzejewski-Szmek 165fee860a sd-bus: add debug logs where we try to connect
When connection to the bus fails it can be mighty hard to figure out
what went wrong because we have many different connection mechanisms and
we don't log what is happenning.
2020-10-14 17:34:07 +02:00
Lennart Poettering 7848cb8c57
Merge pull request #17338 from poettering/close-range
make use of new kernel 5.9 close_range() syscall in close_all_fds()
2020-10-14 17:22:15 +02:00
Lennart Poettering 670eed4c8c core: debug log about received fds 2020-10-14 16:41:37 +02:00
Lennart Poettering 74aaf59b1a execute: make sure some more functions follow coding style
Initialize all return values on success, as our usual coding style
suggests.
2020-10-14 16:41:37 +02:00
Lennart Poettering f5fa352f1e execute: fix single character typo
Corrects: c413bb28df

Fixes: #17313
2020-10-14 16:41:37 +02:00
Yu Watanabe fd8f865c9f
Merge pull request #17342 from yuwata/network-dhcp-ipv4-acd-fixes
network: fixes several issues in IPv4 DAD for DHCP4
2020-10-14 23:12:41 +09:00
Zbigniew Jędrzejewski-Szmek 547f724f7a
Merge pull request #17267 from yuwata/hashmap_put_strdup
hashmap: make hashmap_put_strdup() take hash_ops
2020-10-14 15:05:15 +02:00
Zbigniew Jędrzejewski-Szmek 540e0bad3e
Merge pull request #17316 from yuwata/network-address-ipv4-peer-issue-17304
network: directly compare with in_addr element for IPv4 case
2020-10-14 15:02:14 +02:00
Yu Watanabe dfc637d0ff
Merge pull request #17341 from yuwata/sd-dhcp-client-fix-eexist-issue-16964
sd-dhcp: make sd_dhcp_client_set_request_option() not return -EEXIST
2020-10-14 18:55:39 +09:00
Yu Watanabe 0e569a439a network: start dynamic addressing clients like DHCP after setting netdevs
The function link_acquire_conf() may make the link state 'configuring'
when DHCP6 PD is enabled. Previously link_acquire_conf() was called
before link_enter_join_netdev(), and thus the assertion in the function
might be triggered.

Fixes #17329.
2020-10-14 10:52:02 +02:00
Lennart Poettering eaa2751685 update TODO 2020-10-14 10:40:36 +02:00
Lennart Poettering 59c4bbfb93 test-fd-util: add test case for close_all_fd() 2020-10-14 10:40:32 +02:00
Lennart Poettering b8cfa2da7c fd-util: port close_all_fds() to close_range() 2020-10-14 10:40:29 +02:00
Lennart Poettering 441e0fdb90 missing: add close_range() wrapper
The syscall was added in 5.9 and is not yet exposed in glibc, hence
define our own wrapper.
2020-10-14 10:40:10 +02:00
Lennart Poettering 6ea0d25c57 seccomp: allowlist close_range() by default in @basic-io 2020-10-14 10:40:06 +02:00
Lennart Poettering 562b01e996 alloc-util: avoid allocating zero size memory blocks
It's not clear what libc's make of this. We clamp to 1 byte allocations
in most cases already, let's add this for a few where this was missing.
2020-10-14 10:39:48 +02:00
Lennart Poettering a748b122be
analyze: show ungrouped syscalls separately (#17343)
This updates the "systemd-analyze syscall-filter" command to show a
special section of syscalls that are included in @known but in no other
group. Typically this should show syscalls we either should add to any
of the existing groups or where we unsure were they best fit in.

Right now, it mostly shows arch-specific compat syscalls, we probably
should move "@obsolete". This patch doesn't add thta however.
2020-10-14 10:31:59 +02:00
Zbigniew Jędrzejewski-Szmek 0a42426d79 pager: make pager secure when under euid is changed or explicitly requested
The variable is renamed to SYSTEMD_PAGERSECURE (because it's not just about
less now), and we automatically enable secure mode in certain cases, but not
otherwise.

This approach is more nuanced, but should provide a better experience for
users:

- Previusly we would set LESSSECURE=1 and trust the pager to make use of
  it. But this has an effect only on less. We need to not start pagers which
  are insecure when in secure mode. In particular more is like that and is a
  very popular pager.

- We don't enable secure mode always, which means that those other pagers can
  reasonably used.

- We do the right thing by default, but the user has ultimate control by
  setting SYSTEMD_PAGERSECURE.

Fixes #5666.

v2:
- also check $PKEXEC_UID

v3:
- use 'sd_pid_get_owner_uid() != geteuid()' as the condition
2020-10-14 10:04:12 +02:00
Yu Watanabe 5431227400 network: update MAC address in IPv4ACD client for DHCP4 2020-10-14 15:38:29 +09:00
Yu Watanabe a7df5cae54 network: also stop IPv4ACD client in link_stop_clients() 2020-10-14 15:38:29 +09:00
Yu Watanabe 66f507e1ba network: stop IPv4ACD client for DHCPv4 when lease is exprired 2020-10-14 15:38:29 +09:00
Yu Watanabe 10fa21c0dc network: move IPv4ACD client for DHCPv4 from Network to Link object
A .network file may matches multiple interfaces.
2020-10-14 15:38:29 +09:00
Yu Watanabe 8ff85383b4 network: voidify link_stop_clients() in link_enter_failed() 2020-10-14 15:38:29 +09:00
Yu Watanabe 4eb6a826b8 network: drop unused condition 2020-10-14 13:02:46 +09:00
Yu Watanabe 4081756a63 sd-dhcp-client: make sd_dhcp_client_set_request_option() not return -EEXIST
Fixes #16964.
2020-10-14 12:54:55 +09:00
Dmitry Borodaenko 5fad3913e2 typo in systemd.network(5): IPv6PrefixDelegation=dhcpv6 2020-10-14 07:28:47 +09:00
Bjørn Mork 7fe7547ba3 units: update serial-getty@.service to support 57600 baud rate
Fixes: #17306
2020-10-13 21:00:11 +02:00
Yu Watanabe a0887abbd8 sd-device: use trivial_hash_ops_free_free for managing match sysattrs or properties
This fixes an issue caused by eb1c1dc029.

Before the commit, multiple values can be specified for the same
sysattr or property.

Fixes #17259.
2020-10-13 22:45:15 +09:00
Yu Watanabe 5e71868ced util: introduce two trivial hash_ops
Will be used in a later commit.
2020-10-13 22:40:22 +09:00
Yu Watanabe 11e9fec259 hashmap: introduce {hashmap,set}_put_strdup_full()
They can take hash_ops.
2020-10-13 22:39:06 +09:00
Zbigniew Jędrzejewski-Szmek 1b5b507cd2 test-login: always test sd_pid_get_owner_uid(), modernize
A long time some function only worked when in a session, and the test
didn't execute them when sd_pid_get_session() failed. Let's always call
them to increase coverage.

While at it, let's test for ==0 not >=0 where we don't expect the function
to return anything except 0 or error.
2020-10-13 14:43:08 +02:00
Zbigniew Jędrzejewski-Szmek ffae0b0d22 hwdb: update for v247
As usual, it seems that there are mostly additions with a smaller amount
of corrections, no big removals.
2020-10-13 13:45:11 +02:00
Yu Watanabe 21266e60e9 test-network: add test for issue #17304 2020-10-13 20:32:17 +09:00
Yu Watanabe b1476b5210 network: constify arguments 2020-10-13 20:30:38 +09:00
Yu Watanabe fe841414ef network: read peer address, label, broadcast from rtnl message
Then, Address objects in Network and Link can be easily compared by
address_equal().
2020-10-13 20:30:35 +09:00
Yu Watanabe 9b9c5fff16 network: directly compare with in_addr element for IPv4 case
When peer address is set, address_compare_func() (or address_equal())
does not work in link_is_static_address_configured(), as an Address object
stored in a Link does not contain peer addresses. So, we need to also
compare with in_addr element for IPv4 case.

Fixes #17304.
2020-10-13 20:30:16 +09:00
Daniele Medri a8cfc17962
po: revert some recent translation changes (#17237)
This partially reverts 7b8c70ed209:
- È richiesto autenticarsi → Autenticazione richiesta
- «${unit}» → '${unit}'
2020-10-13 12:30:20 +02:00
Lennart Poettering 2a9b9323cd sysctl: set kernel.core_pipe_limit=16
We need to make sure that our coredump pattern handler manages to read
process metadata from /proc/$PID/ before the kernel reaps the crashed
process. By default the kernel will reap the process as soon as it can.
By setting kernel.core_pipe_limit to a non-zero the kernel will wait for
userspace to finish before reaping.

We'll set the value to 16, which allows 16 crashes to be
processed in parallel. This matches the MaxConnections= setting in
systemd-coredump.socket.

See: #17301

(This doesn't close 17301, since we probably should also gracefully
handle if /proc/$PID/ vanished already while our coredump handler runs,
just in case people loclly set the sysctl back to zero. i.e. we should
collect what we can and rather issue an incomplete log record than
none.)
2020-10-13 09:31:13 +02:00
Zbigniew Jędrzejewski-Szmek a4ccce22d9 systemctl: ignore invalid variables in import-environment
When doing import-environment, we shouldn't fail if some assignment is invalid.
OTOH, if the invalid assignment is specified as a positional argument, we should
keep failing.

This would also fix https://bugzilla.redhat.com/show_bug.cgi?id=1754395, by
ignoring certain variables which are not important in that scenario. It seems
like the right thing to do in general.
2020-10-12 18:27:20 +02:00
Zbigniew Jędrzejewski-Szmek b45c068dd8 basic/env-util: (mostly) follow POSIX for what variable names are allowed
There was some confusion about what POSIX says about variable names:

   names shall not contain the character '='. For values to be portable
   across systems conforming to POSIX.1-2008, the value shall be composed
   of characters from the portable character set (except NUL and as
   indicated below).

i.e. it allows almost all ASCII in variable names (without NUL and DEL and
'='). OTOH, it says that *utilities* use a smaller set of characters:

   Environment variable names used by the utilities in the Shell and
   Utilities volume of POSIX.1-2008 consist solely of uppercase letters,
   digits, and the <underscore> ( '_' ) from the characters defined in
   Portable Character Set and do not begin with a digit.

When enforcing variable names in environment blocks, we need to use this
first definition, so that we can propagate all valid variables.
I think having non-printable characters in variable names is too much, so
I took out the whitespace stuff from the first definition.

OTOH, when we use *shell syntax*, for example doing variable expansion,
it seems enough to support expansion of variables that the shell would allow.

Fixes #14878,
https://bugzilla.redhat.com/show_bug.cgi?id=1754395,
https://bugzilla.redhat.com/show_bug.cgi?id=1879216.
2020-10-12 18:24:28 +02:00
Zbigniew Jędrzejewski-Szmek 0b3456428b test-env-util: print function headers 2020-10-12 18:23:52 +02:00
Zbigniew Jędrzejewski-Szmek 4b6f74f5a0 basic/selinux: work around mallinfo deprecation
Latest glibc has deprecated mallinfo(), so it might become unavailable at some point
in the future. There is malloc_info(), but it returns XML, ffs. I think the information
that we get from mallinfo() is quite useful, so let's use mallinfo() if available, and
not otherwise.
2020-10-12 15:51:39 +02:00
Lennart Poettering d775d8e6f7 update TODO 2020-10-12 13:11:55 +02:00
Benjamin Berg 47c1db6730 xdg-autostart: Lower most info messages to debug level
It is expected for numerous autostart files to not be convertible to
corresponding units. The information is only useful for someone
debugging why a file might not be started, but it is not generally
useful for users in most situations.

As such, lower the warnings. Anyone wondering why an application is not
started will easily notice that the unit is not generated. From there it
will be somewhat harder to figure out why, but the overall trade-off is
still improved.

Fixes: #17305
2020-10-12 11:56:09 +02:00
Lennart Poettering 5de5dc30df
Merge pull request #17302 from keszybz/fix-inhibitors
Fix inhibitors
2020-10-12 11:41:18 +02:00
Lennart Poettering 656f7f8aa5
Merge pull request #17273 from mrc0mmand/coccinelle-check-for-bad-errno
coccinelle: resolve our own macros to avoid skipping functions
2020-10-12 11:39:25 +02:00
Hans de Goede b5d8a5b1e5 hwdb: Add accel orientation quirk for MPMAN Converter 9 2-in-1
Add a quirk to fix the accelerometer orientation on the MPMAN
Converter 9 2-in-1.
2020-10-12 11:36:47 +02:00