Commit Graph
4412 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 03f7ddf0bf meson: stop building out convenience libraries by default
The meson default for static_library() are:
build_by_default=true, install=false. We never interact with the
static libraries, and we only care about them as a stepping-stone towards
the installable executables or libraries. Thus let's only build them if
they are a dependency of something else we are building.

While at it, let's drop install:false, since this appears to be the default.

This change would have fixed the issue with lib_import_common failing
to build too: we wouldn't attempt to build it.

In practice this changes very little, because we generally only declare static
libraries where there's something in the default target that will make use of
them. But it seems to be a better pattern to set build_by_default to false.
2021-12-16 11:01:08 +01:00
Zbigniew Jędrzejewski-Szmek af3b864d76 Define FOREACH_DIRENT through FOREACH_DIRENT_ALL
As in the previous commit, 'de' is used as the iterator variable name.
2021-12-15 22:50:00 +01:00
Zbigniew Jędrzejewski-Szmek c7f0d9e5ac tree-wide: make FOREACH_DIRENT_ALL define the iterator variable
The variable is not useful outside of the loop (it'll always be null
after the loop is finished), so we can declare it inline in the loop.
This saves one variable declaration and reduces the chances that somebody
tries to use the variable outside of the loop.

For consistency, 'de' is used everywhere for the var name.
2021-12-15 16:19:13 +01:00
наб f1e6f93372 Change all fixed-path bash shebangs to /u/b/env bash outside test/ 2021-12-12 21:13:50 +01:00
Yu Watanabe 6b35ed80ed build: include BPF_FRAMEWORK tag in version string 2021-12-10 19:54:33 +09:00
Daan De Meyer 1f013e0c49 process-util: Fix memory leak 2021-12-09 18:13:04 +01:00
Zbigniew Jędrzejewski-Szmek f66d548c1a Merge pull request #21598 from DaanDeMeyer/journald-file
journal: Fix re-enabling COW for archived journal files on BTRFS
2021-12-07 07:35:34 +01:00
Daan De Meyer 5a980196ab basic: Make sure we're extra paranoid in chattr_full
On btrfs, trying to disable FS_NOCOW_FL on a file that has data
already written will fail silently without reporting an error. To
catch such cases, let's query the flags again if the IOC_SETFLAGS
ioctl() succeeds to make sure the flags we tried to configure we're
actually accepted by the kernel.
2021-12-06 22:17:40 +01:00
Yu Watanabe aa9de5b1c0 process-util: handle double NUL as the end of command line
Fixes #21186.
2021-12-06 23:42:25 +09:00
Yu Watanabe 95a511b704 process-util: rename function arguments for storing results 2021-12-06 23:21:08 +09:00
Zbigniew Jędrzejewski-Szmek 939387bdc6 Merge pull request #21170 from keszybz/delibgcryptify
Allow systemd-resolved and systemd-importd to use libgcrypt or libopenssl
2021-12-03 13:44:53 +01:00
Zbigniew Jędrzejewski-Szmek e30ebc349c Merge pull request #21599 from loongarch64/dev-syscalls
Add LoongArch 64bit syscalls
2021-12-03 08:11:31 +01:00
Yu Watanabe 4c9bb70854 parse-util: refuse leading white space in port number
When parse_ip_port() is directly used in a conf parser, then that's
fine, as the rvalue is already truncated.

When parse_ip_port() is used when e.g. parsing IP address with port,
then we should really refuse white space after colon.
2021-12-02 08:36:22 +09:00
Xiaotian Wu 9fd3bf7733 syscalls: run ninja update-syscall-tables 2021-12-01 23:53:17 +08:00
Xiaotian Wu 89f60c217c syscalls: add LoongArch 64bit syscalls 2021-12-01 23:48:30 +08:00
Zbigniew Jędrzejewski-Szmek 7e8facb36b port string_hashsum from libgcrypt to openssl^gcrypt
This allows resolved and importd to be built without libgcrypt.

Note that we now say either 'cryptographic library' or 'cryptolib'.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2021-12-01 12:36:57 +01:00
Yu Watanabe 361bf5fb77 Merge pull request #21564 from yuwata/errno-eagain-eintr
tree-wide: introduce ERRNO_IS_TRANSIENT() and use it
2021-12-01 12:52:27 +09:00
Wu Xiaotian 5c0968a2d1 architecture: Add support for the LoongArch architecture 2021-11-30 23:34:20 +08:00
Yu Watanabe 8add30a03c tree-wide: use ERRNO_IS_TRANSIENT() 2021-11-30 23:06:43 +09:00
Yu Watanabe 7aad83580f errno-util: introduce ERRNO_IS_TRANSIENT() 2021-11-30 23:06:43 +09:00
Zbigniew Jędrzejewski-Szmek 5143e657d2 basic/architecture: sort and reindent one more table
No idea why I didn't do this one in the previous round.
2021-11-30 13:54:29 +01:00
Yu Watanabe a6f44d610c tree-wide: fix typo 2021-11-30 12:30:07 +00:00
Zbigniew Jędrzejewski-Szmek 08e70b4a21 Merge pull request #21541 from bluca/analyze_security_profile
analyze: add --profile switch to security verb
2021-11-29 21:23:34 +01:00
Zbigniew Jędrzejewski-Szmek 4b658ff651 Merge pull request #21531 from keszybz/log2-tables
Optimize log2 tables
2021-11-29 13:58:49 +01:00
Zbigniew Jędrzejewski-Szmek f4ada1b42f basic/util: add macro variants of log2 functions
The macro variants can be used in static initializers.

The same guard against calling __builtin_clz(0) is added as for
__builtin_clzll(0), since that's undefined behaviour too. Our code
wouldn't call it, but this avoids a potential pitfall with the macro.
All variants map 0→0. Otherwise we'd often have to handle 0 specially
in callers.

__builtin_clz takes unsigned as the argument, so there's no LOG2I macro.
2021-11-29 11:12:52 +01:00
Luca Boccassi 13c02e7bd5 portable: move profile search helper to path-lookup
Will be used in systemd-analyze later
2021-11-26 17:50:59 +00:00
Zbigniew Jędrzejewski-Szmek 58c34be864 basic/util: rename u64log2 to log2u64
u64log2 was strangely named. We even have log2i and log2u right below
in that file.
2021-11-26 15:29:06 +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
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
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 f9930401d5 in-addr-util: introduce FAMILY_ADDRESS_SIZE_SAFE() macro 2021-11-25 22:34:29 +09:00
Lennart Poettering 55cb63bf6e list: add LIST_POP() helper that pops the first item off a linked list 2021-11-25 12:10:03 +01:00
Yu Watanabe c8e16339f1 Merge pull request #21503 from poettering/ioprio-fix
work around linux 5.15 ioprio API breakage
2021-11-25 14:23:02 +09:00
Zbigniew Jędrzejewski-Szmek ed15f8bceb Add debug logs of extension-release scanning 2021-11-24 17:43:01 +01:00
Lennart Poettering ba7772fee4 ioprio: normalize io priority values in configuration
Let's always say IOPRIO_CLASS_BE when IOPRIO_CALSS_NONE is set.
2021-11-24 16:12:15 +01:00
Lennart Poettering 0692548c73 ioprio-util: add macro for default ioprio settings
IOPRIO_CLASS_NONE with any priority value actually is an alias for
IOPRIO_CLASS_BE with priority value 4 – which is the default ioprio for
all processes.

We got this right at one place, but wrong at three others (where we
assumed the default value was 0, not 4). Let's add a
macro that encodes this properly, and use it everywhere.
2021-11-24 16:12:15 +01:00
Lennart Poettering 032b3afbf4 shared: split out ioprio related stuff into ioprio-util.[ch]
No actual code changes, just some splitting out.
2021-11-24 16:12:15 +01:00
Daan De Meyer 3c58ae1313 basic: Rename SECONDARY_ARCHITECTURE to ARCHITECTURE_SECONDARY
For easier integration with the _GPT_ALL_ARCHES macro in a future
commit.
2021-11-24 12:00:41 +01:00
Daan De Meyer b998ff21e1 basic: Give architecure enum a name 2021-11-24 12:00:41 +01:00
Zbigniew Jędrzejewski-Szmek 91ee7c5ebd basic/architectures: sort by name and remove duplicates
C.f. 086df29f35.
2021-11-24 10:05:28 +01:00
Lennart Poettering aa3cc58a9f recurse-dir: give callers of recurse_dir_at() control over path prefix
One of the niceties of recurse_dir()/recurse_dir_at() is that the path
argument is decoration, it's not used for actually accessing the fs in
anyway. That's very handy in environments where chroots and relative
paths are used, as we can path in any path we like and the recursion
function will suffix with whatever it discovers but will not try to make
sense of the prefix you pass.

This works great, except that the recurse_dir_at() wrapper broke that:
it adjusted the path if NULL to "." simply for the sake of making
openat() on the top work. Let's make this adjustment more local and do
it only for the openat() itself, and otherwise pass the path through the
way we got it. This means: if a caller really wants the paths that are
concatenated to start with a "." it can just pass that. This way the
caller gets full control back of the path prefix. Win!

Note that all current users of recurse_dir_at() don't pass NULL as
second arg, hence this check is without any real effect for now. It's
preparation for future uses however.
2021-11-24 09:34:10 +01:00
Lennart Poettering ed90de9fbc process-util: add missing NULL initialization for _cleanup_ variable
This is will otherwise trigger a bad memory access in the error path
2021-11-23 18:42:22 +01:00
Boqun Feng 76eec06499 virt: Fix the detection for Hyper-V VMs
Use product_version instead of product_name in DMI table and the string
"Hyper-V" to avoid misdetection.

Fixes: #21468

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
2021-11-23 13:23:33 +01:00
Lennart Poettering c1b91f06b9 socket-util: add helper for generically initializing sockaddr_union from in_addr_union 2021-11-22 22:18:34 +01:00
Zbigniew Jędrzejewski-Szmek ba9ddcb8d6 Trivial style fixes 2021-11-19 18:49:46 +01:00
Zbigniew Jędrzejewski-Szmek 086df29f35 shared/gpt: reorder arches alphabetically
It's just too annoying to add new ones otherwise.
2021-11-19 16:52:38 +01:00
Lennart Poettering f85b12d6fd strv: make sure FOREACH_STRING() can be nested 2021-11-19 11:23:36 +01:00
Daan De Meyer 9c41618008 journal: Don't discard kmsg messages coming from journald itself
Previously, we discarded any kmsg messages coming from journald
itself to avoid infinite loops where potentially the processing
of a kmsg message causes journald to log one or more messages to
kmsg which then get read again by the kmsg handler, ...

However, if we completely disable logging whenever we're processing
a kmsg message coming from journald itself, we also prevent any
infinite loops as we can be sure that journald won't accidentally
generate logging messages while processing a kmsg log message.

This change allows us to store all journald logs generated during
the processing of log messages from other services in the system
journal. Previously these could only be found in kmsg which has
low retention, can't be queried using journalctl and whose logs
don't survive reboots.
2021-11-18 19:37:17 +00:00
Lennart Poettering c73094f3ac fs-util: add new helper open_mkdir_at() 2021-11-17 21:48:18 +01:00