]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/elf-util.h
cryptenroll: allow to use a public key on a token
[thirdparty/systemd.git] / src / shared / elf-util.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
8d4e028f
LP
2#pragma once
3
95f71807
LB
4#include "json.h"
5
889f2529 6#if HAVE_ELFUTILS
ee48779e
DDM
7int dlopen_dw(void);
8int dlopen_elf(void);
9
61aea456
LB
10/* Parse an ELF object in a forked process, so that errors while iterating over
11 * untrusted and potentially malicious data do not propagate to the main caller's process.
12 * If fork_disable_dump, the child process will not dump core if it crashes. */
13int parse_elf_object(int fd, const char *executable, bool fork_disable_dump, char **ret, JsonVariant **ret_package_metadata);
889f2529
LB
14#else
15static inline int parse_elf_object(int fd, const char *executable, bool fork_disable_dump, char **ret, JsonVariant **ret_package_metadata) {
16 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "elfutils disabled, parsing ELF objects not supported");
17}
18#endif