1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00
Commit Graph

46795 Commits

Author SHA1 Message Date
Christian Göttsche
e813a74ae8 selinux: create /run/user/${USERID}/systemd with default context 2020-09-05 21:39:44 +02:00
Christian Göttsche
1006038cf1 selinux: early exit in mac_selinux_maybe_reload if not initialized
Binaries might not initialize SELinux, e.g. when they normally do not
create files with the SELinux default context.
If they, via an internal libary function, call a _label() function,
mac_selinux_maybe_reload() gets called. Since the SELinux status page
has not been opened, selinux_status_updated() will fail with EINVAL.

This affects particularly test binaries.

Just exit early and avoid confusing debug logs.
2020-09-05 21:39:12 +02:00
George Rawlinson
22c2f841db man: fix typo in resolved.conf 2020-09-05 21:38:01 +02:00
Zbigniew Jędrzejewski-Szmek
ad161cd6bb
Merge pull request #16951 from yuwata/resolve-follow-ups-for-extra-dns-stub-listener
resolve: follow-ups for extra DNS stub listener
2020-09-05 15:55:22 +02:00
Zbigniew Jędrzejewski-Szmek
5615e92efa
Merge pull request #16854 from yuwata/sd-bus-error-set-errnofv
sd-bus: rework sd_bus_error_set_errnofv()
2020-09-05 15:47:37 +02:00
Zbigniew Jędrzejewski-Szmek
7de6b05160
Merge pull request #16957 from poettering/sd-bus-proto-def-move
three unrelated, minor fixes
2020-09-05 12:06:15 +02:00
Lennart Poettering
8d91b2206c varlink: properly allocate connection event source
Let's make sure we keep a reference to the event source

(Note that this code is currently not used, which is why this was never
used: in all cases we do not add listener fds after the event is
attached, but before. In that case this code is not called.)
2020-09-04 23:54:14 +02:00
Lennart Poettering
1ba37106b3 ptyfwd: don't set prio if event source that might not exist
We support read-only ptyfwd options, and on those the input event source
won't be allocated. Deal with that and don't invoke a function on it
that will then instantly fail.
2020-09-04 23:52:41 +02:00
Lennart Poettering
fb2cfa6c13 sd-bus: move SD_BUS_MAXIMUM_(SIGNATURE|NAME)_LENGTH to sd-bus-protocol.h
So far we kept all defines directly originating from the spec in
sd-bus-protocol.h, do this for this too.

The precise place doesn't matter much API-wise given that sd-bus.h includes
sd-bus-protocol.h, hence let's just clean this up.
2020-09-04 23:51:21 +02:00
Zbigniew Jędrzejewski-Szmek
d11578f30e test-sizeof: print pointer sizes
This is useful information, I don't know why we forgot to add it there.

gcc doesn't like arithemetic on a pointer to a function or void*, so don't
print signedness info there. It doesn't matter anyway.
C says function pointers can be different... Though I guess our code isn't
prepared for that.
2020-09-04 18:45:44 +02:00
Zbigniew Jędrzejewski-Szmek
a9030b81c1 udev-test: do not rely on "mail" group being defined
"audio" should be there, at least we declare it. "mail" nowadays is less
likely to exist than in the past.

Fixes one of the items in #16942.
2020-09-04 18:45:44 +02:00
Zbigniew Jędrzejewski-Szmek
cced2b98ef test-execute: check if private directories have bad permissions before running test_exec_dynamicuser()
If the directory (/var/lib/private is most likely) has borked permissions, the
test will fail with a cryptic message and EXIT_STATE_DIRECTORY or similar. The
message from the child with more details gets lost somewhere. Let's avoid running
the test in that case and provide a simple error message instead.

E.g. systemd-238-12.git07f8cd5.fc28.ppc64 (which I encountered on a test machine)
has /var/lib/private with 0755.
2020-09-04 18:45:44 +02:00
Zbigniew Jędrzejewski-Szmek
9978e631cd core/manager: reindent table for readability 2020-09-04 18:14:26 +02:00
Zbigniew Jędrzejewski-Szmek
5b10116e49 core/{execute, manager}: reduce scope of iterator variables a bit 2020-09-04 18:14:26 +02:00
Zbigniew Jędrzejewski-Szmek
0b3861d224 test-execute/exec-dynamicuser-statedir.service: fix quoting
All backslashes that should be single in shell syntax need to be written as "\\" because
our parser will remove one level of quoting. Also, single quotes were doubly nested, which
cannot work.

Should fix the following message:
test-execute/exec-dynamicuser-statedir.service:16: Ignoring unknown escape sequences: "test $$(find / \( -path /var/tmp -o -path /tmp -o -path /proc -o -path /dev/mqueue -o -path /dev/shm -o -path /sys/fs/bpf -o -path /dev/.lxc \) -prune -o -type d -writable -print 2>/dev/null | sort -u | tr -d \\n) = /var/lib/private/quux/pief/var/lib/private/waldo"
2020-09-04 18:11:22 +02:00
Zbigniew Jędrzejewski-Szmek
f90d2d7bf1 test-execute: simplify condition
tests is always a static array, it cannot be NULL.
2020-09-04 18:11:22 +02:00
Luca Boccassi
836540070d core: add [Enable|Disable]UnitFilesWithFlags DBUS methods
The new methods work as the unflavoured ones, but takes flags as a
single uint64_t DBUS parameters instead of different booleans, so
that it can be extended without breaking backward compatibility.
Add new flag to allow adding/removing symlinks in
[/etc|/run]/systemd/system.attached so that portable services
configuration files can be self-contained in those directories, without
affecting the system services directories.
Use the new methods and flags from portablectl --enable.

Useful in case /etc is read-only, with only the portable services
directories being mounted read-write.
2020-09-04 17:56:37 +02:00
Yu Watanabe
f3f14c573b util: constify the second argument of set_get() 2020-09-04 17:52:26 +02:00
Yu Watanabe
89f7435d0c resolve: use correct fd for UDP stub listner 2020-09-04 23:54:35 +09:00
Yu Watanabe
d1fb8cdae2 resolve: do not check sender and destination for packet received by extra DNS stub listner 2020-09-04 23:54:35 +09:00
Yu Watanabe
7216a3b5dc resolve: use sd_event_source_set_io_fd_own() for stub listners 2020-09-04 23:54:35 +09:00
Yu Watanabe
bf22f231cf resolve: introduce dns_stub_listener_extra_free() and set it as a key destructor 2020-09-04 23:54:35 +09:00
Yu Watanabe
1c17bcb3ad resolve: adjust error messages 2020-09-04 23:54:35 +09:00
Yu Watanabe
af8b138422 resolve: do not set IPv4 specific options on IPv6 socket 2020-09-04 23:54:30 +09:00
Yu Watanabe
d40f00d798 resolve: do not set IP_TTL for extra DNS stub listeners 2020-09-04 23:53:22 +09:00
Yu Watanabe
180c22328b missing: add IPV6_FREEBIND 2020-09-04 23:53:18 +09:00
Lennart Poettering
e825610499
Merge pull request #16880 from yuwata/network-dhcp4-cleanups
network: DHCPv4 cleanups
2020-09-04 15:54:27 +02:00
Zbigniew Jędrzejewski-Szmek
434fef6de3 shared/sleep-config: more logging and port to extract_first_word() 2020-09-04 13:53:47 +02:00
Yu Watanabe
fc7676e313 util: drop unused socket_addr_port_from_string_auto() 2020-09-04 20:05:58 +09:00
Yu Watanabe
ca8b62b522 resolve: use in_addr_union to store addresses for extra dns stub listeners 2020-09-04 20:05:58 +09:00
Yu Watanabe
b4b7ea1b32 resolve: fix indentation 2020-09-04 20:05:58 +09:00
Yu Watanabe
4e0a46f65e util: introduce SOCKADDR_LEN() macro 2020-09-04 20:05:58 +09:00
Yu Watanabe
fc6021554b test: add tests for in_addr_port_from_string_auto() 2020-09-04 20:05:58 +09:00
Yu Watanabe
23c5aeaac3 test: move several tests from test-socket-util.c 2020-09-04 20:05:58 +09:00
Yu Watanabe
c4fe658366 util: introduce in_addr_port_to_string() 2020-09-04 20:05:58 +09:00
Yu Watanabe
c364cefb3a util: make in_addr_ifindex_to_string() an alias of in_addr_port_ifindex_name_to_string() 2020-09-04 20:05:58 +09:00
Yu Watanabe
355e884ded util: introduce in_addr_port_from_string_auto() 2020-09-04 20:05:58 +09:00
Yu Watanabe
4650582657 resolve: stop extra stub listners before freeing information about them 2020-09-04 20:05:58 +09:00
Yu Watanabe
7314b39746 resolve: set DNS_STUB_LISTENER_YES if no protocol is specified in DNSStubListenExtra= 2020-09-04 20:05:58 +09:00
Yu Watanabe
dce65cd40f resolve: Manager::dns_stub_listener_mode is not relevant to extra stub listeners 2020-09-04 20:05:58 +09:00
Yu Watanabe
88d2cb7c0e resolve: make DnsStubListenerMode bitfield 2020-09-04 20:05:58 +09:00
Yu Watanabe
8ae07803a0 resolve: rename dns_stub_extra_event_source -> event_source
As the name is too redundant.
2020-09-04 20:05:58 +09:00
Yu Watanabe
6421194b31 man: update DNSStubListenerExtra= 2020-09-04 20:05:54 +09:00
Zbigniew Jędrzejewski-Szmek
46bf625aca Add string_contains_word_strv()
I had to move STRV_MAKE to macro.h. There is a circular dependency between
extract-word.h, strv.h, and string-util.h that makes it hard to define the
inline function otherwise.
2020-09-04 12:59:26 +02:00
Zbigniew Jędrzejewski-Szmek
81823e6c12 sd-login: use string_contains_word() 2020-09-04 12:59:26 +02:00
Zbigniew Jędrzejewski-Szmek
53cd7f3374 basic: add string_contains_word()
This wraps the common pattern of using extract_first_word() in a loop
to look for a matching word.
2020-09-04 12:59:25 +02:00
Zbigniew Jędrzejewski-Szmek
0176728a73 test-string-util,test-extract-word: add log headers 2020-09-04 12:59:25 +02:00
Zbigniew Jędrzejewski-Szmek
459c41b9e2
Merge pull request #16881 from yuwata/network-routing-policy-rule-cleanups
network: routing policy rule cleanups
2020-09-04 12:57:20 +02:00
Zbigniew Jędrzejewski-Szmek
a36a23f52b
Merge pull request #16952 from yuwata/resolvectl-log-level-follow-ups
resolvectl: update help message
2020-09-04 12:21:15 +02:00
Yu Watanabe
aea4660af8 test: add tests for sd_bus_error_set_errnof() 2020-09-04 19:15:50 +09:00