1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00
Commit Graph

54753 Commits

Author SHA1 Message Date
Yu Watanabe
5b8bdd20c6 network/netdev: generate persistent MAC address for batadv and bridge
This mostly reverts 489f01f806 and
deb2cfa4c6.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.
2021-11-28 12:04:55 +09:00
Yu Watanabe
aaa5ca57ae network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address
This is mostly equivalent to .link file's MACAddressPolicy=none.
2021-11-28 12:04:55 +09:00
Yu Watanabe
5dcc5b1a11 network/netdev: move config_parse_netdev_kind() at the end 2021-11-28 12:04:55 +09:00
Topi Miettinen
788e720181 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.
2021-11-27 17:36:51 +00:00
Luca Boccassi
cab35e9672
Merge pull request #21535 from yuwata/network-netdev-verify-mac
network/netdev: verify MAC address
2021-11-27 13:48:56 +00:00
Yu Watanabe
70b0652697 network: route: route->link may be NULL
Fixes #21544.
2021-11-27 13:48:02 +00:00
Alyssa Ross
f000edf9ea 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.
2021-11-27 13:46:35 +00:00
Yu Watanabe
f5caacec1c
Merge pull request #21533 from yuwata/network-trivial-follow-ups
network: trivial follow-ups
2021-11-27 06:42:19 +09:00
Yu Watanabe
e76d491c87
Merge pull request #21530 from keszybz/strv-cleanup
Modernize style and drop strv_free_free
2021-11-27 06:41:56 +09:00
Yu Watanabe
007899f43e 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.
2021-11-27 06:39:04 +09:00
Yu Watanabe
5e20e1e3e3 network/netdev: use "struct hw_addr_data" to store MAC address 2021-11-27 06:39:04 +09:00
Yu Watanabe
9f0cf80dd0 network/netdev: introduce .iftype to netdev vtable
And disable .generate_mac flag for non-ether interfaces.
2021-11-27 06:38:26 +09:00
Yu Watanabe
a67e0507c3 network: veth: use SYNTHETIC_ERRNO() macro or use real error cause 2021-11-27 06:37:58 +09:00
Frantisek Sumsal
72f9e485ce 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 f201f34477.
2021-11-26 18:15:51 +00:00
Lennart Poettering
e6f48be8d4 update TODO 2021-11-26 15:18:59 +01:00
Zbigniew Jędrzejewski-Szmek
1ba193d73e 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 143fadf369 (2018),
let's just drop it.
2021-11-26 14:58:44 +01:00
Zbigniew Jędrzejewski-Szmek
14337c374a basic/strv: inline variables and modernize style a bit 2021-11-26 14:52:03 +01:00
Lennart Poettering
f08e143c01 update TODO 2021-11-26 14:49:25 +01:00
Lennart Poettering
195d181ca4 NEWS: start with an entry for v250 2021-11-26 14:49:25 +01:00
Yu Watanabe
36edc2c956 network: update comment
Addresses https://github.com/systemd/systemd/pull/21517#discussion_r757096584.
2021-11-26 21:05:52 +09:00
Yu Watanabe
4bd2c4e8e0 netif-util: update log message
Follow-up for 37593b7c48.
2021-11-26 21:05:52 +09:00
Zbigniew Jędrzejewski-Szmek
baef2ca347
Merge pull request #21529 from keszybz/test-journal-flush-no-crash
Fix crash in test-journal-flush in CI
2021-11-26 12:28:44 +01:00
Anita Zhang
ddc57d0a83 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
2021-11-26 12:27:30 +01:00
Zbigniew Jędrzejewski-Szmek
993eeea0ef
Merge pull request #21501 from medhefgo/test
test: Use TEST macro
2021-11-26 12:23:18 +01:00
Zbigniew Jędrzejewski-Szmek
66a8eddd6d
Merge pull request #21360 from yuwata/network-json
network: json: add more information
2021-11-26 11:04:52 +01:00
Zbigniew Jędrzejewski-Szmek
b4046d5557 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.
2021-11-26 09:48:15 +01:00
Zbigniew Jędrzejewski-Szmek
0fa167cd58 test-journal-flush: allow testing against specific files
>=0 → ==0 because sd_journal_open* are documented to return 0.
2021-11-26 09:48:15 +01:00
Vito Caputo
7580b0d869 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.
2021-11-26 08:35:58 +09:00
Daan De Meyer
5ec9fbae64 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.
2021-11-25 23:38:09 +01:00
Luca Boccassi
485c9e19e7
Merge pull request #21253 from poettering/homed-auto-grow-shrink
homed: automatic grow/shrink of LUKS home dirs
2021-11-25 22:14:17 +00:00
Vito Caputo
b82aca89a5 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...
2021-11-25 21:39:38 +01:00
Zbigniew Jędrzejewski-Szmek
f1da1e7b5f
Merge pull request #21522 from yuwata/home-fix-memleak
home: fix memleak
2021-11-25 20:22:23 +01:00
Zbigniew Jędrzejewski-Szmek
55a044dece
Merge pull request #21517 from yuwata/network-long-hw-addr
network: make MACAddress= can take longer address
2021-11-25 20:21:38 +01:00
Yu Watanabe
5213507113 network,udev: make .network and .link file can match with hardware address longer or shorter than ETH_ALEN 2021-11-25 20:14:46 +01:00
Henri Chain
81e1590e2d 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
2021-11-25 20:12:59 +01:00
Daan De Meyer
b41b682bd6 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.
2021-11-25 20:02:32 +01:00
Lennart Poettering
6d975fe7b3 update TODO 2021-11-25 18:28:44 +01:00
Lennart Poettering
c313d04ab0 test: add test case for homed rebalancing logic 2021-11-25 18:28:44 +01:00
Lennart Poettering
6d6d4459ab homectl: add new "homectl rebalance" command
Let's add an explicit, synchronous command to request immediate rebalancing and
wait for it.
2021-11-25 18:28:44 +01:00
Lennart Poettering
4950591627 homed: add explicit API for requesting rebalancing too 2021-11-25 18:28:44 +01:00
Lennart Poettering
d357b80d33 homed: add automatic grow/shrink ("rebalancing") 2021-11-25 18:28:44 +01:00
Lennart Poettering
21505c937c homectl: expose new rebalanceWeight JSON use record field 2021-11-25 18:28:44 +01:00
Lennart Poettering
9aa3e5ebdf user-record: add rebalanceWeight field 2021-11-25 18:28:44 +01:00
Lennart Poettering
993b905772 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.
2021-11-25 18:19:02 +01:00
Lennart Poettering
c42234abf2 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.
2021-11-25 18:18:42 +01:00
Lennart Poettering
7ff048a718
Merge pull request #21487 from DaanDeMeyer/dissect-image-other-arch
Allow dissect_image() to dissect images from architectures other than the native one
2021-11-25 17:36:57 +01:00
Yu Watanabe
5601a9b910 homework: fix memleak
Fixes #21521.
2021-11-26 00:14:32 +09:00
Yu Watanabe
47398ea705 homework: drop unnecessary initialization 2021-11-26 00:09:30 +09:00
Jan Janssen
c462e63eea 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
2021-11-25 15:03:10 +01:00
Jan Janssen
4f7452a8eb 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
2021-11-25 15:03:06 +01:00