Commit Graph
57095 Commits
Author SHA1 Message Date
Luca Boccassi bb35478bf9 Merge pull request #19421 from yuwata/fix-typo
core, network: Fix typo
2021-04-26 10:08:07 +01:00
Yu Watanabe 25054e1bfb network: add missing sections
Follow-up for 4e26a5baa0.

Fixes one of issues in #19410.
2021-04-26 10:07:52 +02:00
Yu Watanabe 8170992a79 core/service: fix typo
Follow-up for bbe19f6884.
2021-04-26 09:20:30 +09:00
Yu Watanabe cead8ed66e network: fix typo
Follow-up for 4b409e855b.
2021-04-26 09:19:41 +09:00
Lennart Poettering be8fc0ef2e Merge pull request #19411 from poettering/homectl-fixes
homectl password caching fixes
2021-04-24 09:17:38 +02:00
Lennart Poettering 57bb9bcba5 homectl: pick up cached/credential store/env var passwords *before* issuing first request
Previously, we'd generally attempt the operation first, without any
passwords, and only query for a password if that operation then fails
and asks for one. This is done to improve compatibility with
password-less authentication schemes, such as security tokens and
similar.

This patch modifies this slightly: if a password can be acquired cheaply
via the keyring password cache, the $CREDENTIALS_PATH credential store,
or the $PASSWORD/$PIN environment variables, acquire it *before* issuing
the first requested.

This should save us a pointless roundtrip, and should never hurt.
2021-04-23 23:22:37 +02:00
Lennart Poettering 7bdbafc261 homectl: don't use password cache if we operate on other user 2021-04-23 23:22:37 +02:00
Lennart Poettering ea086f0610 homectl: don't use cached passwords when re-requesting password because wrong
Asking repeatedly for a password is pointless if we always use the same
cached one. Let's thus disable cache use whenever we failed already
once.
2021-04-23 23:18:43 +02:00
Lennart Poettering 43ed3d294a test: use systemd-run -P instead of -t in TEST-50
We want to use the result in a shell pipeline hence use -P mode (pipe
mode) instead of -t mode (interactive tty mode) for systemd-run.

This shouldn't change much about the test, but is slightly more correct
(and quicker).
2021-04-23 22:23:19 +02:00
Zbigniew Jędrzejewski-Szmek 954c77c251 tests: use setfacl to give $SUDO_USER read permissions on artifacts
We have to invoke the tests as superuser, and not being able to read
the journal as the invoking user is annoying. I don't think there are
any security considerations here, since the invoking user can already
put arbitrary code in the Makefile and test scripts which get executed
with root privileges.
2021-04-23 20:19:09 +02:00
Lennart Poettering cd4d2b1777 update TODO 2021-04-23 17:57:26 +02:00
Lennart Poettering 400c1e8f98 gpt-auto-generator: pull in systemd-growfs@.service if new GPT growfs partition flag is set 2021-04-23 17:57:22 +02:00
Lennart Poettering 66e482cbdb man: document the new grow-file-system flag 2021-04-23 17:57:19 +02:00
Lennart Poettering 1c41c1dc34 repart: add GrowFileSystem= setting to set new GPT partition flag for newly created partitions
And set it to on by default, except if partition is marked read-only.
2021-04-23 17:56:55 +02:00
Lennart Poettering c65f854af6 tree-wide: enable automatic growing of file systems in images in various tools that deal with OS images
Let's enable this in all tools that intend to write to the OS images.
It's not conditionalized for now, as there already is conditionalization
in the existance or absence of the flag in the GPT partition table (and
it's opt-in), hence it should be OK to just enable this by default for
now if the flag is set.
2021-04-23 17:56:51 +02:00
Lennart Poettering 74a54baeec dissect: enable growfs by default, but make it configurable
This adds a new --growfs=yes|no switch to systemd-dissect, defaulting to
on.
2021-04-23 17:56:34 +02:00
Lennart Poettering 81939d9d5e dissect-image: optionally, grow file systems on mount
The new GPT partition flag the previous commits added is now honoured on
mount.
2021-04-23 17:56:23 +02:00
Lennart Poettering ee8e497d24 dissect: show growfs flag in systemd-dissect table output 2021-04-23 17:56:19 +02:00
Lennart Poettering de98f63140 dissect: look for new GPT partition flag marking partitions for growing
systemd-repart can grow partitions dynamically at boot, but it won't
grow the file systems inside them. In /etc/fstab you can request that
via x-systemd.growfs. So far we didn't have a nice scheme for images
with GPT auto-discovery however, and that meant in particular in tools
such as systemd-nspawn the file systems couldn't be grown automatically.

Let's address this: let's define a new GPT partition flag that can be
set for our partition types. If set it indicates that the file system
should be grown to the partition size on mount.

This commit adds the flag and adds code to discover it when dissecting
images. There's no code yet to actually do something about it.
2021-04-23 17:55:45 +02:00
Luca Boccassi 778139c6e4 Merge pull request #19156 from dtardon/enable-warn
install: warn if WantedBy targets don't exist
2021-04-23 16:43:45 +01:00
Lennart Poettering d2194e15db fstab-generator: clean up mount point flags handling
Let's rename MountpointsFlags → MountPointFlags. In most of our codebase
we name things mount_point/MountPoint rather than mountpoint/Mountpoint,
do so here too.

Also, prefix the enum values with "MOUNT_". The fact the enum values
weren#t prefixed was pretty unique in our codebase, and pretty
surprising. Let's fix that.

This is just refactoring, no actual change in behaviour
2021-04-23 16:55:29 +02:00
Zbigniew Jędrzejewski-Szmek 9020479246 core/service: also reject deserialized commands with no argv[0]
I'm pretty sure that bad things would happen later on.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek 1a128a468d core/service: fix deserialization of non-absolute commands
We'd fail with:
Apr 23 10:58:26 systemd[1]: Deserializing state...
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Failed to parse serialized command "ExecStart 0 sh "sh" "-e" "-x" "-c" "systemctl --state=failed --no-legend --no-pager >/failed ; systemctl daemon-reload ; echo OK >/testok"": Invalid argument
Apr 23 10:58:26 systemd[1]: testsuite-01.service: Reinstalled deserialized job testsuite-01.service/start as 209

This was missed in 5008da1ec1, and apparently nobody noticed until now :(
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek f89a20f1d4 TEST-58: exit immediately if systemd-repart is not available
Debian disables systemd-repart at config time.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek dd1fa6c89a TEST-58: only run under qemu
In a container, /dev/loop* will most likely be inaccessible.
2021-04-23 15:12:38 +02:00
Zbigniew Jędrzejewski-Szmek 7bf20e48bd test: move the logic to support /skipped into shared logic
The logic to query test state was rather complex. I don't quite grok the point
of ret=$((ret+1))… But afaics, the precise result was always ignored by the
caller anyway.
2021-04-23 15:12:35 +02:00
Zbigniew Jędrzejewski-Szmek 7b87fe4c30 various: print the image path when setting up of the loopback device fails 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek 409607c111 core: fix typos in comment 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek 3d3aafa453 TODO: add some items for repart 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek b0f04bafe0 TEST-58: remove stale artifacts to not fail on repeated invocations
We would remove stuff only if successful, so repeated invocations would
trivially fail.

Also drop "-f", so that if we expect to remove something, it must be there.
2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek 0dd77c159a tests: install mkfs.ext4, mkfs.vfat and modules into the test image
This allows TEST-58-REPART to at least start. It fails later with with loopback
device errors.
2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek 30f56248f5 TEST-58: adjust whitespace and enable pipefail 2021-04-23 15:11:38 +02:00
Zbigniew Jędrzejewski-Szmek 86df23b67c TEST-58: execute the right test 2021-04-23 15:11:38 +02:00
Frantisek Sumsal 6f47e45c67 test: configure swap for TEST-55-OOMD
oomd works way better with swap, so let's make the test less flaky by
configuring a swap device for it. This also allows us to drop the ugly
`cat`s from the load-generating script.
2021-04-23 14:36:14 +02:00
jiangchuangang 3a1e9d8083 logind:add missing equal sign 2021-04-23 11:56:16 +01:00
Lennart Poettering 2f166bb79b man: document _outbound 2021-04-23 12:02:24 +02:00
Lennart Poettering ee18f107d3 resolved: synthesize _outbound magic hostname here too 2021-04-23 12:02:20 +02:00
Lennart Poettering a1fdbcbe3d nss-myhostname: expose the "outbound" IP addresses under the synthetic "_outbound" hostname
I found myself often looking for a quick way to determine "the local IP
address", and then being lost in the "ip addr" output to find for the
right one to use. This is supposed to help a bit with that. Let's
introduce a new special hostname "_outbound" with semantics similar to
"_gateway" that resolves to addresses that are the closest I could come
up with that maps to "the" local IP address.
2021-04-23 12:02:11 +02:00
Lennart Poettering 54e6f97bc9 local-addresses: add helper for determining local "outbound" IP addresses
This adds a small helper, similar in style to local_addresses() and
local_gateways() that determines the local "outbound" addresses.

What's an "outbound" address supposed to be? The local IP addresses that
are the most likely used for outbound communication. It's determined
by using connect() towards the default gws on an UDP socket, and then
reading the address of the socket this caused it to be bound to.

This is not the "public" or "external" IP address of the local system,
and is not supposed to be. It's just the local IP addresses that are
likely the ones going to be used by the local IP stack for
communication with other hosts.
2021-04-23 12:01:41 +02:00
Lennart Poettering ce0cedacc4 Merge pull request #19124 from takaswie/topic/fw-audio-entries
hwdb/rule: add database and rules for known audio  and music unit in IEEE 1394 bus
2021-04-23 11:31:34 +02:00
Flos Lonicerae c44a285c41 Add D-Bus property exposing Ctrl-Alt-Delete action (#19217) 2021-04-23 09:57:14 +02:00
David Tardon 8adbad370f test-install-root: add test for unknown WantedBy= target 2021-04-23 07:28:37 +02:00
Jan Synacek 8ae27441c2 install: warn if WantedBy targets don't exist
Currently, if [Install] section contains WantedBy=target that doesn't exist,
systemd creates the symlinks anyway. That is just user-unfriendly.
Let's be nice and warn about installing non-existent targets.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1835351.

Replaces: #15834
2021-04-23 07:28:37 +02:00
David Tardon cd228002cc test-install-root: create referenced targets 2021-04-23 07:28:37 +02:00
Yu Watanabe 625772c9c1 test-network: update tests for DHCP routes
This removes static-route option from the default dnsmasq command.
2021-04-23 08:49:29 +09:00
Yu Watanabe 3e42968342 network: dhcp4: ignore null dns address 2021-04-23 08:49:29 +09:00
Yu Watanabe afe23f876e network: dhcp4: set gateway for route to DNS server if it is not in the same network
Fixes #19077.
2021-04-23 08:49:29 +09:00
Yu Watanabe 7f206276ad network: dhcp4: ignore gateway in static routes if destination is link-local or in the same network
This also configures routes to gateways in static routes if the
destination is not in the same network.
2021-04-23 08:49:29 +09:00
Yu Watanabe b714d9a6e3 network: dhcp4: also set route MTU to prefix route and DNS routes 2021-04-23 08:49:29 +09:00
Yu Watanabe ec39af3249 Merge pull request #19392 from yuwata/network-dhcp-split-link_set_dhcp_routes
network: split link_set_dhcp_routes() into smaller functions
2021-04-23 08:32:46 +09:00