]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agonetwork/netdev: generate persistent MAC address for batadv and bridge 21549/head
Yu Watanabe [Mon, 8 Nov 2021 02:36:09 +0000 (11:36 +0900)] 
network/netdev: generate persistent MAC address for batadv and bridge

This mostly reverts 489f01f806f865eabb55458c98182b06a6c53a62 and
deb2cfa4c6885d448eb1f17e5ef1b139106b7e86.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.

3 years agonetwork/netdev: make MACAddress= take 'none' to suppress generating persistent hardwa...
Yu Watanabe [Sun, 28 Nov 2021 02:51:08 +0000 (11:51 +0900)] 
network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address

This is mostly equivalent to .link file's MACAddressPolicy=none.

3 years agonetwork/netdev: move config_parse_netdev_kind() at the end
Yu Watanabe [Sun, 28 Nov 2021 02:23:42 +0000 (11:23 +0900)] 
network/netdev: move config_parse_netdev_kind() at the end

3 years agonamespace: allow ProcSubset=pid with some ProtectKernel options
Topi Miettinen [Sat, 27 Nov 2021 10:51:39 +0000 (12:51 +0200)] 
namespace: allow ProcSubset=pid with some ProtectKernel options

In case `/proc` is successfully mounted with pid tree subset only due to
`ProcSubset=pid`, the protective mounts for `ProtectKernelTunables=yes` and
`ProtectKernelLogs=yes` to non-pid `/proc` paths are failing because the paths
don't exist. But the pid only option may have failed gracefully (for example
because of ancient kernel), so let's try the mounts but it's not fatal if they
don't succeed.

3 years agoMerge pull request #21535 from yuwata/network-netdev-verify-mac
Luca Boccassi [Sat, 27 Nov 2021 13:48:56 +0000 (13:48 +0000)] 
Merge pull request #21535 from yuwata/network-netdev-verify-mac

network/netdev: verify MAC address

3 years agonetwork: route: route->link may be NULL
Yu Watanabe [Sat, 27 Nov 2021 12:01:27 +0000 (21:01 +0900)] 
network: route: route->link may be NULL

Fixes #21544.

3 years agodocs: fix descriptions in discoverable partitions
Alyssa Ross [Sat, 27 Nov 2021 12:10:38 +0000 (12:10 +0000)] 
docs: fix descriptions in discoverable partitions

00db9a114e ("docs: generate table from header using a script") got the
descriptions for the partition types mixed up.  After that change, the
spec claimed, for example, that the /usr partition should contain
"dm-verity integrity hash data for the matching root partition", and
that the /usr verity partition should be of type "Any native, optionally
in LUKS".  This made the spec an extremely confusing read before I
figured out what must have happened!

I've gone through the table as it existed prior to 00db9a114e, and moved
the descriptions around in the script that generates the table until
they matched up with what they used to be.  Then I regenerated the
table from the fixed script.

3 years agoMerge pull request #21533 from yuwata/network-trivial-follow-ups
Yu Watanabe [Fri, 26 Nov 2021 21:42:19 +0000 (06:42 +0900)] 
Merge pull request #21533 from yuwata/network-trivial-follow-ups

network: trivial follow-ups

3 years agoMerge pull request #21530 from keszybz/strv-cleanup
Yu Watanabe [Fri, 26 Nov 2021 21:41:56 +0000 (06:41 +0900)] 
Merge pull request #21530 from keszybz/strv-cleanup

Modernize style and drop strv_free_free

3 years agonetwork/netdev: verify specified MAC address 21535/head
Yu Watanabe [Mon, 8 Nov 2021 03:41:47 +0000 (12:41 +0900)] 
network/netdev: verify specified MAC address

Drop multicast bit and set local bit of the specified MAC address.

This also makes failure in generating persistent MAC address
non-critical.

3 years agonetwork/netdev: use "struct hw_addr_data" to store MAC address
Yu Watanabe [Sun, 7 Nov 2021 02:23:14 +0000 (11:23 +0900)] 
network/netdev: use "struct hw_addr_data" to store MAC address

3 years agonetwork/netdev: introduce .iftype to netdev vtable
Yu Watanabe [Sun, 7 Nov 2021 07:27:33 +0000 (16:27 +0900)] 
network/netdev: introduce .iftype to netdev vtable

And disable .generate_mac flag for non-ether interfaces.

3 years agonetwork: veth: use SYNTHETIC_ERRNO() macro or use real error cause
Yu Watanabe [Thu, 25 Nov 2021 11:59:48 +0000 (20:59 +0900)] 
network: veth: use SYNTHETIC_ERRNO() macro or use real error cause

3 years agotest: create a dummy LSan suppression file in the minimal image
Frantisek Sumsal [Fri, 26 Nov 2021 15:21:51 +0000 (16:21 +0100)] 
test: create a dummy LSan suppression file in the minimal image

otherwise gcc's ASan complains (unlike clang's) when the image is used -
e.g. in TEST-29 or TEST-50.

```
[   17.328705] testsuite-29.sh[361]: + portablectl --profile=trusted attach --now --runtime /usr/share/minimal_0.raw app0
...
[   20.978649] systemd[1]: Starting app0-foo.service...
[   21.104844] kernel: loop0: detected capacity change from 0 to 24960
[   20.999559] systemd[1]: Starting app0.service...
[   21.126022] kernel: loop1: detected capacity change from 0 to 24960
...
[   21.861087] cat[422]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.868634] cat[421]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.877941] systemd[1]: app0.service: Control process exited, code=exited, status=1/FAILURE
[   21.878836] systemd[1]: app0.service: Failed with result 'exit-code'.
[   21.905712] systemd[1]: Failed to start app0.service.
```

Follow-up to f201f3447796a5424372d32b338bc3b907516c28.

3 years agoupdate TODO
Lennart Poettering [Fri, 26 Nov 2021 14:18:59 +0000 (15:18 +0100)] 
update TODO

3 years agobasic/strv: drop strv_free_free 21530/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 09:02:44 +0000 (10:02 +0100)] 
basic/strv: drop strv_free_free

I think the function name is confusing: we generally say "free_free" when
both keys and values are freed in a hash map, but here the type is an
array of strvs, so the name should be something like strv_array_free.

The function is unused since 143fadf369a18449464956206226761e49be1928 (2018),
let's just drop it.

3 years agobasic/strv: inline variables and modernize style a bit
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 08:47:44 +0000 (09:47 +0100)] 
basic/strv: inline variables and modernize style a bit

3 years agoupdate TODO
Lennart Poettering [Fri, 26 Nov 2021 13:49:19 +0000 (14:49 +0100)] 
update TODO

3 years agoNEWS: start with an entry for v250
Lennart Poettering [Fri, 26 Nov 2021 08:06:23 +0000 (09:06 +0100)] 
NEWS: start with an entry for v250

3 years agonetwork: update comment 21533/head
Yu Watanabe [Fri, 26 Nov 2021 12:01:30 +0000 (21:01 +0900)] 
network: update comment

Addresses https://github.com/systemd/systemd/pull/21517#discussion_r757096584.

3 years agonetif-util: update log message
Yu Watanabe [Fri, 26 Nov 2021 12:00:18 +0000 (21:00 +0900)] 
netif-util: update log message

Follow-up for 37593b7c488f7b957936500158f200af16534c6b.

3 years agoMerge pull request #21529 from keszybz/test-journal-flush-no-crash
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 11:28:44 +0000 (12:28 +0100)] 
Merge pull request #21529 from keszybz/test-journal-flush-no-crash

Fix crash in test-journal-flush in CI

3 years agotest: make test-55-oomd less flaky
Anita Zhang [Wed, 24 Nov 2021 09:02:22 +0000 (01:02 -0800)] 
test: make test-55-oomd less flaky

Make oomctl a bit less likely to race with systemd-oomd receiving the
managed oom cgroup info by checking oomctl output in a loop with
timeout.

Fixes #21146

3 years agoMerge pull request #21501 from medhefgo/test
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 11:23:18 +0000 (12:23 +0100)] 
Merge pull request #21501 from medhefgo/test

test: Use TEST macro

3 years agoMerge pull request #21360 from yuwata/network-json
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 10:04:52 +0000 (11:04 +0100)] 
Merge pull request #21360 from yuwata/network-json

network: json: add more information

3 years agotest-journal-flush: do not croak on corrupted input files 21529/head
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 08:46:02 +0000 (09:46 +0100)] 
test-journal-flush: do not croak on corrupted input files

We would fail if the input file was corrupted:
build/test-journal-flush ./system@0005b7dac334f805-0021aca076ae5c5e.journal\~
journal_file_copy_entry failed: Bad message
Assertion 'r >= 0' failed at src/libsystemd/sd-journal/test-journal-flush.c:55, function main(). Aborting.
[1]    619472 IOT instruction (core dumped)  build/test-journal-flush ./system@0005b7dac334f805-0021aca076ae5c5e.journal\~

Let's skip some "reasonable" errors.

Fixes #17963.

3 years agotest-journal-flush: allow testing against specific files
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 08:40:51 +0000 (09:40 +0100)] 
test-journal-flush: allow testing against specific files

>=0 → ==0 because sd_journal_open* are documented to return 0.

3 years agommap-cache: embed MMapCache.contexts[]
Vito Caputo [Thu, 25 Nov 2021 18:39:34 +0000 (10:39 -0800)] 
mmap-cache: embed MMapCache.contexts[]

Code simplification; no idea why the Context structs were being
heap-allocated piecemeal.  There aren't many and they're small,
and made even smaller with this commit.

This also gets rid of the Context.cache backreference by just
accompanying the Context* with MMapCache* to the few private
Context* operations, resolving the context ID to a Context* at
the single public entrypoint: mmap_cache_fd_get(), which asserts
on the value being within bounds.  The Context.id member and
checks are also removed, as there's far less opportunity for
these things to become inconsistent now.

Of course this drops all context_{add,free}() related code,
making for a tasty diffstat.

3 years agojournal: Deduplicate entry items before they are stored in the entry object
Daan De Meyer [Fri, 12 Nov 2021 14:32:40 +0000 (14:32 +0000)] 
journal: Deduplicate entry items before they are stored in the entry object

If the iovec contains the same data more than once, we'll end up with
duplicate offsets in the items array. Let's make sure we remove any
duplicates before we store the items in an entry object.

3 years agoMerge pull request #21253 from poettering/homed-auto-grow-shrink
Luca Boccassi [Thu, 25 Nov 2021 22:14:17 +0000 (22:14 +0000)] 
Merge pull request #21253 from poettering/homed-auto-grow-shrink

homed: automatic grow/shrink of LUKS home dirs

3 years agommap-cache: LIST_REMOVE() *after* w->unused_prev
Vito Caputo [Thu, 25 Nov 2021 15:05:06 +0000 (07:05 -0800)] 
mmap-cache: LIST_REMOVE() *after* w->unused_prev

The LIST_REMOVE() macro always assigns NULL to w->unused_prev,
meaning every time this window was in last_unused, the remainder
of the unused list was lost to the ether.

Turns out there's been a memory leak in journald after all, this
code has been there since at least 2013...

3 years agoMerge pull request #21522 from yuwata/home-fix-memleak
Zbigniew Jędrzejewski-Szmek [Thu, 25 Nov 2021 19:22:23 +0000 (20:22 +0100)] 
Merge pull request #21522 from yuwata/home-fix-memleak

home: fix memleak

3 years agoMerge pull request #21517 from yuwata/network-long-hw-addr
Zbigniew Jędrzejewski-Szmek [Thu, 25 Nov 2021 19:21:38 +0000 (20:21 +0100)] 
Merge pull request #21517 from yuwata/network-long-hw-addr

network: make MACAddress= can take longer address

3 years agonetwork,udev: make .network and .link file can match with hardware address longer...
Yu Watanabe [Thu, 4 Nov 2021 17:59:11 +0000 (02:59 +0900)] 
network,udev: make .network and .link file can match with hardware address longer or shorter than ETH_ALEN

3 years agoTry to fix exittype test flakyness
Henri Chain [Tue, 23 Nov 2021 15:47:18 +0000 (16:47 +0100)] 
Try to fix exittype test flakyness

The test was changed at @bluca 's request to avoid sleeps,
but the change insufficient to avoid all races.
The kill command is now run from the script itself to avoid using
ExecStartPost

3 years agojournal: Remove entry seqnum revert logic
Daan De Meyer [Fri, 12 Nov 2021 14:29:02 +0000 (14:29 +0000)] 
journal: Remove entry seqnum revert logic

This actually causes mismatches between the header tail entry seqnum
and the last entry seqnum since when we revert the header seqnum, we
don't remove the entry object we added. If adding the entry object
itself fails, we don't need to revert the seqnum since it's never
incremented so let's remove this logic alltogether.

3 years agoupdate TODO 21253/head
Lennart Poettering [Fri, 29 Oct 2021 07:56:22 +0000 (09:56 +0200)] 
update TODO

3 years agotest: add test case for homed rebalancing logic
Lennart Poettering [Thu, 25 Nov 2021 09:48:52 +0000 (10:48 +0100)] 
test: add test case for homed rebalancing logic

3 years agohomectl: add new "homectl rebalance" command
Lennart Poettering [Thu, 4 Nov 2021 16:38:13 +0000 (17:38 +0100)] 
homectl: add new "homectl rebalance" command

Let's add an explicit, synchronous command to request immediate rebalancing and
wait for it.

3 years agohomed: add explicit API for requesting rebalancing too
Lennart Poettering [Thu, 4 Nov 2021 15:32:05 +0000 (16:32 +0100)] 
homed: add explicit API for requesting rebalancing too

3 years agohomed: add automatic grow/shrink ("rebalancing")
Lennart Poettering [Tue, 2 Nov 2021 22:11:59 +0000 (23:11 +0100)] 
homed: add automatic grow/shrink ("rebalancing")

3 years agohomectl: expose new rebalanceWeight JSON use record field
Lennart Poettering [Thu, 4 Nov 2021 17:12:13 +0000 (18:12 +0100)] 
homectl: expose new rebalanceWeight JSON use record field

3 years agouser-record: add rebalanceWeight field
Lennart Poettering [Tue, 2 Nov 2021 22:09:31 +0000 (23:09 +0100)] 
user-record: add rebalanceWeight field

3 years agotest: don't provide password to deactivation
Lennart Poettering [Thu, 25 Nov 2021 09:58:50 +0000 (10:58 +0100)] 
test: don't provide password to deactivation

deactivation of home areas should work without any password being
supplied. Let's hence not supply it, to ensure things work correctly.

3 years agohomed: support LogControl1 D-Bus API too, and make use of it
Lennart Poettering [Thu, 25 Nov 2021 13:32:19 +0000 (14:32 +0100)] 
homed: support LogControl1 D-Bus API too, and make use of it

All our D-Bus services support the LogControl1 API, but homed didn't so
far. Fix that, and make use of it in the test case, to make debugging it
easier.

3 years agoMerge pull request #21487 from DaanDeMeyer/dissect-image-other-arch
Lennart Poettering [Thu, 25 Nov 2021 16:36:57 +0000 (17:36 +0100)] 
Merge pull request #21487 from DaanDeMeyer/dissect-image-other-arch

Allow dissect_image() to dissect images from architectures other than the native one

3 years agohomework: fix memleak 21522/head
Yu Watanabe [Thu, 25 Nov 2021 15:14:29 +0000 (00:14 +0900)] 
homework: fix memleak

Fixes #21521.

3 years agohomework: drop unnecessary initialization
Yu Watanabe [Thu, 25 Nov 2021 15:09:30 +0000 (00:09 +0900)] 
homework: drop unnecessary initialization

3 years agotest: Use TEST macro in more cases 21501/head
Jan Janssen [Wed, 24 Nov 2021 11:11:17 +0000 (12:11 +0100)] 
test: Use TEST macro in more cases

This converts to TEST macro in less trivial cases. This is mostly
due to having an intro or outro before/after the actual tests.

Some notable changes:
 - add a "test" to make sure the hashmap and ordered_hashmap tests
   from different compilation units are actually run in test-hashmap.c
 - make root arg a global var in test-install-root.c
 - slightly rework an EFI specific test in test-proc-cmdline.c
 - usage of saved_argv/saved_argc in test-process-util.c
 - splitting test-rlimit-util.c into several tests
 - moving the hwdb open check into intro in test-sd-hwdb.c
 - condense several "tests" into one in test-udev-util.c

3 years agotest: Use TEST macro
Jan Janssen [Wed, 24 Nov 2021 11:00:02 +0000 (12:00 +0100)] 
test: Use TEST macro

This converts to TEST macro where it is trivial.

Some additional notable changes:
 - simplify HAVE_LIBIDN #ifdef in test-dns-domain.c
 - use saved_argc/saved_argv in test-copy.c, test-path-util.c,
   test-tmpfiles.c and test-unit-file.c

3 years agotest-time-util: Properly restore TZ variable
Jan Janssen [Wed, 24 Nov 2021 17:45:16 +0000 (18:45 +0100)] 
test-time-util: Properly restore TZ variable

The test fails to call tzset() after unsetting TZ variable, which
could break other tests. Also, let's be nicer and actually restore
the TZ to its original value.

3 years agotest: Slightly rework DEFINE_TEST_MAIN macros
Jan Janssen [Tue, 23 Nov 2021 12:40:27 +0000 (13:40 +0100)] 
test: Slightly rework DEFINE_TEST_MAIN macros

- A lot of tests want a different log level
- Provides saved_argc/saved_argv to tests
- Separate intro/outro is more flexible

3 years agotest-network: add basic tests of json output 21360/head
Yu Watanabe [Tue, 16 Nov 2021 15:27:16 +0000 (00:27 +0900)] 
test-network: add basic tests of json output

3 years agonetwork: json: add more link information
Yu Watanabe [Sun, 14 Nov 2021 09:11:27 +0000 (18:11 +0900)] 
network: json: add more link information

3 years agonetwork: introduce link_flags_to_string_alloc() and kernel_operstate_to_string()
Yu Watanabe [Sun, 14 Nov 2021 09:36:42 +0000 (18:36 +0900)] 
network: introduce link_flags_to_string_alloc() and kernel_operstate_to_string()

3 years agonetwork: json: append routing policy rule information
Yu Watanabe [Sun, 14 Nov 2021 06:05:55 +0000 (15:05 +0900)] 
network: json: append routing policy rule information

3 years agonetwork: routing policy rule: introduce fr_act_type_full_to_string()
Yu Watanabe [Sun, 14 Nov 2021 08:36:33 +0000 (17:36 +0900)] 
network: routing policy rule: introduce fr_act_type_full_to_string()

3 years agonetwork: json: append neighbor information
Yu Watanabe [Sun, 14 Nov 2021 06:04:24 +0000 (15:04 +0900)] 
network: json: append neighbor information

3 years agonetwork: json: append nexthop information
Yu Watanabe [Sun, 14 Nov 2021 06:02:12 +0000 (15:02 +0900)] 
network: json: append nexthop information

3 years agonetwork: json: append route information
Yu Watanabe [Sun, 14 Nov 2021 06:00:06 +0000 (15:00 +0900)] 
network: json: append route information

3 years agonetwork: json: append address information
Yu Watanabe [Sun, 14 Nov 2021 05:56:23 +0000 (14:56 +0900)] 
network: json: append address information

3 years agonetwork: json: split manager_build_json() into two
Yu Watanabe [Sun, 14 Nov 2021 06:08:44 +0000 (15:08 +0900)] 
network: json: split manager_build_json() into two

3 years agonetwork: json: make {network,device}_build_json() accept NULL
Yu Watanabe [Sun, 14 Nov 2021 05:53:36 +0000 (14:53 +0900)] 
network: json: make {network,device}_build_json() accept NULL

3 years agonetwork: json: use new building json macros
Yu Watanabe [Sun, 14 Nov 2021 05:52:03 +0000 (14:52 +0900)] 
network: json: use new building json macros

3 years agonetwork: address: expose address_flags_to_string_alloc()
Yu Watanabe [Sun, 14 Nov 2021 05:46:50 +0000 (14:46 +0900)] 
network: address: expose address_flags_to_string_alloc()

3 years agojson: introduce several macros for building json object
Yu Watanabe [Thu, 11 Nov 2021 01:45:20 +0000 (10:45 +0900)] 
json: introduce several macros for building json object

3 years agoin-addr-util: introduce FAMILY_ADDRESS_SIZE_SAFE() macro
Yu Watanabe [Sun, 14 Nov 2021 06:24:20 +0000 (15:24 +0900)] 
in-addr-util: introduce FAMILY_ADDRESS_SIZE_SAFE() macro

3 years agojournal: Add more information to --verify error messages
Daan De Meyer [Fri, 12 Nov 2021 14:28:32 +0000 (14:28 +0000)] 
journal: Add more information to --verify error messages

3 years agojson: add new JSON_BUILD_CONST_STRING() macro
Lennart Poettering [Thu, 25 Nov 2021 09:25:03 +0000 (10:25 +0100)] 
json: add new JSON_BUILD_CONST_STRING() macro

This macro is like JSON_BUILD_STRING() but uses our json library's
ability to use literal strings directly as JsonVariant objects.

The changes all our codebase to use this new macro whenever we build
JSON objects from literal strings.

(I tried to make this automatic, i.e. to detect in JSON_BUILD_STRING()
whether something is a literal string nicely and thus do this stuff
automatically, but I couldn't find a way.)

This should reduce memory usage of our JSON code a bit. Constant strings
we use very often will now be shared and mapped directly from the ELF
image.

3 years agojson: don't assert() if we add a NULL element via json_variant_set_field()
Lennart Poettering [Thu, 25 Nov 2021 09:30:45 +0000 (10:30 +0100)] 
json: don't assert() if we add a NULL element via json_variant_set_field()

The rest of our JSON code tries hard to magically convert NULL inputs
into "null" JSON objects, let's make sure this also works with
json_variant_set_field().

3 years agonetwork: make MACAddress= takes hardware address with its length is INFINIBAND_ALEN 21517/head
Yu Watanabe [Thu, 4 Nov 2021 18:20:29 +0000 (03:20 +0900)] 
network: make MACAddress= takes hardware address with its length is INFINIBAND_ALEN

Also, the multicast and local bits in the specified MAC address for
ethernet are adjusted.

3 years agomkosi: Install sd-boot using postinst script instead of in build script 21487/head
Daan De Meyer [Tue, 23 Nov 2021 18:57:18 +0000 (19:57 +0100)] 
mkosi: Install sd-boot using postinst script instead of in build script

This allows us to reuse bootctl install instead of replicating the
logic in the build script.

3 years agonetif-util: introduce net_verify_hardware_address()
Yu Watanabe [Sat, 6 Nov 2021 01:55:21 +0000 (10:55 +0900)] 
netif-util: introduce net_verify_hardware_address()

3 years agoUpdate LINGUAS (#21499)
Hugo Carvalho [Thu, 25 Nov 2021 11:24:00 +0000 (11:24 +0000)] 
Update LINGUAS (#21499)

3 years agorepart,homed: split out disk cleanup macros into generic header
Lennart Poettering [Tue, 28 Sep 2021 21:24:57 +0000 (23:24 +0200)] 
repart,homed: split out disk cleanup macros into generic header

3 years agolist: add LIST_POP() helper that pops the first item off a linked list
Lennart Poettering [Tue, 28 Sep 2021 22:13:12 +0000 (00:13 +0200)] 
list: add LIST_POP() helper that pops the first item off a linked list

3 years agoman: "-j", not "-J" is the shortcut for JSON mode in homectl
Lennart Poettering [Thu, 25 Nov 2021 10:21:55 +0000 (11:21 +0100)] 
man: "-j", not "-J" is the shortcut for JSON mode in homectl

The code and --help text got this right, hence fix the man page

3 years agoMerge pull request #21503 from poettering/ioprio-fix
Yu Watanabe [Thu, 25 Nov 2021 05:23:02 +0000 (14:23 +0900)] 
Merge pull request #21503 from poettering/ioprio-fix

work around linux 5.15 ioprio API breakage

3 years agoMerge pull request #21492 from andch-nn/add-micmute-dell-machine
Yu Watanabe [Thu, 25 Nov 2021 04:52:26 +0000 (13:52 +0900)] 
Merge pull request #21492 from andch-nn/add-micmute-dell-machine

Add micmute for dell machine

3 years agoMerge pull request #21506 from poettering/homed-uidmap-fixes
Yu Watanabe [Thu, 25 Nov 2021 04:37:46 +0000 (13:37 +0900)] 
Merge pull request #21506 from poettering/homed-uidmap-fixes

homed uidmap (and other) fixes

3 years agoMerge pull request #21508 from poettering/conn-count-fix
Yu Watanabe [Thu, 25 Nov 2021 04:33:13 +0000 (13:33 +0900)] 
Merge pull request #21508 from poettering/conn-count-fix

pid1: fix connection counting

3 years agobuild: fix build without seccomp
Dominique Martinet [Wed, 24 Nov 2021 14:04:30 +0000 (23:04 +0900)] 
build: fix build without seccomp

- execute.c: bpf functions were in the middle of an #if HAVE_SECCOMP
  block for no reason
- test-fd-util.c: make seccomp-util.h includable without depending on
  <seccomp.h>, and make is_seccomp_available() hardcoded to returning
  false in this case.
  Also fix a stray DEFINED() -- HAVE_SECCOMP is defined as 0, so normal
  #if should be used like everywhere else.

3 years agobuild(deps): bump github/codeql-action from 1.0.23 to 1.0.24
dependabot[bot] [Wed, 24 Nov 2021 15:17:04 +0000 (15:17 +0000)] 
build(deps): bump github/codeql-action from 1.0.23 to 1.0.24

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1.0.23 to 1.0.24.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/a627e9fa504113bfa8e90a9b429b157a38b1cdbd...e095058bfa09de8070f94e98f5dc059531bc6235)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoman: suggest usage of CollectMode= in Accept=yes services 21508/head
Lennart Poettering [Wed, 24 Nov 2021 23:11:31 +0000 (00:11 +0100)] 
man: suggest usage of CollectMode= in Accept=yes services

3 years agosocket: various modernizations
Lennart Poettering [Wed, 24 Nov 2021 22:53:10 +0000 (23:53 +0100)] 
socket: various modernizations

3 years agosocket: always pass socket, fd and SocketPeer ownership to service together
Lennart Poettering [Wed, 24 Nov 2021 22:50:07 +0000 (23:50 +0100)] 
socket: always pass socket, fd and SocketPeer ownership to service together

Per-connection socket instances we currently maintain three fields
related to the socket: a reference to the Socket unit, the connection fd,
and a reference to the SocketPeer object that counts socket peers.

Let's synchronize their lifetime, i.e. always set them all three
together or unset them together, so that their reference counters stay
synchronous.

THis will in particuar ensure that we'll drop the SocketPeer reference
whenever we leave an active state of the service unit, i.e. at the same
time we close the fd for it.

Fixes: #20685
3 years agojournal: Don't allow creating invalid objects
Daan De Meyer [Thu, 11 Nov 2021 13:31:31 +0000 (13:31 +0000)] 
journal: Don't allow creating invalid objects

Let's not allow creating empty entry or data objects. Let's also
not allow creating data objects from data without an embedded '='
character.

3 years agoMerge pull request #21502 from keszybz/os-release-debugging
Lennart Poettering [Wed, 24 Nov 2021 21:00:02 +0000 (22:00 +0100)] 
Merge pull request #21502 from keszybz/os-release-debugging

Additional debugging info to make release-extension easier to introspect

3 years agounit_is_bound_by_inactive: fix return pointer check
Dominique Martinet [Wed, 24 Nov 2021 13:27:22 +0000 (22:27 +0900)] 
unit_is_bound_by_inactive: fix return pointer check

*ret_culprit should be set if ret_culprit has been passed a non-null value,
checking the previous *ret_culprit value does not make sense.

This would cause the culprit to not properly be assigned, leading to
pid1 crash when a unit could not be stopped.

Fixes: #21476
3 years agohomework: add debug log message whenever we applied a uidmap to a mount 21506/head
Lennart Poettering [Wed, 24 Nov 2021 17:40:36 +0000 (18:40 +0100)] 
homework: add debug log message whenever we applied a uidmap to a mount

3 years agohomework: fix a bad error propagation
Lennart Poettering [Wed, 24 Nov 2021 17:36:00 +0000 (18:36 +0100)] 
homework: fix a bad error propagation

3 years agohomework: also apply uid shifting when changing passwords/resizing/updating home...
Lennart Poettering [Wed, 24 Nov 2021 17:34:02 +0000 (18:34 +0100)] 
homework: also apply uid shifting when changing passwords/resizing/updating home areas

This adds uidmap shifting also when resizing/updating/changing
passwords. Prviously I thought we didn't have to, because the user is
not going to access the uidmap if we only quickly activate the home
area. But this thinking is wrong, because the three operations will
result in an update ~/.identity fie to be written, and we should do that
with uidmap applied, so that its ownership maps down to nobody below as
intended.

Fixes: #21441
3 years agohomework: don't try to shift uidmap for already activated home areas
Lennart Poettering [Wed, 24 Nov 2021 17:31:51 +0000 (18:31 +0100)] 
homework: don't try to shift uidmap for already activated home areas

When we want to operate on an already activated home area we so far
tried to reapply the uidmapping logic. We shouldn't do that, it's
already applied after all.

We only want to apply this for newly activated home areas. Hence check
for the right HomeSetupFlags flag for it HOME_SETUP_ALREADY_ACTIVATED.

The patch is actually in theory a two-liner. Except that so far we don#t
pass the HomeSetupFlags flags down all necessary functions where the
uidmap stuff will eventually run. Hence this larger than intended
commit.

3 years agohomework: fix message typo
Lennart Poettering [Wed, 24 Nov 2021 17:29:52 +0000 (18:29 +0100)] 
homework: fix message typo

3 years agohomectl: also acquire "cheap" passwords for homectl update/passwd
Lennart Poettering [Wed, 24 Nov 2021 17:26:28 +0000 (18:26 +0100)] 
homectl: also acquire "cheap" passwords for homectl update/passwd

In 57bb9bcba5563c040ee0c41f58e3730a006a8de2 support was added to read
"cheap" passwords from env vars and stuff before issuing the first
operation, instead of waiting for it until the first operation failed.

This was added for most verbs of "homectl", but two were left out:
update + passwd. Add it there too.

3 years agodissect-image: always say "file of image" when reporting about the image 21502/head
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 14:40:53 +0000 (15:40 +0100)] 
dissect-image: always say "file of image" when reporting about the image

We give a path, but the path is only meaningful inside of the image.
Some messages made it clear that it's a path in the image, let's make
them all do that.

3 years agoAdd debug logs of extension-release scanning
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 14:06:48 +0000 (15:06 +0100)] 
Add debug logs of extension-release scanning

3 years agodissect-image: provide a more useful message when ENOMEDIUM is returned
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 12:06:37 +0000 (13:06 +0100)] 
dissect-image: provide a more useful message when ENOMEDIUM is returned

3 years agodissect-image: do not enable "verification" when trying to acquire metadata
Zbigniew Jędrzejewski-Szmek [Wed, 24 Nov 2021 12:03:25 +0000 (13:03 +0100)] 
dissect-image: do not enable "verification" when trying to acquire metadata

The whole point of acquiring metadata is quite often to figure out why the
image does not pass verification. Refusing to provide metadata is just being
hostile to the user.

When called from other places (e.g. image_read_metadata()), verification is
still performed.

3 years agotest: make test-execute pass on Linux 5.15 21503/head
Lennart Poettering [Wed, 24 Nov 2021 14:58:50 +0000 (15:58 +0100)] 
test: make test-execute pass on Linux 5.15

Linux 5.15 broke kernel API:

https://github.com/torvalds/linux/commit/e70344c05995a190a56bbd1a23dc2218bcc8c924

Previously setting IOPRIO_CLASS_NONE for a process would then report
IOPRIO_CLASS_NONE back. But since 5.15 it reports IOPRIO_CLASS_BE
instead. Since IOPRIO_CLASS_NONE is an alias for a special setting of
IOPRIO_CLASS_BE this makes some sense, but it's also a kernel API
breakage that our testsuite trips up on.

(I made some minimal effort to inform the kernel people about this API
breakage during the 5.15 rc phase, but noone was interested.)

Either way let's hadle this gracefully in our test suite and accept
"best-effort" too when "none" was set.

(This is only triggable if the tests are run on 5.15 with full privs)