mirror of
https://github.com/systemd/systemd.git
synced 2025-03-25 18:50:18 +03:00
elf-util: add stub for builds without libdw
This commit is contained in:
parent
5564c6d802
commit
889f252973
@ -813,7 +813,6 @@ static int submit_coredump(
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to drop privileges: %m");
|
||||
|
||||
#if HAVE_ELFUTILS
|
||||
/* Try to get a stack trace if we can */
|
||||
if (coredump_size > arg_process_size_max) {
|
||||
log_debug("Not generating stack trace: core size %"PRIu64" is greater "
|
||||
@ -825,7 +824,6 @@ static int submit_coredump(
|
||||
/* fork_disable_dump= */endswith(context->meta[META_EXE], "systemd-coredump"), /* avoid loops */
|
||||
&stacktrace,
|
||||
&json_metadata);
|
||||
#endif
|
||||
|
||||
log:
|
||||
core_message = strjoina("Process ", context->meta[META_ARGV_PID],
|
||||
|
@ -3,7 +3,13 @@
|
||||
|
||||
#include "json.h"
|
||||
|
||||
#if HAVE_ELFUTILS
|
||||
/* Parse an ELF object in a forked process, so that errors while iterating over
|
||||
* untrusted and potentially malicious data do not propagate to the main caller's process.
|
||||
* If fork_disable_dump, the child process will not dump core if it crashes. */
|
||||
int parse_elf_object(int fd, const char *executable, bool fork_disable_dump, char **ret, JsonVariant **ret_package_metadata);
|
||||
#else
|
||||
static inline int parse_elf_object(int fd, const char *executable, bool fork_disable_dump, char **ret, JsonVariant **ret_package_metadata) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "elfutils disabled, parsing ELF objects not supported");
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user