Optimize dlopen ELF notes via anchoring and explicitly embed them into executables (#42908)
This PR optimizes the handling of `dlopen` ELF notes and reduces binary footprints across the tree. By enabling compiler section-splitting (`-ffunction-sections`/`-fdata-sections`), the linker can now accurately garbage-collect unused code and data. To align with this, `SD_ELF_NOTE_DLOPEN_ANCHORED()` macro is introduced, which ties `dlopen` notes to their calling functions so that unused notes are automatically removed by `--gc-sections`. Additionally, this explicitly embeds required `dlopen` notes into individual executables to fix a visibility issue where package managers missed runtime dependencies invoked indirectly through `libsystemd-shared.so`.
This commit is contained in:
@@ -132,6 +132,12 @@ for phase in "${PHASES[@]}"; do
|
||||
ninja -C build -v
|
||||
# Ensure setting a timezone (like the reproducible build tests do) does not break time/date unit tests
|
||||
TZ=GMT+12 meson test "${MESON_TEST_ARGS[@]}" -C build --print-errorlogs --no-stdsplit --quiet
|
||||
|
||||
# Linker garbage collection for unused symbols appears to be broken on ppc64le (both GCC and CLANG) or s390x (GCC).
|
||||
# Skip the dlopen note verification test in those specific configurations.
|
||||
if ! [[ "$(uname -m)" == "ppc64le" || ( "$(uname -m)" == "s390x" && "$phase" == "RUN_GCC" ) ]]; then
|
||||
meson test -C build --suite=dlopen --print-errorlogs --no-stdsplit --quiet
|
||||
fi
|
||||
;;
|
||||
RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN_NO_DEPS)
|
||||
# TODO: drop after we switch to ubuntu 26.04
|
||||
|
||||
@@ -99,3 +99,6 @@ jobs:
|
||||
|
||||
- name: Test
|
||||
run: mkosi box -- meson test -C build --print-errorlogs --no-stdsplit --quiet
|
||||
|
||||
- name: Test (dlopen)
|
||||
run: mkosi box -- meson test -C build --print-errorlogs --no-stdsplit --quiet --suite=dlopen
|
||||
|
||||
@@ -256,9 +256,10 @@ REQUIREMENTS:
|
||||
ninja
|
||||
gcc >= 8.4
|
||||
>= 13.1.0 is required to build BPF program by using GCC
|
||||
binutils >= 2.35
|
||||
awk, sed, grep, and similar tools
|
||||
clang >= 10.0, llvm >= 10.0 (optional, required to build BPF programs
|
||||
from source code in C)
|
||||
clang,llvm >= 10 (optional, required to build BPF programs)
|
||||
>= 13 (optional, required to build the entire project)
|
||||
|
||||
During runtime, you need the following additional
|
||||
dependencies:
|
||||
|
||||
+149
-27
@@ -15,7 +15,7 @@ project('systemd', 'c',
|
||||
|
||||
add_test_setup(
|
||||
'default',
|
||||
exclude_suites : ['clang-tidy', 'coccinelle', 'unused-symbols', 'integration-tests'],
|
||||
exclude_suites : ['clang-tidy', 'coccinelle', 'dlopen', 'unused-symbols', 'integration-tests'],
|
||||
exe_wrapper : find_program('tools/test-crash-trace.sh'),
|
||||
is_default : true,
|
||||
)
|
||||
@@ -431,7 +431,9 @@ possible_common_cc_flags = [
|
||||
'-Wno-string-plus-int', # clang
|
||||
|
||||
'-fdiagnostics-show-option',
|
||||
'-fdata-sections',
|
||||
'-fexcess-precision=standard',
|
||||
'-ffunction-sections',
|
||||
'-fno-common',
|
||||
'-fstack-protector',
|
||||
'-fstack-protector-strong',
|
||||
@@ -1414,11 +1416,11 @@ endif
|
||||
# In the dlopen ELF note we save the default compression library with a
|
||||
# higher priority, so that packages can give it priority over the
|
||||
# secondary libraries.
|
||||
conf.set_quoted('COMPRESSION_PRIORITY_ZSTD',
|
||||
conf.set('COMPRESSION_PRIORITY_ZSTD',
|
||||
compression == 'zstd' ? 'recommended' : 'suggested')
|
||||
conf.set_quoted('COMPRESSION_PRIORITY_LZ4',
|
||||
conf.set('COMPRESSION_PRIORITY_LZ4',
|
||||
compression == 'lz4' ? 'recommended' : 'suggested')
|
||||
conf.set_quoted('COMPRESSION_PRIORITY_XZ',
|
||||
conf.set('COMPRESSION_PRIORITY_XZ',
|
||||
compression == 'xz' ? 'recommended' : 'suggested')
|
||||
conf.set('DEFAULT_COMPRESSION', 'COMPRESSION_@0@'.format(compression.to_upper()))
|
||||
|
||||
@@ -2019,11 +2021,21 @@ endif
|
||||
|
||||
#####################################################################
|
||||
|
||||
# The 'install' field is extended to also control whether the automatically
|
||||
# added variant, which is statically linked with libsystemd-shared, is installed:
|
||||
# 'yes' : Mapped to true. The static variant will not be installed.
|
||||
# 'no' : Mapped to false. The static variant will not be installed either.
|
||||
# 'both' : Mapped to true. The static variant will also be installed.
|
||||
# 'static' : Mapped to false, and its target name is suffixed with '.shared'.
|
||||
# The static variant will be installed instead using the original name
|
||||
# (without the '.standalone' suffix).
|
||||
# Currently, test and fuzzer executables only support 'yes' or 'no'.
|
||||
executable_template = {
|
||||
'include_directories' : includes,
|
||||
'link_with' : libshared,
|
||||
'link_with' : [libshared],
|
||||
'install_rpath' : pkglibdir,
|
||||
'install' : true,
|
||||
'install' : 'yes',
|
||||
'build_by_default' : true,
|
||||
}
|
||||
|
||||
generator_template = executable_template + {
|
||||
@@ -2040,7 +2052,7 @@ executable_additional_kwargs = {
|
||||
|
||||
test_template = executable_template + {
|
||||
'build_by_default' : want_tests != 'false',
|
||||
'install' : install_tests,
|
||||
'install' : install_tests ? 'yes' : 'no',
|
||||
'install_dir' : unittestsdir,
|
||||
}
|
||||
|
||||
@@ -2051,7 +2063,7 @@ test_additional_kwargs = {
|
||||
|
||||
fuzz_template = executable_template + {
|
||||
'build_by_default' : want_fuzz_tests,
|
||||
'install' : false,
|
||||
'install' : 'no',
|
||||
}
|
||||
|
||||
if want_ossfuzz
|
||||
@@ -2263,7 +2275,6 @@ foreach dict : executables
|
||||
|
||||
is_test = name.startswith('test-')
|
||||
is_fuzz = name.startswith('fuzz-')
|
||||
is_standalone = name.endswith('.standalone')
|
||||
|
||||
build = true
|
||||
foreach cond : dict.get('conditions', [])
|
||||
@@ -2276,20 +2287,22 @@ foreach dict : executables
|
||||
continue
|
||||
endif
|
||||
|
||||
exe_sources = dict.get('sources', []) + dict.get('export', [])
|
||||
exe_sources_static = dict.get('sources', [])
|
||||
|
||||
foreach bpf_name : dict.get('bpf_programs', [])
|
||||
if bpf_name in bpf_programs_by_name
|
||||
exe_sources += bpf_programs_by_name[bpf_name]
|
||||
exe_sources_static += bpf_programs_by_name[bpf_name]
|
||||
endif
|
||||
endforeach
|
||||
|
||||
exe_sources = exe_sources_static + dict.get('export', [])
|
||||
|
||||
kwargs = {}
|
||||
foreach key, val : dict
|
||||
if key in ['name', 'dbus', 'public', 'conditions', 'type', 'suite',
|
||||
'timeout', 'parallel', 'sources', 'import', 'export',
|
||||
'include_directories', 'build_by_default', 'install',
|
||||
'bpf_programs']
|
||||
'bpf_programs', 'link_args_static']
|
||||
continue
|
||||
endif
|
||||
|
||||
@@ -2329,30 +2342,54 @@ foreach dict : executables
|
||||
endforeach
|
||||
endif
|
||||
|
||||
build_by_default = dict.get('build_by_default',
|
||||
have_standalone_binaries or not is_standalone)
|
||||
|
||||
if not is_standalone
|
||||
install = dict.get('install', true)
|
||||
name_shared = name
|
||||
name_static = name + '.standalone'
|
||||
install = dict.get('install')
|
||||
build_by_default = dict.get('build_by_default')
|
||||
if install == 'yes'
|
||||
install_shared = true
|
||||
install_static = false
|
||||
build_by_default_shared = build_by_default
|
||||
build_by_default_static = false
|
||||
elif install == 'no'
|
||||
install_shared = false
|
||||
install_static = false
|
||||
build_by_default_shared = build_by_default
|
||||
build_by_default_static = false
|
||||
elif install == 'both'
|
||||
if is_test or is_fuzz
|
||||
error('Install mode "@0@" is not supported for test or fuzzer target "@1@"'.format(install, name))
|
||||
endif
|
||||
install_shared = true
|
||||
install_static = true
|
||||
build_by_default_shared = build_by_default
|
||||
build_by_default_static = build_by_default
|
||||
elif install == 'static'
|
||||
if is_test or is_fuzz
|
||||
error('Install mode "@0@" is not supported for test or fuzzer target "@1@"'.format(install, name))
|
||||
endif
|
||||
name_shared = name + '.shared'
|
||||
name_static = name
|
||||
install_shared = false
|
||||
install_static = true
|
||||
build_by_default_shared = false
|
||||
build_by_default_static = build_by_default
|
||||
else
|
||||
install = have_standalone_binaries
|
||||
error('Unknown install mode "@0@" for target "@1@"'.format(install, name))
|
||||
endif
|
||||
|
||||
exe = executable(
|
||||
name,
|
||||
name_shared,
|
||||
sources : exe_sources,
|
||||
kwargs : kwargs,
|
||||
implicit_include_directories : false,
|
||||
include_directories : include_directories,
|
||||
build_by_default: build_by_default,
|
||||
install: install,
|
||||
build_by_default: build_by_default_shared,
|
||||
install: install_shared,
|
||||
)
|
||||
|
||||
executables_by_name += { name : exe }
|
||||
|
||||
if not is_standalone
|
||||
sources += exe_sources
|
||||
endif
|
||||
executables_by_name += { name_shared : exe }
|
||||
sources += exe_sources
|
||||
|
||||
if 'export' in dict
|
||||
exported_by_name += {
|
||||
@@ -2363,7 +2400,7 @@ foreach dict : executables
|
||||
}
|
||||
endif
|
||||
|
||||
if build_by_default
|
||||
if build_by_default_shared
|
||||
if dict.get('dbus', false)
|
||||
dbus_programs += exe
|
||||
endif
|
||||
@@ -2372,6 +2409,56 @@ foreach dict : executables
|
||||
endif
|
||||
endif
|
||||
|
||||
if not is_test and not is_fuzz
|
||||
kwargs_static = kwargs
|
||||
|
||||
if 'export' in dict
|
||||
obj = exported_by_name[name]
|
||||
kwargs_static += { 'objects' : kwargs_static.get('objects', []) + obj['exported'] }
|
||||
include_directories += obj['include_directories']
|
||||
endif
|
||||
|
||||
link_with_static = []
|
||||
foreach obj : kwargs_static.get('link_with', [])
|
||||
if obj.full_path() == libshared.full_path()
|
||||
link_with_static += [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
elif obj.full_path() == libcore.full_path()
|
||||
link_with_static += libcore_static
|
||||
else
|
||||
link_with_static += obj
|
||||
endif
|
||||
endforeach
|
||||
|
||||
kwargs_static += {
|
||||
'link_with' : link_with_static,
|
||||
'link_args' : dict.get('link_args_static', kwargs_static.get('link_args', [])),
|
||||
}
|
||||
|
||||
exe = executable(
|
||||
name_static,
|
||||
sources : exe_sources_static,
|
||||
kwargs : kwargs_static,
|
||||
implicit_include_directories : false,
|
||||
include_directories : include_directories,
|
||||
build_by_default: build_by_default_static,
|
||||
install: install_static,
|
||||
)
|
||||
|
||||
executables_by_name += { name_static : exe }
|
||||
|
||||
if build_by_default_static
|
||||
if dict.get('dbus', false) and not build_by_default_shared
|
||||
dbus_programs += exe
|
||||
endif
|
||||
if dict.get('public', false)
|
||||
public_programs += exe
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if is_test
|
||||
type = dict.get('type', '')
|
||||
suite = dict.get('suite', '')
|
||||
@@ -2440,6 +2527,7 @@ test_dlopen = executables_by_name.get('test-dlopen')
|
||||
nss_targets = []
|
||||
pam_targets = []
|
||||
module_targets = []
|
||||
modules_by_name = {}
|
||||
foreach dict : modules
|
||||
name = dict.get('name')
|
||||
is_nss = name.startswith('nss_')
|
||||
@@ -2485,6 +2573,40 @@ foreach dict : modules
|
||||
)
|
||||
|
||||
module_targets += lib
|
||||
modules_by_name += { name : lib }
|
||||
|
||||
if not is_nss and not is_pam
|
||||
# Typically for cryptsetup token modules.
|
||||
|
||||
name_static = name + '.standalone'
|
||||
kwargs_static = kwargs
|
||||
|
||||
link_with_static = []
|
||||
foreach obj : kwargs_static.get('link_with', [])
|
||||
if obj.full_path() == libshared.full_path()
|
||||
link_with_static += [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
else
|
||||
link_with_static += obj
|
||||
endif
|
||||
endforeach
|
||||
|
||||
kwargs_static += {
|
||||
'link_with' : link_with_static,
|
||||
'install' : false,
|
||||
'build_by_default' : false,
|
||||
}
|
||||
|
||||
lib_static = shared_library(
|
||||
name_static,
|
||||
kwargs : kwargs_static,
|
||||
implicit_include_directories : false,
|
||||
)
|
||||
|
||||
modules_by_name += { name_static : lib_static }
|
||||
endif
|
||||
|
||||
if is_nss
|
||||
# We cannot use shared_module because it does not support version suffix.
|
||||
|
||||
@@ -626,7 +626,7 @@ static int assess_system_call_filter(
|
||||
uint64_t b;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
|
||||
if (r < 0) {
|
||||
*ret_badness = UINT64_MAX;
|
||||
*ret_description = NULL;
|
||||
@@ -2604,7 +2604,7 @@ static int get_security_info(Unit *u, ExecContext *c, CGroupContext *g, RuntimeS
|
||||
info->_umask = c->umask;
|
||||
|
||||
#if HAVE_SECCOMP
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0) {
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) >= 0) {
|
||||
SET_FOREACH(key, c->syscall_archs) {
|
||||
const char *name;
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "bus-util.h"
|
||||
#include "calendarspec.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "extract-word.h"
|
||||
#include "format-table.h"
|
||||
#include "help-util.h"
|
||||
@@ -685,6 +686,20 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_strv_free_ char **args = NULL;
|
||||
int r;
|
||||
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBAPPARMOR_NOTE(recommended);
|
||||
LIBAUDIT_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBBPF_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(recommended);
|
||||
LIBDW_NOTE(suggested);
|
||||
LIBELF_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBPCRE2_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
setlocale(LC_NUMERIC, "C"); /* we want to format/parse floats in C style */
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ executables += [
|
||||
libseccomp_cflags,
|
||||
tpm2_cflags,
|
||||
],
|
||||
'install' : conf.get('ENABLE_ANALYZE') == 1,
|
||||
'install' : conf.get('ENABLE_ANALYZE') == 1 ? 'yes' : 'no',
|
||||
},
|
||||
core_test_template + {
|
||||
'sources' : files('test-verify.c'),
|
||||
|
||||
+65
-33
@@ -43,8 +43,6 @@
|
||||
#include <bzlib.h>
|
||||
#endif
|
||||
|
||||
#include "sd-dlopen.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bitfield.h"
|
||||
#include "compress.h"
|
||||
@@ -256,6 +254,19 @@ Compression compression_from_filename(const char *filename) {
|
||||
return c;
|
||||
}
|
||||
|
||||
bool compression_supported_journal(Compression c) {
|
||||
static const unsigned supported =
|
||||
(1U << COMPRESSION_NONE) |
|
||||
(1U << COMPRESSION_XZ) * HAVE_XZ |
|
||||
(1U << COMPRESSION_LZ4) * HAVE_LZ4 |
|
||||
(1U << COMPRESSION_ZSTD) * HAVE_ZSTD;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(c < _COMPRESSION_MAX);
|
||||
|
||||
return BIT_SET(supported, c);
|
||||
}
|
||||
|
||||
bool compression_supported(Compression c) {
|
||||
static const unsigned supported =
|
||||
(1U << COMPRESSION_NONE) |
|
||||
@@ -293,11 +304,7 @@ int dlopen_xz(int log_level) {
|
||||
#if HAVE_XZ
|
||||
static void *lzma_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"lzma",
|
||||
"Support lzma compression in journal and coredump files",
|
||||
COMPRESSION_PRIORITY_XZ,
|
||||
"liblzma.so.5");
|
||||
LIBLZMA_NOTE(COMPRESSION_PRIORITY_XZ);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&lzma_dl,
|
||||
@@ -318,11 +325,7 @@ int dlopen_lz4(int log_level) {
|
||||
#if HAVE_LZ4
|
||||
static void *lz4_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"lz4",
|
||||
"Support lz4 compression in journal and coredump files",
|
||||
COMPRESSION_PRIORITY_LZ4,
|
||||
"liblz4.so.1");
|
||||
LIBLZ4_NOTE(COMPRESSION_PRIORITY_LZ4);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&lz4_dl,
|
||||
@@ -352,11 +355,7 @@ int dlopen_zstd(int log_level) {
|
||||
#if HAVE_ZSTD
|
||||
static void *zstd_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"zstd",
|
||||
"Support zstd compression in journal and coredump files",
|
||||
COMPRESSION_PRIORITY_ZSTD,
|
||||
"libzstd.so.1");
|
||||
LIBZSTD_NOTE(COMPRESSION_PRIORITY_ZSTD);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&zstd_dl,
|
||||
@@ -387,11 +386,7 @@ int dlopen_zlib(int log_level) {
|
||||
#if HAVE_ZLIB
|
||||
static void *zlib_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"zlib",
|
||||
"Support gzip compression and decompression",
|
||||
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
|
||||
"libz.so.1");
|
||||
LIBZ_NOTE(suggested);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&zlib_dl,
|
||||
@@ -412,11 +407,7 @@ int dlopen_bzip2(int log_level) {
|
||||
#if HAVE_BZIP2
|
||||
static void *bzip2_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"bzip2",
|
||||
"Support bzip2 compression and decompression",
|
||||
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
|
||||
"libbz2.so.1");
|
||||
LIBBZ2_NOTE(suggested);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&bzip2_dl,
|
||||
@@ -661,7 +652,7 @@ static int compress_blob_bzip2(
|
||||
#endif
|
||||
}
|
||||
|
||||
int compress_blob(
|
||||
int compress_blob_journal(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void *dst, size_t dst_alloc_size, size_t *dst_size, int level) {
|
||||
@@ -673,12 +664,23 @@ int compress_blob(
|
||||
return compress_blob_lz4(src, src_size, dst, dst_alloc_size, dst_size, level);
|
||||
case COMPRESSION_ZSTD:
|
||||
return compress_blob_zstd(src, src_size, dst, dst_alloc_size, dst_size, level);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
int compress_blob(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void *dst, size_t dst_alloc_size, size_t *dst_size, int level) {
|
||||
|
||||
switch (compression) {
|
||||
case COMPRESSION_GZIP:
|
||||
return compress_blob_gzip(src, src_size, dst, dst_alloc_size, dst_size, level);
|
||||
case COMPRESSION_BZIP2:
|
||||
return compress_blob_bzip2(src, src_size, dst, dst_alloc_size, dst_size, level);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return compress_blob_journal(compression, src, src_size, dst, dst_alloc_size, dst_size, level);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1055,7 +1057,7 @@ static int decompress_blob_bzip2(
|
||||
#endif
|
||||
}
|
||||
|
||||
int decompress_blob(
|
||||
int decompress_blob_journal(
|
||||
Compression compression,
|
||||
const void *src,
|
||||
uint64_t src_size,
|
||||
@@ -1076,6 +1078,20 @@ int decompress_blob(
|
||||
return decompress_blob_zstd(
|
||||
src, src_size,
|
||||
dst, dst_size, dst_max);
|
||||
default:
|
||||
return -EPROTONOSUPPORT;
|
||||
}
|
||||
}
|
||||
|
||||
int decompress_blob(
|
||||
Compression compression,
|
||||
const void *src,
|
||||
uint64_t src_size,
|
||||
void **dst,
|
||||
size_t *dst_size,
|
||||
size_t dst_max) {
|
||||
|
||||
switch (compression) {
|
||||
case COMPRESSION_GZIP:
|
||||
return decompress_blob_gzip(
|
||||
src, src_size,
|
||||
@@ -1085,7 +1101,10 @@ int decompress_blob(
|
||||
src, src_size,
|
||||
dst, dst_size, dst_max);
|
||||
default:
|
||||
return -EPROTONOSUPPORT;
|
||||
return decompress_blob_journal(
|
||||
compression,
|
||||
src, src_size,
|
||||
dst, dst_size, dst_max);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1474,7 +1493,7 @@ static int decompress_startswith_bzip2(
|
||||
#endif
|
||||
}
|
||||
|
||||
int decompress_startswith(
|
||||
int decompress_startswith_journal(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **buffer,
|
||||
@@ -1488,12 +1507,25 @@ int decompress_startswith(
|
||||
return decompress_startswith_lz4(src, src_size, buffer, prefix, prefix_len, extra);
|
||||
case COMPRESSION_ZSTD:
|
||||
return decompress_startswith_zstd(src, src_size, buffer, prefix, prefix_len, extra);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
int decompress_startswith(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **buffer,
|
||||
const void *prefix, size_t prefix_len,
|
||||
uint8_t extra) {
|
||||
|
||||
switch (compression) {
|
||||
case COMPRESSION_GZIP:
|
||||
return decompress_startswith_gzip(src, src_size, buffer, prefix, prefix_len, extra);
|
||||
case COMPRESSION_BZIP2:
|
||||
return decompress_startswith_bzip2(src, src_size, buffer, prefix, prefix_len, extra);
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return decompress_startswith_journal(compression, src, src_size, buffer, prefix, prefix_len, extra);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-5
@@ -2,6 +2,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "basic-forward.h"
|
||||
#include "dlopen-note.h"
|
||||
|
||||
typedef enum Compression {
|
||||
COMPRESSION_NONE,
|
||||
@@ -26,6 +27,7 @@ Compression compression_from_string_harder(const char *s);
|
||||
* filename does not carry a recognized compression suffix. */
|
||||
Compression compression_from_filename(const char *filename);
|
||||
|
||||
bool compression_supported_journal(Compression c);
|
||||
bool compression_supported(Compression c);
|
||||
|
||||
/* Buffer size used by streaming compression APIs and pipeline stages that feed into them. Sized to
|
||||
@@ -58,9 +60,17 @@ Compression compressor_type(const Compressor *c);
|
||||
|
||||
/* Blob compression/decompression */
|
||||
|
||||
int compress_blob_journal(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void *dst, size_t dst_alloc_size, size_t *dst_size, int level);
|
||||
int compress_blob(Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void *dst, size_t dst_alloc_size, size_t *dst_size, int level);
|
||||
int decompress_blob_journal(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **dst, size_t *dst_size, size_t dst_max);
|
||||
int decompress_blob(Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **dst, size_t *dst_size, size_t dst_max);
|
||||
@@ -68,6 +78,12 @@ int decompress_blob(Compression compression,
|
||||
int decompress_zlib_raw(const void *src, uint64_t src_size,
|
||||
void *dst, size_t dst_size, int wbits);
|
||||
|
||||
int decompress_startswith_journal(
|
||||
Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **buffer,
|
||||
const void *prefix, size_t prefix_len,
|
||||
uint8_t extra);
|
||||
int decompress_startswith(Compression compression,
|
||||
const void *src, uint64_t src_size,
|
||||
void **buffer,
|
||||
@@ -80,11 +96,11 @@ int compress_stream(Compression type, int fdf, int fdt, uint64_t max_bytes, uint
|
||||
int decompress_stream(Compression type, int fdf, int fdt, uint64_t max_bytes);
|
||||
int decompress_stream_by_filename(const char *filename, int fdf, int fdt, uint64_t max_bytes);
|
||||
|
||||
int dlopen_xz(int log_level);
|
||||
int dlopen_lz4(int log_level);
|
||||
int dlopen_zstd(int log_level);
|
||||
int dlopen_zlib(int log_level);
|
||||
int dlopen_bzip2(int log_level);
|
||||
int dlopen_xz(int log_level) _dlopen_loader_;
|
||||
int dlopen_lz4(int log_level) _dlopen_loader_;
|
||||
int dlopen_zstd(int log_level) _dlopen_loader_;
|
||||
int dlopen_zlib(int log_level) _dlopen_loader_;
|
||||
int dlopen_bzip2(int log_level) _dlopen_loader_;
|
||||
|
||||
static inline const char* default_compression_extension(void) {
|
||||
return compression_extension_to_string(DEFAULT_COMPRESSION) ?: "";
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-dlopen.h"
|
||||
|
||||
#include "basic-forward.h"
|
||||
#include "strv.h"
|
||||
|
||||
/* Prevent dlopen helper functions (e.g., dlopen_libfoo()) from being inlined or cloned by the compiler/LTO.
|
||||
* This ensures that their specific symbols remain intact in the final executable, allowing the developer
|
||||
* test utility to verify that the functions corresponding to the dlopen ELF notes are actually invoked.
|
||||
* This is restricted to BUILD_MODE_DEVELOPER to avoid degrading production performance. */
|
||||
#if BUILD_MODE_DEVELOPER
|
||||
# define _dlopen_loader_ _noclone_ _noinline_
|
||||
#else
|
||||
# define _dlopen_loader_
|
||||
#endif
|
||||
|
||||
/* Avoid invalid priority. */
|
||||
#define _DLOPEN_CHECK_PRIORITY_required 1
|
||||
#define _DLOPEN_CHECK_PRIORITY_recommended 1
|
||||
#define _DLOPEN_CHECK_PRIORITY_suggested 1
|
||||
|
||||
/* Unlike SD_ELF_NOTE_DLOPEN_ANCHORED(), this takes feature and priority without quotation. */
|
||||
#define ELF_NOTE_DLOPEN_ANCHORED(feature, description, priority, ...) \
|
||||
assert_cc(_DLOPEN_CHECK_PRIORITY_##priority); \
|
||||
SD_ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
feature##_##priority, \
|
||||
STRINGIFY(feature), \
|
||||
description, \
|
||||
STRINGIFY(priority), \
|
||||
__VA_ARGS__)
|
||||
|
||||
#if HAVE_BZIP2
|
||||
# define LIBBZ2_NOTE(priority) \
|
||||
ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
bzip2, \
|
||||
"Support bzip2 compression and decompression", \
|
||||
priority, \
|
||||
"libbz2.so.1")
|
||||
#else
|
||||
# define LIBBZ2_NOTE(priority)
|
||||
#endif
|
||||
|
||||
#if HAVE_LZ4
|
||||
# define LIBLZ4_NOTE(priority) \
|
||||
ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
lz4, \
|
||||
"Support lz4 compression in journal and coredump files", \
|
||||
priority, \
|
||||
"liblz4.so.1")
|
||||
#else
|
||||
# define LIBLZ4_NOTE(priority)
|
||||
#endif
|
||||
|
||||
#if HAVE_XZ
|
||||
# define LIBLZMA_NOTE(priority) \
|
||||
ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
lzma, \
|
||||
"Support lzma compression in journal and coredump files", \
|
||||
priority, \
|
||||
"liblzma.so.5")
|
||||
#else
|
||||
# define LIBLZMA_NOTE(priority)
|
||||
#endif
|
||||
|
||||
#if HAVE_ZLIB
|
||||
# define LIBZ_NOTE(priority) \
|
||||
ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
zlib, \
|
||||
"Support gzip compression and decompression", \
|
||||
priority, \
|
||||
"libz.so.1")
|
||||
#else
|
||||
# define LIBZ_NOTE(priority)
|
||||
#endif
|
||||
|
||||
#if HAVE_ZSTD
|
||||
# define LIBZSTD_NOTE(priority) \
|
||||
ELF_NOTE_DLOPEN_ANCHORED( \
|
||||
zstd, \
|
||||
"Support zstd compression in journal and coredump files", \
|
||||
priority, \
|
||||
"libzstd.so.1")
|
||||
#else
|
||||
# define LIBZSTD_NOTE(priority)
|
||||
#endif
|
||||
|
||||
#define COMPRESS_NOTE(priority) \
|
||||
LIBBZ2_NOTE(priority); \
|
||||
LIBLZ4_NOTE(priority); \
|
||||
LIBLZMA_NOTE(priority); \
|
||||
LIBZ_NOTE(priority); \
|
||||
LIBZSTD_NOTE(priority)
|
||||
|
||||
#define COMPRESS_DEFAULT_NOTE \
|
||||
COMPRESS_JOURNAL_NOTE; \
|
||||
LIBBZ2_NOTE(suggested); \
|
||||
LIBZ_NOTE(suggested)
|
||||
|
||||
#define COMPRESS_JOURNAL_NOTE \
|
||||
LIBLZ4_NOTE(COMPRESSION_PRIORITY_LZ4); \
|
||||
LIBLZMA_NOTE(COMPRESSION_PRIORITY_XZ); \
|
||||
LIBZSTD_NOTE(COMPRESSION_PRIORITY_ZSTD)
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efivars.h"
|
||||
#include "fd-util.h"
|
||||
#include "find-esp.h"
|
||||
@@ -566,6 +567,8 @@ static int run(int argc, char *argv[]) {
|
||||
char **args = NULL;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv, &args);
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
if get_option('link-boot-shared')
|
||||
boot_link_with = [libshared]
|
||||
else
|
||||
boot_link_with = [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
endif
|
||||
|
||||
executables += [
|
||||
libexec_template + {
|
||||
'name' : 'systemd-bless-boot',
|
||||
@@ -18,7 +9,7 @@ executables += [
|
||||
'ENABLE_BOOTLOADER',
|
||||
],
|
||||
'sources' : files('bless-boot.c'),
|
||||
'link_with' : boot_link_with,
|
||||
'install' : get_option('link-boot-shared') ? 'yes' : 'static',
|
||||
},
|
||||
generator_template + {
|
||||
'name' : 'systemd-bless-boot-generator',
|
||||
@@ -27,7 +18,7 @@ executables += [
|
||||
'ENABLE_BOOTLOADER',
|
||||
],
|
||||
'sources' : files('bless-boot-generator.c'),
|
||||
'link_with' : boot_link_with,
|
||||
'install' : get_option('link-boot-shared') ? 'yes' : 'static',
|
||||
},
|
||||
libexec_template + {
|
||||
'name' : 'systemd-boot-check-no-failures',
|
||||
|
||||
@@ -1085,7 +1085,7 @@ static int install_secure_boot_auto_enroll(InstallContext *c) {
|
||||
if (!c->secure_boot_certificate || !c->secure_boot_private_key)
|
||||
return 0;
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "crypto-util.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efi-loader.h"
|
||||
#include "efivars.h"
|
||||
#include "escape.h"
|
||||
@@ -858,6 +859,13 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(umount_and_freep) char *mounted_dir = NULL;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBTSS2_ESYS_NOTE(suggested);
|
||||
LIBTSS2_MU_NOTE(suggested);
|
||||
LIBTSS2_RC_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
char **args = NULL;
|
||||
|
||||
@@ -23,11 +23,11 @@ executables += [
|
||||
'HAVE_BLKID',
|
||||
],
|
||||
'sources' : bootctl_sources,
|
||||
'link_with' : boot_link_with,
|
||||
'dependencies' : [
|
||||
libopenssl_cflags,
|
||||
tpm2_cflags,
|
||||
],
|
||||
'install' : get_option('link-boot-shared') ? 'yes' : 'static',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files(
|
||||
|
||||
@@ -31,7 +31,7 @@ int bpf_bind_network_interface_supported(void) {
|
||||
if (supported >= 0)
|
||||
return supported;
|
||||
|
||||
if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
|
||||
return (supported = false);
|
||||
|
||||
obj = bind_iface_bpf__open();
|
||||
|
||||
@@ -78,7 +78,7 @@ bool bpf_restrict_fs_supported(bool initialize) {
|
||||
if (!initialize)
|
||||
return false;
|
||||
|
||||
if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
|
||||
return (supported = false);
|
||||
|
||||
r = lsm_supported("bpf");
|
||||
|
||||
@@ -171,7 +171,7 @@ bool bpf_restrict_fsaccess_supported(void) {
|
||||
|
||||
if (supported >= 0)
|
||||
return supported;
|
||||
if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
|
||||
return (supported = false);
|
||||
|
||||
r = lsm_supported("bpf");
|
||||
@@ -340,7 +340,7 @@ static int restrict_fsaccess_validate_deserialized_fds(Manager *m) {
|
||||
|
||||
assert(m);
|
||||
|
||||
r = DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_BPF(LOG_WARNING, recommended);
|
||||
if (r < 0)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
|
||||
"bpf-restrict-fsaccess: Failed to load libbpf for FD validation, aborting.");
|
||||
|
||||
@@ -86,7 +86,7 @@ int bpf_restrict_ifaces_supported(void) {
|
||||
if (supported >= 0)
|
||||
return supported;
|
||||
|
||||
if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
|
||||
return (supported = false);
|
||||
|
||||
r = prepare_restrict_ifaces_bpf(NULL, true, NULL, &obj);
|
||||
|
||||
@@ -125,7 +125,7 @@ int bpf_socket_bind_supported(void) {
|
||||
_cleanup_(socket_bind_bpf_freep) struct socket_bind_bpf *obj = NULL;
|
||||
int r;
|
||||
|
||||
if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
|
||||
return false;
|
||||
|
||||
r = prepare_socket_bind_bpf(/* unit= */ NULL, /* allow_rules= */ NULL, /* deny_rules= */ NULL, &obj);
|
||||
|
||||
@@ -1310,7 +1310,7 @@ static int setup_pam(
|
||||
* parent process will exec() the actual daemon. We do things this way to ensure that the main PID of
|
||||
* the daemon is the one we initially fork()ed. */
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBPAM(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1576,7 +1576,7 @@ static bool seccomp_allows_drop_privileges(const ExecContext *c) {
|
||||
assert(c);
|
||||
|
||||
/* No libseccomp, all is fine */
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
|
||||
return true;
|
||||
|
||||
/* No syscall filter, we are allowed to drop privileges */
|
||||
@@ -1886,7 +1886,7 @@ static int apply_restrict_filesystems(const ExecContext *c, const ExecParameters
|
||||
}
|
||||
|
||||
/* We are in a new binary, so dl-open again */
|
||||
r = DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_BPF(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -6000,12 +6000,12 @@ int exec_invoke(
|
||||
}
|
||||
|
||||
/* Load a bunch of libraries we'll possibly need later, before we turn off dlopen() */
|
||||
(void) DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_BPF(LOG_DEBUG, recommended);
|
||||
(void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
(void) DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
|
||||
(void) DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
|
||||
/* Needed for userspace verity verification fallback */
|
||||
(void) DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
|
||||
|
||||
/* Let's now disable further dlopen()ing of libraries, since we are about to do namespace
|
||||
* shenanigans, and do not want to mix resources from host and namespace */
|
||||
|
||||
+3
-3
@@ -1575,7 +1575,7 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
|
||||
fputc('~', f);
|
||||
|
||||
#if HAVE_SECCOMP
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0) {
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) >= 0) {
|
||||
void *id, *val;
|
||||
bool first = true;
|
||||
HASHMAP_FOREACH_KEY(val, id, c->syscall_filter) {
|
||||
@@ -1994,7 +1994,7 @@ char** exec_context_get_syscall_filter(const ExecContext *c) {
|
||||
assert(c);
|
||||
|
||||
#if HAVE_SECCOMP
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
|
||||
return strv_new(NULL);
|
||||
|
||||
void *id, *val;
|
||||
@@ -2063,7 +2063,7 @@ char** exec_context_get_syscall_log(const ExecContext *c) {
|
||||
assert(c);
|
||||
|
||||
#if HAVE_SECCOMP
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
|
||||
if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
|
||||
return strv_new(NULL);
|
||||
|
||||
void *id, *val;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "build.h"
|
||||
#include "capability-util.h"
|
||||
#include "cgroup.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "dynamic-user.h"
|
||||
#include "exec-invoke.h"
|
||||
#include "execute.h"
|
||||
@@ -232,6 +233,12 @@ static int run(int argc, char *argv[]) {
|
||||
int run_executor(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBAPPARMOR_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
/* We use safe_fork() for spawning sd-pam helper process, which internally calls rename_process().
|
||||
* As the last step of renaming, all saved argvs are memzero()-ed. Hence, we need to save the argv
|
||||
* first to prevent showing "intense" cmdline. See #30352. */
|
||||
|
||||
+14
-1
@@ -41,6 +41,7 @@
|
||||
#include "dbus.h"
|
||||
#include "dbus-manager.h"
|
||||
#include "dev-setup.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efi-random.h"
|
||||
#include "emergency-action.h"
|
||||
#include "env-util.h"
|
||||
@@ -3814,7 +3815,7 @@ static int run_systemd(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
/* Building without libmount is allowed, but if it is compiled in, then we must be able to load it */
|
||||
r = DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBMOUNT(LOG_DEBUG, required);
|
||||
if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r)) {
|
||||
error_message = "Failed to load libmount.so";
|
||||
goto finish;
|
||||
@@ -4018,6 +4019,18 @@ finish:
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBAPPARMOR_NOTE(recommended);
|
||||
LIBAUDIT_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBBPF_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(recommended);
|
||||
LIBKMOD_NOTE(recommended);
|
||||
LIBPCRE2_NOTE(suggested);
|
||||
LIBSECCOMP_NOTE(recommended);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
#if SYSTEMD_MULTICALL_BINARY
|
||||
if (invoked_as(argv, "executor"))
|
||||
return run_executor(argc, argv);
|
||||
|
||||
+14
-23
@@ -200,18 +200,6 @@ libcore = shared_library(
|
||||
install : true,
|
||||
install_dir : pkglibdir)
|
||||
|
||||
core_libs_static = [
|
||||
libc_wrapper_static,
|
||||
libcore_static,
|
||||
libshared_static,
|
||||
libbasic_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
core_libs_shared = [
|
||||
libcore,
|
||||
libshared,
|
||||
]
|
||||
|
||||
systemd_deps = [
|
||||
libapparmor_cflags,
|
||||
libaudit_cflags,
|
||||
@@ -221,11 +209,6 @@ systemd_deps = [
|
||||
libselinux_cflags,
|
||||
]
|
||||
|
||||
systemd_link_args = get_option('build-static') ? ['-static'] : []
|
||||
systemd_libs = get_option('build-static') ? core_libs_static : core_libs_shared
|
||||
|
||||
executor_libs = get_option('link-executor-shared') ? core_libs_shared : core_libs_static
|
||||
|
||||
if conf.get('SYSTEMD_MULTICALL_BINARY') == 1
|
||||
systemd_sources += systemd_executor_sources
|
||||
systemd_deps += [
|
||||
@@ -242,16 +225,20 @@ executables += [
|
||||
'dbus' : true,
|
||||
'public' : true,
|
||||
'sources' : systemd_sources,
|
||||
'link_args' : systemd_link_args,
|
||||
'link_with' : systemd_libs,
|
||||
'link_args_static' : get_option('build-static') ? ['-static'] : [],
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : systemd_deps,
|
||||
'install' : get_option('build-static') ? 'static' : 'yes',
|
||||
},
|
||||
|
||||
fuzz_template + {
|
||||
'sources' : files('fuzz-unit-file.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : libmount_cflags,
|
||||
},
|
||||
@@ -259,14 +246,14 @@ executables += [
|
||||
'sources' : files('fuzz-manager-serialize.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
libshared,
|
||||
],
|
||||
},
|
||||
fuzz_template + {
|
||||
'sources' : files('fuzz-execute-serialize.c'),
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared
|
||||
libshared,
|
||||
],
|
||||
},
|
||||
]
|
||||
@@ -282,7 +269,10 @@ else
|
||||
'name' : 'systemd-executor',
|
||||
'public' : true,
|
||||
'sources' : systemd_executor_sources,
|
||||
'link_with' : executor_libs,
|
||||
'link_with' : [
|
||||
libcore,
|
||||
libshared,
|
||||
],
|
||||
'dependencies' : [
|
||||
libapparmor_cflags,
|
||||
libbpf_cflags,
|
||||
@@ -293,6 +283,7 @@ else
|
||||
libseccomp_cflags,
|
||||
libselinux_cflags,
|
||||
],
|
||||
'install' : get_option('link-executor-shared') ? 'yes' : 'static',
|
||||
},
|
||||
]
|
||||
endif
|
||||
|
||||
+1
-1
@@ -2407,7 +2407,7 @@ static int mount_test_startable(Unit *u) {
|
||||
}
|
||||
|
||||
static bool mount_supported(void) {
|
||||
return DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0;
|
||||
return DLOPEN_LIBMOUNT(LOG_DEBUG, recommended) >= 0;
|
||||
}
|
||||
|
||||
static int mount_subsystem_ratelimited(Manager *m) {
|
||||
|
||||
@@ -3986,7 +3986,7 @@ int refresh_extensions_in_namespace(
|
||||
if (r > 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Target namespace is not separate, cannot reload extensions");
|
||||
|
||||
(void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
(void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
|
||||
extension_dir = path_join(p->private_namespace_dir, "unit-extensions");
|
||||
if (!extension_dir)
|
||||
|
||||
@@ -17,7 +17,7 @@ int mac_selinux_setup(bool *loaded_policy) {
|
||||
|
||||
assert(loaded_policy);
|
||||
|
||||
r = DLOPEN_LIBSELINUX(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBSELINUX(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "coredump-kernel-helper.h"
|
||||
#include "coredump-receive.h"
|
||||
#include "coredump-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "string-util.h"
|
||||
@@ -13,6 +14,12 @@
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
COMPRESS_DEFAULT_NOTE;
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBDW_NOTE(suggested);
|
||||
LIBELF_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
/* When running as backtrace mode, it is not necessary to use kmsg, not necessary to disable coredump
|
||||
* from the command, and unexpectedly passed file descriptors can be silently ignored. */
|
||||
if (streq_ptr(argv[1], "--backtrace"))
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "chase.h"
|
||||
#include "compress.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "extract-word.h"
|
||||
@@ -1489,6 +1490,13 @@ static int run(int argc, char *argv[]) {
|
||||
char **args = NULL;
|
||||
int r, units_active;
|
||||
|
||||
COMPRESS_DEFAULT_NOTE;
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
+5
-1
@@ -12,6 +12,7 @@
|
||||
#include "bus-util.h"
|
||||
#include "creds-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fileio.h"
|
||||
@@ -188,7 +189,7 @@ static int is_tmpfs_with_noswap(dev_t devno) {
|
||||
_cleanup_(mnt_free_tablep) struct libmnt_table *table = NULL;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1467,6 +1468,9 @@ static int vl_server(void) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
char **args = NULL;
|
||||
|
||||
@@ -344,7 +344,7 @@ static int vl_method_enroll(
|
||||
if (FLAGS_SET(flags, SD_VARLINK_METHOD_MORE))
|
||||
c.link = sd_varlink_ref(link);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -421,7 +421,7 @@ static int vl_method_list_slots(
|
||||
if (strdup_to(&c.node, node) < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "cryptenroll-varlink.h"
|
||||
#include "cryptenroll-wipe.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "extract-word.h"
|
||||
#include "format-table.h"
|
||||
#include "help-util.h"
|
||||
@@ -1019,6 +1020,13 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(enroll_context_done) EnrollContext c = ENROLL_CONTEXT_NULL;
|
||||
int slot, r;
|
||||
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBFIDO2_NOTE(suggested);
|
||||
LIBP11KIT_NOTE(suggested);
|
||||
LIBQRENCODE_NOTE(suggested);
|
||||
PASSWORD_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
/* A delicious drop of snake oil */
|
||||
@@ -1036,7 +1044,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "cryptsetup-token.h"
|
||||
#include "cryptsetup-token-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "luks2-fido2.h"
|
||||
#include "memory-util.h"
|
||||
#include "version.h"
|
||||
@@ -17,7 +18,9 @@
|
||||
#define TOKEN_VERSION_MINOR "0"
|
||||
|
||||
/* for libcryptsetup debug purpose */
|
||||
_public_ const char *cryptsetup_token_version(void) {
|
||||
_public_ const char* cryptsetup_token_version(void) {
|
||||
LIBFIDO2_NOTE(suggested);
|
||||
|
||||
return TOKEN_VERSION_MAJOR "." TOKEN_VERSION_MINOR " systemd-v" PROJECT_VERSION_FULL " (" GIT_VERSION ")";
|
||||
}
|
||||
|
||||
@@ -37,7 +40,7 @@ _public_ int cryptsetup_token_open_pin(
|
||||
assert(pin || pin_size == 0);
|
||||
assert(token >= 0);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -102,7 +105,7 @@ _public_ void cryptsetup_token_dump(
|
||||
|
||||
assert(json);
|
||||
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
|
||||
return;
|
||||
|
||||
r = parse_luks2_fido2_data(cd, json, &rp_id, &salt, &salt_size, &cid, &cid_size, &required);
|
||||
@@ -169,7 +172,7 @@ _public_ int cryptsetup_token_validate(
|
||||
|
||||
assert(json);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "cryptsetup-token.h"
|
||||
#include "cryptsetup-token-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "luks2-pkcs11.h"
|
||||
#include "memory-util.h"
|
||||
#include "pkcs11-util.h"
|
||||
@@ -17,7 +18,10 @@
|
||||
#define TOKEN_VERSION_MINOR "0"
|
||||
|
||||
/* for libcryptsetup debug purpose */
|
||||
_public_ const char *cryptsetup_token_version(void) {
|
||||
_public_ const char* cryptsetup_token_version(void) {
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBP11KIT_NOTE(suggested);
|
||||
|
||||
return TOKEN_VERSION_MAJOR "." TOKEN_VERSION_MINOR " systemd-v" PROJECT_VERSION_FULL " (" GIT_VERSION ")";
|
||||
}
|
||||
|
||||
@@ -36,7 +40,7 @@ _public_ int cryptsetup_token_open_pin(
|
||||
assert(pin || pin_size == 0);
|
||||
assert(token >= 0);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -94,7 +98,7 @@ _public_ void cryptsetup_token_dump(
|
||||
_cleanup_free_ void *pkcs11_key = NULL;
|
||||
Pkcs11RsaPadding rsa_padding = PKCS11_RSA_PADDING_PKCS1V15;
|
||||
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
|
||||
return;
|
||||
|
||||
r = parse_luks2_pkcs11_data(cd, json, &pkcs11_uri, &pkcs11_key, &pkcs11_key_size, &rsa_padding);
|
||||
@@ -124,7 +128,7 @@ _public_ int cryptsetup_token_validate(
|
||||
sd_json_variant *w;
|
||||
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "cryptsetup-token.h"
|
||||
#include "cryptsetup-token-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "json-util.h"
|
||||
#include "luks2-tpm2.h"
|
||||
@@ -18,7 +19,9 @@
|
||||
#define TOKEN_VERSION_MINOR "0"
|
||||
|
||||
/* for libcryptsetup debug purpose */
|
||||
_public_ const char *cryptsetup_token_version(void) {
|
||||
_public_ const char* cryptsetup_token_version(void) {
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
return TOKEN_VERSION_MAJOR "." TOKEN_VERSION_MINOR " systemd-v" PROJECT_VERSION_FULL " (" GIT_VERSION ")";
|
||||
}
|
||||
@@ -70,7 +73,7 @@ _public_ int cryptsetup_token_open_pin(
|
||||
assert(ret_password);
|
||||
assert(ret_password_len);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -210,7 +213,7 @@ _public_ void cryptsetup_token_dump(
|
||||
|
||||
assert(json);
|
||||
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
|
||||
if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
|
||||
return;
|
||||
|
||||
r = sd_json_parse(json, SD_JSON_PARSE_MUST_BE_OBJECT, &v, /* reterr_line= */ NULL, /* reterr_column= */ NULL);
|
||||
@@ -304,7 +307,7 @@ _public_ int cryptsetup_token_validate(
|
||||
|
||||
assert(json);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ lib_cryptsetup_token_common = static_library(
|
||||
libcryptsetup_cflags,
|
||||
userspace,
|
||||
],
|
||||
link_with : libshared,
|
||||
build_by_default : false)
|
||||
|
||||
cryptsetup_token_systemd_tpm2_sources = files(
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "cryptsetup-pkcs11.h"
|
||||
#include "cryptsetup-tpm2.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efi-api.h"
|
||||
#include "efi-loader.h"
|
||||
#include "efivars.h"
|
||||
@@ -538,7 +539,7 @@ static int parse_one_option(const char *option) {
|
||||
#if HAVE_OPENSSL
|
||||
_cleanup_strv_free_ char **l = NULL;
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -2884,6 +2885,12 @@ static int verb_detach(int argc, char *argv[], uintptr_t _data, void *userdata)
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBFIDO2_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBP11KIT_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
umask(0022);
|
||||
@@ -2893,7 +2900,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "bitfield.h"
|
||||
#include "creds-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "dropin.h"
|
||||
#include "errno-util.h"
|
||||
#include "extract-word.h"
|
||||
@@ -364,6 +365,9 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
|
||||
const char *credentials_dir;
|
||||
int r;
|
||||
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
assert_se(arg_dest = dest_early);
|
||||
|
||||
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_RD_STRICT | PROC_CMDLINE_STRIP_RD_PREFIX);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "device-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
@@ -493,7 +494,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
OPTION_LONG("make-archive", NULL, "Convert the DDI to an archive file"):
|
||||
r = DLOPEN_LIBARCHIVE(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBARCHIVE(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1968,6 +1969,13 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_close_ int userns_fd = -EBADF;
|
||||
int r;
|
||||
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
if (invoked_as(argv, "mount.ddi"))
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "copy.h"
|
||||
#include "creds-util.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-file.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -1702,6 +1703,14 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_close_ int rfd = -EBADF;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPT_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
PASSWORD_NOTE(suggested);
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "bus-util.h"
|
||||
#include "chase.h"
|
||||
#include "creds-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efi-loader.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
@@ -1729,6 +1730,11 @@ static int run_generator(void) {
|
||||
}
|
||||
|
||||
static int run(int argc, char **argv) {
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
arg_sysroot_check = invoked_as(argv, "systemd-sysroot-fstab-check");
|
||||
|
||||
if (arg_sysroot_check) {
|
||||
|
||||
@@ -83,6 +83,11 @@
|
||||
#define _hidden_ __attribute__((__visibility__("hidden")))
|
||||
#define _likely_(x) (__builtin_expect(!!(x), 1))
|
||||
#define _malloc_ __attribute__((__malloc__))
|
||||
#ifdef __clang__
|
||||
# define _noclone_
|
||||
#else
|
||||
# define _noclone_ __attribute__((noclone))
|
||||
#endif
|
||||
#define _noinline_ __attribute__((noinline))
|
||||
#define _noreturn_ _Noreturn
|
||||
#define _packed_ __attribute__((__packed__))
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "creds-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@@ -277,6 +278,9 @@ static int run(const char *dest, const char *dest_early, const char *dest_late)
|
||||
|
||||
assert_se(arg_dest = dest);
|
||||
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
if (in_initrd()) {
|
||||
log_debug("Skipping generator, running in the initrd.");
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "device-util.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "dropin.h"
|
||||
#include "efi-loader.h"
|
||||
#include "efivars.h"
|
||||
@@ -1359,6 +1360,10 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
static int run(const char *dest, const char *dest_early, const char *dest_late) {
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
assert_se(arg_dest = dest);
|
||||
assert_se(arg_dest_late = dest_late);
|
||||
|
||||
|
||||
+4
-1
@@ -11,6 +11,7 @@
|
||||
#include "device-util.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
#include "format-util.h"
|
||||
@@ -33,7 +34,7 @@ static int resize_crypt_luks_device(dev_t devno, const char *fstype, dev_t main_
|
||||
uint64_t size;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_WARNING, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -192,6 +193,8 @@ static int run(int argc, char *argv[]) {
|
||||
dev_t devno;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "blockdev-util.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
@@ -20,6 +21,9 @@ static int run(int argc, char *argv[]) {
|
||||
struct stat st;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
if (argc != 3)
|
||||
|
||||
+8
-1
@@ -19,6 +19,7 @@
|
||||
#include "creds-util.h"
|
||||
#include "crypto-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "dns-domain.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
@@ -2501,7 +2502,7 @@ static int verb_list_signing_keys(int argc, char *argv[], uintptr_t _data, void
|
||||
/* Let's decode the PEM key to DER (so that we lose prefix/suffix), then truncate it
|
||||
* for display reasons. */
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -5183,6 +5184,12 @@ static int run(int argc, char *argv[]) {
|
||||
char **args = NULL;
|
||||
int r;
|
||||
|
||||
LIBCRYPT_NOTE(recommended);
|
||||
LIBFIDO2_NOTE(suggested);
|
||||
LIBP11KIT_NOTE(suggested);
|
||||
LIBQRENCODE_NOTE(suggested);
|
||||
PASSWORD_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = redirect_bus_mgr();
|
||||
|
||||
@@ -1537,7 +1537,7 @@ int manager_startup(Manager *m) {
|
||||
|
||||
assert(m);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-object.h"
|
||||
#include "daemon-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "homed-manager.h"
|
||||
#include "homed-manager-bus.h"
|
||||
#include "log.h"
|
||||
@@ -18,6 +19,9 @@ static int run(int argc, char *argv[]) {
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
|
||||
int r;
|
||||
|
||||
LIBCRYPT_NOTE(recommended);
|
||||
PASSWORD_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = service_parse_argv("systemd-homed.service",
|
||||
|
||||
@@ -232,7 +232,7 @@ static int fscrypt_slot_try_v1(
|
||||
assert(encrypted_size > 0);
|
||||
assert(match_key_descriptor);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -331,7 +331,7 @@ static int fscrypt_slot_try_v2(
|
||||
assert(iovec_is_set(tag));
|
||||
assert(match_key_descriptor);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -700,7 +700,7 @@ static int fscrypt_slot_set(
|
||||
size_t encrypted_size;
|
||||
ssize_t ss;
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -813,7 +813,7 @@ int home_create_fscrypt(
|
||||
assert(setup);
|
||||
assert(ret_home);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
+11
-11
@@ -146,7 +146,7 @@ static int probe_file_system_by_fd(
|
||||
assert(ret_fstype);
|
||||
assert(ret_uuid);
|
||||
|
||||
r = DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBBLKID(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -529,7 +529,7 @@ static int acquire_open_luks_device(
|
||||
assert(setup);
|
||||
assert(!setup->crypt_device);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -684,7 +684,7 @@ static int luks_validate(
|
||||
assert(ret_size);
|
||||
assert(sector_size > 0);
|
||||
|
||||
r = DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBBLKID(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -805,7 +805,7 @@ static int crypt_device_to_evp_cipher(struct crypt_device *cd, const EVP_CIPHER
|
||||
assert(cd);
|
||||
assert(ret);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1293,7 +1293,7 @@ int home_setup_luks(
|
||||
assert(setup);
|
||||
assert(user_record_storage(h) == USER_LUKS);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1594,7 +1594,7 @@ int home_activate_luks(
|
||||
assert(setup);
|
||||
assert(ret_home);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -2211,11 +2211,11 @@ int home_create_luks(
|
||||
assert(setup->image_fd < 0);
|
||||
assert(ret_home);
|
||||
|
||||
r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_FDISK(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -3250,11 +3250,11 @@ int home_resize_luks(
|
||||
assert(user_record_storage(h) == USER_LUKS);
|
||||
assert(setup);
|
||||
|
||||
r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_FDISK(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -3712,7 +3712,7 @@ int home_passwd_luks(
|
||||
assert(user_record_storage(h) == USER_LUKS);
|
||||
assert(setup);
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
+8
-1
@@ -13,6 +13,7 @@
|
||||
#include "chown-recursive.h"
|
||||
#include "copy.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -1328,7 +1329,7 @@ static int determine_default_storage(UserStorage *ret) {
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to determine if %s is encrypted, ignoring: %m", get_home_root());
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
log_info("Not using '%s' storage, since libcryptsetup could not be loaded.", user_storage_to_string(USER_LUKS));
|
||||
else {
|
||||
@@ -1998,6 +1999,12 @@ static int run(int argc, char *argv[]) {
|
||||
sd_json_variant *fdmap, *blob_fd_variant;
|
||||
int r;
|
||||
|
||||
LIBCRYPT_NOTE(recommended);
|
||||
LIBFIDO2_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBP11KIT_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
start = now(CLOCK_MONOTONIC);
|
||||
|
||||
log_setup();
|
||||
|
||||
@@ -786,7 +786,7 @@ _public_ PAM_EXTERN int pam_sm_authenticate(
|
||||
bool debug = false;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
@@ -851,7 +851,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
bool debug = false;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
@@ -908,7 +908,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
bool debug = false;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
@@ -973,7 +973,7 @@ _public_ PAM_EXTERN int pam_sm_acct_mgmt(
|
||||
usec_t t;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
@@ -1092,7 +1092,7 @@ _public_ PAM_EXTERN int pam_sm_chauthtok(
|
||||
bool debug = false;
|
||||
int r;
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "daemon-util.h"
|
||||
#include "device-private.h"
|
||||
#include "device-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "extract-word.h"
|
||||
@@ -2659,6 +2660,8 @@ static int run(int argc, char *argv[]) {
|
||||
};
|
||||
int r;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = service_parse_argv("systemd-hostnamed.service",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "format-table.h"
|
||||
#include "hwdb-util.h"
|
||||
#include "label-util.h"
|
||||
@@ -114,6 +115,8 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
char **args = NULL;
|
||||
|
||||
@@ -6,8 +6,7 @@ executables += [
|
||||
'public' : true,
|
||||
'conditions' : ['ENABLE_HWDB'],
|
||||
'sources' : files('hwdb.c'),
|
||||
'link_with' : udev_link_with,
|
||||
'install_rpath' : udev_rpath,
|
||||
'install' : get_option('link-udev-shared') ? 'yes' : 'static',
|
||||
'install_tag' : 'hwdb',
|
||||
},
|
||||
]
|
||||
|
||||
+1
-1
@@ -3053,7 +3053,7 @@ static int run(int argc, char* argv[]) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CURL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CURL(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "ansi-color.h"
|
||||
#include "build.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "export-raw.h"
|
||||
#include "export-tar.h"
|
||||
#include "fd-util.h"
|
||||
@@ -282,6 +283,9 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
ARCHIVE_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ int import_fork_tar_x(int tree_fd, int userns_fd, PidRef *ret_pid) {
|
||||
assert(tree_fd >= 0);
|
||||
assert(ret_pid);
|
||||
|
||||
r = DLOPEN_LIBARCHIVE(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBARCHIVE(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -99,7 +99,7 @@ int import_fork_tar_c(int tree_fd, int userns_fd, PidRef *ret_pid) {
|
||||
assert(tree_fd >= 0);
|
||||
assert(ret_pid);
|
||||
|
||||
r = DLOPEN_LIBARCHIVE(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBARCHIVE(LOG_DEBUG, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "build.h"
|
||||
#include "copy.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
#include "format-util.h"
|
||||
@@ -392,6 +393,8 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "creds-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efivars.h"
|
||||
#include "errno-util.h"
|
||||
#include "extract-word.h"
|
||||
@@ -426,6 +427,9 @@ static int generate(void) {
|
||||
static int run(const char *dest, const char *dest_early, const char *dest_late) {
|
||||
int r;
|
||||
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
assert_se(arg_dest = dest);
|
||||
|
||||
r = proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_RD_STRICT|PROC_CMDLINE_STRIP_RD_PREFIX);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "ansi-color.h"
|
||||
#include "build.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
@@ -469,6 +470,9 @@ static void parse_env(void) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
ARCHIVE_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "event-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -2081,6 +2082,8 @@ static int run(int argc, char *argv[]) {
|
||||
RuntimeScope scope = RUNTIME_SCOPE_SYSTEM;
|
||||
int r;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = service_parse_argv("systemd-importd.service",
|
||||
|
||||
@@ -10,7 +10,6 @@ executables += [
|
||||
'dbus' : true,
|
||||
'sources' : files(
|
||||
'importd.c',
|
||||
'oci-util.c',
|
||||
),
|
||||
'export' : files(
|
||||
'oci-util.c',
|
||||
|
||||
@@ -281,7 +281,7 @@ static int pull_job_open_disk(PullJob *j) {
|
||||
}
|
||||
|
||||
if (j->calc_checksum) {
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "ansi-color.h"
|
||||
#include "build.h"
|
||||
#include "discover-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "format-table.h"
|
||||
#include "hexdecoct.h"
|
||||
@@ -608,6 +609,10 @@ static void parse_env(void) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
ARCHIVE_NOTE(recommended);
|
||||
LIBCURL_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ static int run(int argc, char *argv[]) {
|
||||
|
||||
log_setup();
|
||||
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -1259,13 +1259,16 @@ static int run(int argc, char *argv[]) {
|
||||
MHD_USE_THREAD_PER_CONNECTION;
|
||||
int r, n;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBGNUTLS_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_MICROHTTPD(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_MICROHTTPD(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "build.h"
|
||||
#include "conf-parser.h"
|
||||
#include "daemon-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
@@ -468,7 +469,7 @@ static int setup_microhttpd_server(RemoteServer *s,
|
||||
#if HAVE_MICROHTTPD
|
||||
int r;
|
||||
|
||||
r = DLOPEN_MICROHTTPD(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_MICROHTTPD(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1165,6 +1166,11 @@ static int run(int argc, char **argv) {
|
||||
_cleanup_free_ char *cert = NULL, *trust = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_DEFAULT_NOTE;
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBGNUTLS_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
journal_auth_init();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "conf-parser.h"
|
||||
#include "curl-util.h"
|
||||
#include "daemon-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-file.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
@@ -869,6 +870,8 @@ static int run(int argc, char **argv) {
|
||||
bool use_journal;
|
||||
int r;
|
||||
|
||||
COMPRESS_DEFAULT_NOTE;
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_config();
|
||||
@@ -879,7 +882,7 @@ static int run(int argc, char **argv) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_CURL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_CURL(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ executables += [
|
||||
# We always build systemd-journal-remote regardless of ENABLE_REMOTE because we have to build
|
||||
# fuzz-journal-remote even when --auto-features=disabled (see tools/oss-fuzz.sh for why).
|
||||
# Instead, we make sure we don't install it when the remote feature is disabled.
|
||||
'install' : conf.get('ENABLE_REMOTE') == 1,
|
||||
'install' : conf.get('ENABLE_REMOTE') == 1 ? 'yes' : 'no',
|
||||
'sources' : systemd_journal_remote_sources,
|
||||
'export' : systemd_journal_remote_export_sources,
|
||||
'dependencies' : common_deps + [libmicrohttpd_cflags],
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-table.h"
|
||||
@@ -287,6 +288,9 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_free_ char *message = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBQRENCODE_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
|
||||
@@ -70,7 +70,7 @@ int action_setup_keys(void) {
|
||||
|
||||
assert(arg_action == ACTION_SETUP_KEYS);
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "build.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "extract-word.h"
|
||||
#include "format-table.h"
|
||||
#include "glob-util.h"
|
||||
@@ -1021,6 +1022,14 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_strv_free_ char **args = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBPCRE2_NOTE(suggested);
|
||||
LIBQRENCODE_NOTE(suggested);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "sd-event.h"
|
||||
#include "sd-messages.h"
|
||||
|
||||
#include "dlopen-note.h"
|
||||
#include "format-util.h"
|
||||
#include "journal-authenticate.h"
|
||||
#include "journald-kmsg.h"
|
||||
@@ -25,6 +26,12 @@ static int run(int argc, char *argv[]) {
|
||||
LogTarget log_target;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBPCRE2_NOTE(suggested);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
if (argc > 2)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program takes one or no arguments.");
|
||||
|
||||
|
||||
+1
-10
@@ -68,15 +68,6 @@ journalctl_sources = files(
|
||||
'journalctl-varlink-server.c',
|
||||
)
|
||||
|
||||
if get_option('link-journalctl-shared')
|
||||
journalctl_link_with = [libshared]
|
||||
else
|
||||
journalctl_link_with = [
|
||||
libshared_static,
|
||||
libsystemd_static,
|
||||
]
|
||||
endif
|
||||
|
||||
journal_test_template = test_template + {
|
||||
'import' : ['systemd-journald'],
|
||||
}
|
||||
@@ -123,7 +114,6 @@ executables += [
|
||||
'name' : 'journalctl',
|
||||
'public' : true,
|
||||
'sources' : journalctl_sources,
|
||||
'link_with' : journalctl_link_with,
|
||||
'dependencies' : [
|
||||
liblz4_cflags,
|
||||
libopenssl_cflags,
|
||||
@@ -131,6 +121,7 @@ executables += [
|
||||
libxz_cflags,
|
||||
libzstd_cflags,
|
||||
],
|
||||
'install' : get_option('link-journalctl-shared') ? 'yes' : 'static',
|
||||
},
|
||||
journal_test_template + {
|
||||
'sources' : files('test-audit-type.c'),
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "chase.h"
|
||||
#include "conf-files.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "exec-util.h"
|
||||
@@ -1664,6 +1665,11 @@ static int parse_argv(int argc, char *argv[], char ***remaining_args) {
|
||||
static int run(int argc, char* argv[]) {
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
char **args = NULL;
|
||||
|
||||
@@ -233,7 +233,7 @@ static int verb_extract_public(int argc, char *argv[], uintptr_t _data, void *us
|
||||
return r;
|
||||
}
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ static Compression getenv_compression(void) {
|
||||
return DEFAULT_COMPRESSION;
|
||||
}
|
||||
|
||||
if (!compression_supported(c)) {
|
||||
if (!compression_supported_journal(c)) {
|
||||
log_debug("Unsupported compression algorithm specified, ignoring: %s", e);
|
||||
return DEFAULT_COMPRESSION;
|
||||
}
|
||||
@@ -1861,7 +1861,7 @@ static int maybe_compress_payload(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = compress_blob(c, src, size, dst, size - 1, rsize, /* level= */ -1);
|
||||
r = compress_blob_journal(c, src, size, dst, size - 1, rsize, /* level= */ -1);
|
||||
if (r < 0)
|
||||
return log_debug_errno(r, "Failed to compress data object using %s, ignoring: %m", compression_to_string(c));
|
||||
|
||||
@@ -1983,7 +1983,7 @@ static int maybe_decompress_payload(
|
||||
int r;
|
||||
|
||||
if (field) {
|
||||
r = decompress_startswith(compression, payload, size, &f->compress_buffer, field,
|
||||
r = decompress_startswith_journal(compression, payload, size, &f->compress_buffer, field,
|
||||
field_length, '=');
|
||||
if (r < 0)
|
||||
return log_debug_errno(r,
|
||||
@@ -2003,7 +2003,7 @@ static int maybe_decompress_payload(
|
||||
return 1;
|
||||
}
|
||||
|
||||
r = decompress_blob(compression, payload, size, &f->compress_buffer, &rsize, DATA_SIZE_MAX);
|
||||
r = decompress_blob_journal(compression, payload, size, &f->compress_buffer, &rsize, DATA_SIZE_MAX);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ static int hash_payload(JournalFile *f, Object *o, uint64_t offset, const uint8_
|
||||
_cleanup_free_ void *b = NULL;
|
||||
size_t b_size;
|
||||
|
||||
r = decompress_blob(c, src, size, &b, &b_size, DATA_SIZE_MAX);
|
||||
r = decompress_blob_journal(c, src, size, &b, &b_size, DATA_SIZE_MAX);
|
||||
if (r < 0) {
|
||||
error_errno(offset, r, "%s decompression failed: %m",
|
||||
compression_to_string(c));
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "bus-util.h"
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "hashmap.h"
|
||||
#include "label-util.h"
|
||||
#include "localed-util.h"
|
||||
@@ -632,6 +633,8 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
|
||||
int r;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = service_parse_argv("systemd-localed.service",
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "sd-dlopen.h"
|
||||
|
||||
#include "dlfcn-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "log.h"
|
||||
#include "string-util.h"
|
||||
#include "xkbcommon-util.h"
|
||||
@@ -14,13 +13,11 @@ DLSYM_PROTOTYPE(xkb_context_set_log_fn) = NULL;
|
||||
DLSYM_PROTOTYPE(xkb_keymap_new_from_names) = NULL;
|
||||
DLSYM_PROTOTYPE(xkb_keymap_unref) = NULL;
|
||||
|
||||
_dlopen_loader_
|
||||
static int dlopen_xkbcommon(int log_level) {
|
||||
static void *xkbcommon_dl = NULL;
|
||||
|
||||
SD_ELF_NOTE_DLOPEN(
|
||||
"xkbcommon",
|
||||
"Support for keyboard locale descriptions",
|
||||
SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, "libxkbcommon.so.0");
|
||||
LIBXKBCOMMON_NOTE(suggested);
|
||||
|
||||
return dlopen_many_sym_or_warn(
|
||||
&xkbcommon_dl, "libxkbcommon.so.0", log_level,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "bus-util.h"
|
||||
#include "cgroup-show.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "format-table.h"
|
||||
#include "format-util.h"
|
||||
#include "help-util.h"
|
||||
@@ -1661,6 +1662,8 @@ static int run(int argc, char *argv[]) {
|
||||
char **args = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "device-util.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
@@ -1351,6 +1352,10 @@ static int run(int argc, char *argv[]) {
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_message = NULL;
|
||||
int r;
|
||||
|
||||
LIBACL_NOTE(recommended);
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_set_facility(LOG_AUTH);
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -1807,7 +1807,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||
|
||||
assert(pamh);
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
@@ -1915,7 +1915,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
|
||||
|
||||
assert(pamh);
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ _public_ PAM_EXTERN int pam_sm_authenticate(
|
||||
|
||||
assert(pamh);
|
||||
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBPAM(LOG_DEBUG, required);
|
||||
if (r < 0)
|
||||
return PAM_SERVICE_ERR;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "bus-error.h"
|
||||
#include "bus-locator.h"
|
||||
#include "devnum-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
@@ -327,6 +328,9 @@ static int do_tmpfs_quota(UserRecord *ur) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
if (argc != 3)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "format-table.h"
|
||||
#include "id128-util.h"
|
||||
#include "image-policy.h"
|
||||
@@ -131,6 +132,12 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(umount_and_freep) char *mounted_dir = NULL;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "bus-wait-for-jobs.h"
|
||||
#include "cgroup-show.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "edit-util.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -2634,6 +2635,9 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_strv_free_ char **args = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "hash-funcs.h"
|
||||
@@ -347,6 +348,12 @@ static int run(int argc, char *argv[]) {
|
||||
RuntimeScope scope = RUNTIME_SCOPE_SYSTEM;
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_set_facility(LOG_AUTH);
|
||||
log_setup();
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "ask-password-api.h"
|
||||
#include "build.h"
|
||||
#include "crypto-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "efi-loader.h"
|
||||
#include "efivars.h"
|
||||
#include "fd-util.h"
|
||||
@@ -178,7 +179,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
|
||||
"Select TPM bank (SHA1, SHA256, SHA384, SHA512)"): {
|
||||
const EVP_MD *implementation;
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1130,6 +1131,8 @@ static int verb_policy_digest(int argc, char *argv[], uintptr_t _data, void *use
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
TPM2_NOTE(suggested);
|
||||
|
||||
log_setup();
|
||||
|
||||
char **args = NULL;
|
||||
@@ -1137,7 +1140,7 @@ static int run(int argc, char *argv[]) {
|
||||
if (r <= 0)
|
||||
return r;
|
||||
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
|
||||
r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "conf-files.h"
|
||||
#include "constants.h"
|
||||
#include "cpu-set-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@@ -390,6 +391,8 @@ static int run(int argc, char *argv[]) {
|
||||
char *module;
|
||||
int ret = 0, r;
|
||||
|
||||
LIBKMOD_NOTE(required);
|
||||
|
||||
char **args = NULL;
|
||||
r = parse_argv(argc, argv, &args);
|
||||
if (r <= 0)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "chase.h"
|
||||
#include "device-private.h"
|
||||
#include "device-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
@@ -1479,6 +1480,8 @@ static int run(int argc, char* argv[]) {
|
||||
char **args = NULL;
|
||||
int r;
|
||||
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv, &args);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "chase.h"
|
||||
#include "discover-image.h"
|
||||
#include "dissect-image.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
@@ -1489,6 +1490,11 @@ static int run(int argc, char *argv[]) {
|
||||
unsigned n_iterations = 0;
|
||||
int m, listen_fd, r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
m = sd_listen_fds(false);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "argv-util.h"
|
||||
#include "build.h"
|
||||
#include "chase.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
@@ -376,6 +377,11 @@ static int umount_mstack(void) {
|
||||
static int run(int argc, char *argv[]) {
|
||||
int r;
|
||||
|
||||
LIBBLKID_NOTE(recommended);
|
||||
LIBCRYPTO_NOTE(suggested);
|
||||
LIBCRYPTSETUP_NOTE(suggested);
|
||||
LIBMOUNT_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
if (invoked_as(argv, "mount.mstack"))
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "creds-util.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
@@ -197,6 +198,8 @@ static int run(int argc, char *argv[]) {
|
||||
_cleanup_(context_clear) Context context = {};
|
||||
int r, ret = 0;
|
||||
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
umask(0022);
|
||||
|
||||
+8
-14
@@ -163,19 +163,12 @@ netdev_gperf_c = custom_target(
|
||||
generated_sources += [networkd_gperf_c, networkd_network_gperf_c, netdev_gperf_c]
|
||||
systemd_networkd_export_sources += [networkd_gperf_c, networkd_network_gperf_c, netdev_gperf_c]
|
||||
|
||||
if get_option('link-networkd-shared')
|
||||
networkd_link_with = [libshared]
|
||||
else
|
||||
networkd_link_with = [libsystemd_static,
|
||||
libshared_static]
|
||||
endif
|
||||
|
||||
network_includes = [include_directories(['.', 'netdev', 'tc']), libsystemd_network_includes]
|
||||
|
||||
network_test_template = test_template + {
|
||||
'conditions' : ['ENABLE_NETWORKD'],
|
||||
'link_with' : [
|
||||
networkd_link_with,
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
],
|
||||
'import' : ['systemd-networkd'],
|
||||
@@ -185,7 +178,7 @@ network_test_template = test_template + {
|
||||
network_fuzz_template = fuzz_template + {
|
||||
'conditions' : ['ENABLE_NETWORKD'],
|
||||
'link_with' : [
|
||||
networkd_link_with,
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
],
|
||||
'import' : ['systemd-networkd'],
|
||||
@@ -201,8 +194,8 @@ executables += [
|
||||
'export' : systemd_networkd_export_sources,
|
||||
'include_directories' : network_includes,
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
networkd_link_with,
|
||||
],
|
||||
'dependencies' : [
|
||||
libbpf_cflags,
|
||||
@@ -210,13 +203,14 @@ executables += [
|
||||
'bpf_programs': [
|
||||
'sysctl-monitor',
|
||||
],
|
||||
'install' : get_option('link-networkd-shared') ? 'yes' : 'static',
|
||||
},
|
||||
libexec_template + {
|
||||
'name' : 'systemd-networkd-wait-online',
|
||||
'public' : true,
|
||||
'conditions' : ['ENABLE_NETWORKD'],
|
||||
'sources' : systemd_networkd_wait_online_sources,
|
||||
'link_with' : networkd_link_with,
|
||||
'install' : get_option('link-networkd-shared') ? 'yes' : 'static',
|
||||
},
|
||||
executable_template + {
|
||||
'name' : 'networkctl',
|
||||
@@ -225,18 +219,19 @@ executables += [
|
||||
'sources' : networkctl_sources,
|
||||
'include_directories' : libsystemd_network_includes,
|
||||
'link_with' : [
|
||||
libshared,
|
||||
libsystemd_network,
|
||||
networkd_link_with,
|
||||
],
|
||||
'dependencies' : [
|
||||
libselinux_cflags,
|
||||
],
|
||||
'install' : get_option('link-networkd-shared') ? 'yes' : 'static',
|
||||
},
|
||||
libexec_template + {
|
||||
'name' : 'systemd-network-generator',
|
||||
'sources' : files('generator/network-generator-main.c'),
|
||||
'export' : files('generator/network-generator.c'),
|
||||
'link_with' : networkd_link_with,
|
||||
'install' : get_option('link-networkd-shared') ? 'yes' : 'static',
|
||||
},
|
||||
test_template + {
|
||||
'sources' : files('generator/test-network-generator.c'),
|
||||
@@ -263,7 +258,6 @@ executables += [
|
||||
test_template + {
|
||||
'sources' : files('test-modem-manager-mock.c'),
|
||||
'conditions' : ['ENABLE_NETWORKD'],
|
||||
'link_with' : [libshared],
|
||||
'type' : 'manual',
|
||||
},
|
||||
network_fuzz_template + {
|
||||
|
||||
@@ -1044,7 +1044,7 @@ int netdev_load_one(Manager *manager, const char *filename, NetDev **ret) {
|
||||
return r; /* config_parse_many() logs internally. */
|
||||
|
||||
/* skip out early if configuration does not match the environment */
|
||||
if (!condition_test_list(netdev_raw->conditions, environ, NULL, NULL, NULL))
|
||||
if (!condition_test_list_net(netdev_raw->conditions, environ, NULL, NULL, NULL))
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(ESTALE), "%s: Conditions in the file do not match the system environment, skipping.", filename);
|
||||
|
||||
if (netdev_raw->kind == _NETDEV_KIND_INVALID)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "dlopen-note.h"
|
||||
#include "format-table.h"
|
||||
#include "help-util.h"
|
||||
#include "log.h"
|
||||
@@ -208,6 +209,9 @@ static int run(int argc, char* argv[]) {
|
||||
char **args = NULL;
|
||||
int r;
|
||||
|
||||
COMPRESS_JOURNAL_NOTE;
|
||||
LIBSELINUX_NOTE(recommended);
|
||||
|
||||
log_setup();
|
||||
|
||||
r = parse_argv(argc, argv, &args);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user