Commit Graph
34349 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek d8d0da1f19 test-stat-util: add a very basic test for test_path_is_read_only() 2021-06-10 13:45:55 +02:00
Zbigniew Jędrzejewski-Szmek b845894c80 test-stat-util: add standard test logging 2021-06-10 13:45:55 +02:00
Lennart Poettering 871f35af85 cryptsetup: improve error message when key files to load are too large
Let's make this easier to grok for users.

Prompted-by: #19193
2021-06-10 10:55:02 +02:00
Lennart Poettering f6dd48fae8 fileio: bump limit for read_full_file() and friends to 64M
Apparently people use such large key files. Specifically, people used 4M
key files, and we lowered the limit from 4M to 4M-1 back in 248.

This raises the limit to 64M for read_full_file() to avoid these
specific issues and give some non-trivial room beyond the 4M files seen
IRL.

Note that that a 64M allocation in glibc is always immediately done via
mmap(), and is thus a lot slower than shorter allocations. This means
read_virtual_file() becomes ridiculously slow if we'd use the large
limit, since we use it all the time for reading /proc and /sys metadata,
and read_virtual_file() typically allocates the full size with malloc()
in advance.  In fact it becomes so slow, that test-process-util kept
timing out on me all the time, once I blindly raised the limit.

This patch hence introduces two distinct limits for read_full_file() and
read_virtual_file(): the former is much larger than the latter and the
latter remains where it is. This is safe since the former uses an
exponentially growing realloc() loop while the latter uses the
aforementioend ahead-of-time full limit allocation.

Fixes: #19193
2021-06-10 10:51:00 +02:00
Zbigniew Jędrzejewski-Szmek ad5fdd3912 shared/install: ignore enablement of template units w/o instance when presetting
When we have a unit which cannot be enabled:
 # foo@.service:
 ...
 [Install]
 WantedBy=foo.target  # there is no instance, so we don't know what to enable

we should throw an error when invoked directly with 'enable', but
not when doing 'preset' or 'preset-all'.

Fixes #19856.
2021-06-10 10:02:38 +02:00
Zbigniew Jędrzejewski-Szmek 9b69770a49 shared/install: pass UnitFileFlags down into the call chain
This just propagates the parameter down into leaf functions,
without any functional change.
2021-06-10 10:00:36 +02:00
Lennart Poettering 527653f827 Merge pull request #19857 from yuwata/tmpfile-fix
tmpfiles: fix an issue found by Coverity
2021-06-10 09:30:57 +02:00
Lennart Poettering bb25f236d4 Merge pull request #19863 from keszybz/coverity-drop-unitialized-workarounds
Drop some -Wmaybe-unitialized workarounds to help coverity
2021-06-10 09:29:59 +02:00
Lennart Poettering 0629adf7c3 Merge pull request #19867 from yuwata/ether-addr-util
ether-addr-util: introduce hw_addr_equal() and friends
2021-06-10 09:29:36 +02:00
Zbigniew Jędrzejewski-Szmek 8331b221ba core/dbus: rename internal variable for clarity 2021-06-10 07:32:38 +02:00
nerdopolis 3c3335c714 Clarify help information for --global 2021-06-10 07:23:05 +02:00
Lennart Poettering 81107b8419 sd-event: change ordering of pending/ratelimited events
Instead of ordering non-pending before pending we should order
"non-pending OR ratelimited" before "pending AND not-ratelimited".
This fixes a bug where ratelimited events were ordered at the end of the
priority queue and could be stuck there for an indeterminate amount of
time.
2021-06-09 21:02:22 -07:00
Yu Watanabe c68cafbabe tmpfile: always get file descriptor of root or current directory
Fixes CID#1457467.
2021-06-10 05:42:03 +09:00
Zbigniew Jędrzejewski-Szmek 998571a7f4 Merge pull request #19871 from yuwata/man-network-missing-settings
man: add missing settings
2021-06-09 22:15:38 +02:00
Zbigniew Jędrzejewski-Szmek 67e9c83bad cryptsetup: remove unitialized workaround
Doesn't seem needed anymore.
2021-06-09 22:01:13 +02:00
Zbigniew Jędrzejewski-Szmek 21996f81b2 test-capability: drop work-around initialization
Since those workarounds have been added, work has been done to tighten
up log_*() return values. Seems we get no warning with
gcc-11.1.1-1.fc34.x86_64 and -O0/-O2.
2021-06-09 22:01:13 +02:00
Zbigniew Jędrzejewski-Szmek 59ca71a93d networkd: drop one workaround initialization
As for the other ones in src/network/, if they are removed, gcc warns when they
are removed.

Should fix Coverity CID#1457466.
2021-06-09 22:00:28 +02:00
Lennart Poettering 2f88100557 Merge pull request #19861 from poettering/hwdb-249
hwdb + syscall database updates for 249
2021-06-09 21:54:42 +02:00
Yu Watanabe b9a4bc7070 network: sort settings about netdev 2021-06-10 04:46:44 +09:00
Zbigniew Jędrzejewski-Szmek e1f2f7f194 shared/install: improve message about template mismatch
$ systemctl enable --root=/ serial-getty@.service
Failed to enable unit, unit getty.target is a non-template unit.
↓
Failed to enable serial-getty@.service, destination unit getty.target is a non-template unit.
2021-06-09 21:39:33 +02:00
Zbigniew Jędrzejewski-Szmek 4a203a5177 shared/install: remove custom error handling in unit_file_preset_all()
This had some purpose back in the day, but right now I cannot see what
difference this makes. It's hard to keep the list of all possible errors up to
date. So let's remove this, hopefully nothing breaks.
2021-06-09 21:39:33 +02:00
Zbigniew Jędrzejewski-Szmek 3aa96361ed shared/install: ignore failures for auxiliary files
If Also= fails, warn, but otherwise ignore the failure.

Fixes #19407.
2021-06-09 21:39:15 +02:00
Yu Watanabe 4b574fd813 ether-addr-util, network: introduce ETHER_ADDR_TO_STR() macro and use it 2021-06-10 00:37:50 +09:00
Yu Watanabe f929f18c59 network: use hw_addr_equal() or friends 2021-06-10 00:29:59 +09:00
Yu Watanabe 30b977251c ether-addr-util: introduce hw_addr_compare(), hw_addr_equal(), and hw_addr_is_null() 2021-06-10 00:24:43 +09:00
Yu Watanabe ca2b7cd813 ether-addr-util: drop redundant "addr" from struct hw_addr_data
Also, this makes always specifiy "struct" for hw_addr_data.
2021-06-10 00:19:50 +09:00
Lennart Poettering 91d0750dbf Merge pull request #19854 from poettering/journal-enum-uniq-fix
fix journalctl -F
2021-06-09 15:37:01 +02:00
Lennart Poettering 34254e599a seccomp: add some recently added syscalls to filter groups 2021-06-09 15:36:19 +02:00
Zbigniew Jędrzejewski-Szmek fe50aae5e1 core/serialization: call exec_runtime_deserialize_compat() independently of whether .serialize is defined
There is no reason to tie the two together: in principle we may have
in the future a unit type which does not define .serialize/.deserialize_item,
but we would still want to call the compat deserialization code for it.
2021-06-09 12:54:27 +02:00
Zbigniew Jędrzejewski-Szmek 6923020ec1 networkd: reorder conditional to handle errors first
This also avoid the implicit assumption that if r is not -ENOENT, 0, or 1,
it must be negative. The compiler cannot know this.
2021-06-09 12:48:52 +02:00
Lennart Poettering 5156e6804d syscalls: run ninja update-syscall-* 2021-06-09 11:40:14 +02:00
Lennart Poettering bead169fe0 Merge pull request #19851 from poettering/bpf-firewall-tweaks
close bpf firewall reload gap
2021-06-09 09:47:23 +02:00
Lennart Poettering 2e1a8a5dab journal: don't try to reuse already calculated hash between files with keyed hash feature
When suppressing duplicate fields between files we so far tried to reuse
the already known hash value of the data fields between files. This was
fine as long as we used the same hash function everywhere. However,
since addition of the keyed hash feature for journal files this doesn't
work anymore, since the hashes will be different for different files.

Fixes: #19172
2021-06-09 09:34:55 +02:00
Lennart Poettering 8d5a1082b0 journal: remove an unnecessary 'else' 2021-06-09 09:34:55 +02:00
Lennart Poettering 0e0b05294b journal: make return parameters for sd_journal_enumerate_unique() optional 2021-06-09 09:34:50 +02:00
Lennart Poettering f4cb1bfd57 journal: as per coding style don't clobber return parameters in sd_journal_get_cutoff_monotonic_usec() on failure 2021-06-09 09:34:50 +02:00
Lennart Poettering 900952ecd5 journal: use free_and_strdup() where appropriate 2021-06-09 09:34:50 +02:00
Lennart Poettering d8671b1c6f journal: add some careful overflow checking 2021-06-09 09:34:50 +02:00
Yu Watanabe 21e43a7c51 tmpfile: several minor coding style fixes
This makes the followings:
- reduces scope of variables,
- drop unnecessary 'else'
- use CLOSE_AND_REPLACE() macro
- use strnull() for possible NULL string
2021-06-09 13:30:19 +09:00
Yu Watanabe 045d7232b5 Merge pull request #19852 from yuwata/network-stable-secret
network: introduce IPv6StableSecretAddress= to configure secret key for generating IPv6LL address
2021-06-09 12:30:57 +09:00
Lennart Poettering e68778a3ac journald: when journald namespace instances log, they can do so safely to the main journald instance
Fixes: #18951
2021-06-09 12:30:22 +09:00
Lennart Poettering dbef3d163b bpf-firewall: close gap when updating the firewall
If we have BPF_F_ALLOW_MULTI support we can install the new program
before we drop the old (because we can install two program at the same
time). Let's do that, and thus fully close the firewall
gap.
2021-06-08 22:02:35 +02:00
Lennart Poettering a947ebb515 bpf-program: document BPFProgram a bit 2021-06-08 22:02:35 +02:00
Lennart Poettering b57d752326 bpf-program: serialize attached BPF programs across daemon reexec/reload
Alternative to #17495
2021-06-08 22:02:35 +02:00
Lennart Poettering 7a7cf83dc3 bpf-program: export hash_ops for BPFProgam objects 2021-06-08 22:02:35 +02:00
Lennart Poettering 06ad9d0c12 bpf-program: use structured initialization when allocating BPFProgram objects 2021-06-08 22:02:35 +02:00
Lennart Poettering d63a3d350f bpf-link: prefix function names with "bpf_"
we generally do this for all bpf functions, do so here too.
2021-06-08 22:02:35 +02:00
Lennart Poettering cd09a5f3c1 core: rename socket-bind.[ch] → bpf-socket-bind.[ch]
The other BPF infra has a file name prefix of "bpf-" hence do so here
too.
2021-06-08 22:02:32 +02:00
Yu Watanabe baa95d2274 network: do not process requests which conditionalized with link flags while the flags are updating
E.g. nexthop requires IFF_UP flag, but the currently stored flag may be
outdated if we called link_down(). This makes such requests pending if
at least one of the flags are updating.
2021-06-09 04:59:23 +09:00
Yu Watanabe 2a057a7340 network: make several link settings critical 2021-06-09 04:59:23 +09:00