Commit Graph
57095 Commits
Author SHA1 Message Date
Yu Watanabe 4dbc0be2e5 udev/cdrom_id: re-enable logging related functions
The logging related functions are mistakenly located in main() by
a084b38789, and dropped by
23afa884d4.
2021-01-20 18:31:10 +00:00
Lennart Poettering 301265ea10 man: document recent systemd-sysext interface changes 2021-01-20 17:50:23 +01:00
Lennart Poettering 8de42cb461 sysext: add --force swich for forcibly ignoring version incompatibilities 2021-01-20 17:50:23 +01:00
Lennart Poettering 8662fcbcf1 sysext: rework command line interface to be verb-based
As suggested by @yuwata:

https://github.com/systemd/systemd/pull/18181#pullrequestreview-570826113
2021-01-20 17:50:23 +01:00
Lennart Poettering 9901835d80 sysext: split version validation logic into function of its own
Just some simple refactoring to simplify the logic.
2021-01-20 17:44:53 +01:00
Lennart Poettering 1f3707aeea sysext: use log_setup_cli() 2021-01-20 17:44:53 +01:00
Yu Watanabe 888f65ace6 path-util: simplify check_x_access()
Follow-up for ece852c845.

This addresses the following comments by the Lennart:
---
hmm, so this now does two access() calls for the case where the fd is
not requested, and opens things up for races (theoretically, …). now,
the access() code path was in place for optimization, but if an optimization
is less sexy than the original (and i think it is less sexy, since more
than one syscall, and non-atomic), i think we shouldn't do the optimization.

maybe we should just always use open(O_PATH) now, and then fstat() it to
check if regular file, and then access_fd() it for checking if its executable.
2021-01-20 17:43:36 +01:00
Luca Boccassi aac5fbff0b sysext: install in rootbindir, remove template from unit
This reverts commit 71ad75f306.
2021-01-20 15:25:03 +01:00
Susant Sahani cecaba2003 btrfs-util: tighten variable scope used in loop 2021-01-20 15:14:30 +01:00
Susant Sahani a67f102e79 analyze: tighten variable scope used in loop 2021-01-20 15:13:24 +01:00
Susant Sahani c2484a7514 sd-event: Use hashmap_ensure_put 2021-01-20 15:13:21 +01:00
Susant Sahani f656fdb623 sd-event: Use hashmap_ensure_put 2021-01-20 15:13:18 +01:00
Susant Sahani 639deab187 sd-device: Use TAKE_PTR 2021-01-20 15:13:13 +01:00
Susant Sahani e8480482ca sd-device: Use hashmap_ensure_put 2021-01-20 15:13:08 +01:00
Susant Sahani 875038d5fe udev-rules: use ordered_hashmap_ensure_put 2021-01-20 15:13:02 +01:00
Susant Sahani 0c7bd7ecbd network: networkd-network use TAKE_PTR 2021-01-20 15:09:26 +01:00
Susant Sahani 6de530f2b8 network: Use hashmap_ensure_put 2021-01-20 15:09:20 +01:00
Susant Sahani 9b1fd1f55b network: ndisc - Use ordered_set_ensure_put 2021-01-20 15:09:14 +01:00
Susant Sahani 32ae5db60a machine: Use hashmap_ensure_put 2021-01-20 15:09:09 +01:00
Susant Sahani 9a8d1b455b logind: Use hashmap_ensure_put 2021-01-20 15:09:03 +01:00
Susant Sahani 8231485bc5 journal: Use cleanup_free 2021-01-20 15:08:59 +01:00
Susant Sahani faa7e5a43b Journal: Use hashmap_ensure_put 2021-01-20 15:08:30 +01:00
Dan Streetman 23afa884d4 udev: use DEFINE_MAIN_FUNCTION in cdrom_id
This was failing s390x ubuntu ci due to an old version of binutils;
the binutils package in use for ubuntu ci tests has been updated and
the build no longer fails, so this can use the macro again.

Fixes: #18165
2021-01-20 08:31:47 +00:00
Lennart Poettering 741bfd7f4e tree-wide: ignore messages with too long control data
Apparently SELinux inserts control data into AF_UNIX datagrams where we
don't expect it, thus miscalculating the control data. This looks like
something to fix in SELinux, but we still should handle this gracefully
and just drop the offending datagram and continue.

recvmsg_safe() actually already drops the datagram, it's just a matter
of actually ignoring EXFULL (which it generates if control data is too
large) in the right places.

This does this wherever an AF_UNIX/SOCK_DGRAM socket is used with
recvmsg_safe() that is not just internal communication.

Fixes: #17795
Follow-up for: 3691bcf3c5
2021-01-20 14:05:45 +09:00
Zbigniew Jędrzejewski-Szmek 6eab0c6dba Revert "test-functions: make sure we test our own libudev instead of the host libudev"
This reverts commit 73484ecff9.

3976f372ae moved libudev.so to be built in the
main directory, so this addition to $LD_LIBRARY_PATH is now obsolete.

After that commit, we build the following shared libraries:

build/libnss_myhostname.so.2
build/libnss_mymachines.so.2
build/libnss_resolve.so.2
build/libnss_systemd.so.2
build/libsystemd.so.0.30.0
build/libudev.so.1.7.0
build/pam_systemd.so
build/pam_systemd_home.so
build/src/boot/efi/stub.so
build/src/boot/efi/systemd_boot.so
build/src/shared/libsystemd-shared-247.so

EFI stubs don't matter, and libsystemd-shared-nnn.so is loaded through rpath,
and is doesn't need to and shouldn't be in $LD_LIBRARY_PATH. In effect, we only
ever need to add the main build directory to the search path.
2021-01-20 14:04:52 +09:00
Lennart Poettering e327382877 markdown: fix comment
Follow-up for 2d816c9804
2021-01-19 22:26:35 +01:00
Lennart Poettering 2d816c9804 markdown: suggest backticks around uname -a output
Fixes: #18238
2021-01-19 22:24:05 +01:00
Lennart Poettering a631cbfae3 execute: for processes where creds logic is turned off, don't pass creds path to namespace logic
Otherwise, the namespace logic will try to mount a dir that doesn't
actually exist.

Fixes: #18116
2021-01-19 20:03:42 +01:00
Lennart Poettering f6c9a7ab93 Merge pull request #18307 from poettering/import-verity-download
importd: when downloading raw image, also download .roothash.p7s and .verity along with it
2021-01-19 20:02:34 +01:00
Lennart Poettering ac71ece3c6 import: refactor how we do gpg validation
Let's split out the actual gpg logic into a helper function, so that we
can add alternative validations later on.
2021-01-19 18:29:59 +01:00
Lennart Poettering 133b34f69a import: optionally pull .verity + .roothash.p7s data when downloading
We already had support for downlading a .nspawn and a .roothash file,
let's make the set complete, and also download .verity + roothash.p7s if
it exists, as nspawn consumes that.

Since there are now four kinds of additional resources to acquire, let's
introduce a PullFlags flags value for this instead of separate 'bool'
variables, it's just too many to always pass those around on the
function parameter list.
2021-01-19 18:29:59 +01:00
Lennart Poettering 6792cbbcf8 import: ignore non-successful HTTP codes for collecing image metadata
Previously we'd collect the data from redirects too, which wasn't
particularly terrible, since these typically don't carry the data we
were interested in, but it's still incorrect to do so.
2021-01-19 18:29:59 +01:00
Lennart Poettering 8dc0291c0d import: turn on HTTP logging in debug mode 2021-01-19 18:29:59 +01:00
Lennart Poettering 273cb07d1b import: small memory management simplification 2021-01-19 18:29:59 +01:00
Lennart Poettering 8bc3f0b89f import: reset PullJob properly
Properly reset all fields that have to do with the current GET job when
we restart things. Previously we freed/reset only some stuff, leaking
some memory even.
2021-01-19 18:29:59 +01:00
Lennart Poettering f14717a7e2 import: rework how verification works
Previously the PullJob object took internal care of rerequested the
SHA256SUMS file, if requesting <image>.sha256 didn't work. This was a
weird a non-abstraction only used when actually getting the checksum
files.

Let's move this out of the PullJob, so that it is generic again, and
does roughly the same stuff for all resources it is used for: let's
define a generic .on_not_found() handler that can be set on a PullJob
object, and is called whenever with see HTTP 404, and may be used to
provide a new URL to try if the first didn't work.

This is also preparation for later work to support PKCS#7 signatures
instead of gpg signatures, where a similar logic is needed, and we thus
should have a generic infrastructure place.

This gets rid of the VerificationStyle field in the PullJob object:
instead of storing this non-generic field we just derive the same
information from the URL itself, which is safe, since we generated it
ourselves earlier.
2021-01-19 18:29:59 +01:00
Lennart Poettering c20307fd34 import: use TAKE_PTR() where available 2021-01-19 18:29:59 +01:00
Lennart Poettering c6cb8daf72 import: make scope of variable smaller 2021-01-19 18:29:59 +01:00
Lennart Poettering 7d41de2e94 import: comment indent fix 2021-01-19 18:29:59 +01:00
Lennart Poettering 63ec26a4bf fs-util/rm-rf: improve remove+free destructors to take and return NULL
Let#s make these helpers useful even without _cleanup_ logic, to destory
arbitary fields: make them OK wiht a NULL pointer as input, and always
return one as output.
2021-01-19 18:29:59 +01:00
Susant Sahani c038ce4606 network: add support to RoutingPolicyRule lookup table name 2021-01-19 16:37:46 +00:00
Florian Westphal 79dd224093 add ipv6 range element creation test cases
The nft set backend doesn't support network masks, it works with
ranges.  Inputs like dead::/64 thus need to be translated to two
'start' and 'end' elements.

The 'start' element is the first element in the range (i.e., dead::).
The 'stop' element is the first element *past* the range, (dead:0:0100::
in the example).

This adds a few test cases.
2021-01-19 16:38:56 +01:00
Florian Westphal f4fca22ad4 firewall-util-nft: clear previous address on replay
In case external entity wiped the ruleset, we need to clear the
'previous' address -- its already gone.

This prevents the transaction from succeeding: the delete operation fails.
2021-01-19 16:38:56 +01:00
Florian Westphal 48ed276647 networkd: extend IPMasquerade to cover ipv6
Extend IPMasquerade to also cover ipv6.
For compatibility reasons with earlier releases IPMasquerade=yes
is identical to IPMasquerade=ipv4.

Use IPMasquerade=both to cover ipv6 as well as ipv4.

IPForward will now also enable ipv6 forwarding if IPMasquerade for ipv6 is enabled.
2021-01-19 16:38:53 +01:00
Florian Westphal deff68e718 nspawn: expose container ipv6 address too
Extend nspawn so it can keep track of one ipv4 and one ipv6 address.
2021-01-19 16:22:58 +01:00
Florian Westphal 0e544221c9 firewall-util: add ipv6 support to nftables backend
closely mirrors the existing ipv4 ruleset:
table ip6 io.systemd.nat {
        set masq_saddr {
                type ipv6_addr
                flags interval
        }

        map map_port_ipport {
                type inet_proto . inet_service : ipv6_addr . inet_service
        }

        chain prerouting {
                type nat hook prerouting priority dstnat + 1; policy accept;
                fib daddr type local dnat ip6 addr . port to meta l4proto . th dport map @map_port_ipport
        }

        chain output {
                type nat hook output priority -99; policy accept;
                ip6 daddr != ::1 oif "lo" dnat ip6 addr . port to meta l4proto . th dport map @map_port_ipport
        }

        chain postrouting {
                type nat hook postrouting priority srcnat + 1; policy accept;
                ip6 saddr @masq_saddr masquerade
        }
}

Only difference is the use of ipv6 addresses instead of ipv4 ones.

Currently has no effect: all in-tree callers pass AF_INET exclusively.
Followup patches will make nspawn expose ipv6 too and rework
IPMasquerade option to support both/v4/v6.
2021-01-19 16:22:58 +01:00
Lennart Poettering 656e5aa452 Merge pull request #18181 from poettering/sysext
systemd-sysext as a method of merging simple OS extensions into /usr and /opt
2021-01-19 16:02:58 +01:00
Lennart Poettering a2804e3cd8 Merge pull request #18129 from keszybz/envvars
Allow control characters in environment variable values
2021-01-19 16:02:27 +01:00
Benjamin Berg 84171ba179 tools: Pass source directory to autosuspend-update.sh
This makes sense so that we can extend the script to also update other
files.
2021-01-19 15:05:27 +01:00
Florian Westphal bf108eb942 homed: fix build without p11kit
homectl-pkcs11.c: In function 'identity_add_pkcs11_key_data':
homectl-pkcs11.c:155:13: error: implicit declaration of function 'pkcs11_acquire_certificate' [-Werror=implicit-function-declaration]

Restores the P11KIT compile-time test that was removed in 2289a78473
("homed: move pkcs11 LUKS glue into shared code").
2021-01-19 14:38:39 +01:00