Merge pull request #25291 from keszybz/util-cleanup
Split/rename util.c+h and def.h
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <getopt.h>
|
||||
|
||||
#include "build.h"
|
||||
#include "main-func.h"
|
||||
#include "udev-util.h"
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "sd-daemon.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
@@ -23,7 +24,6 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static char **arg_listen = NULL;
|
||||
static bool arg_accept = false;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "analyze.h"
|
||||
#include "analyze-cat-config.h"
|
||||
#include "conf-files.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "nulstr-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pretty-print.h"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "analyze-unit-paths.h"
|
||||
#include "analyze-compare-versions.h"
|
||||
#include "analyze-verify.h"
|
||||
#include "build.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-locator.h"
|
||||
#include "bus-map-properties.h"
|
||||
@@ -46,7 +47,7 @@
|
||||
#include "capability-util.h"
|
||||
#include "conf-files.h"
|
||||
#include "copy.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "exit-status.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
@@ -79,7 +80,6 @@
|
||||
#include "time-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
#include "verb-log-control.h"
|
||||
#include "verbs.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ask-password-api.h"
|
||||
#include "def.h"
|
||||
#include "build.h"
|
||||
#include "constants.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "main-func.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#define PCI_CLASS_GRAPHICS_CARD 0x30000
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <endian.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "util.h"
|
||||
|
||||
/* A cleaned up architecture definition. We don't want to get lost in
|
||||
* processor features, models, generations or even ABIs. Hence we
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <sched.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "argv-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "missing_sched.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
|
||||
int saved_argc = 0;
|
||||
char **saved_argv = NULL;
|
||||
|
||||
bool invoked_as(char *argv[], const char *token) {
|
||||
if (!argv || isempty(argv[0]))
|
||||
return false;
|
||||
|
||||
if (isempty(token))
|
||||
return false;
|
||||
|
||||
return strstr(last_path_component(argv[0]), token);
|
||||
}
|
||||
|
||||
bool invoked_by_systemd(void) {
|
||||
int r;
|
||||
|
||||
/* If the process is directly executed by PID1 (e.g. ExecStart= or generator), systemd-importd,
|
||||
* or systemd-homed, then $SYSTEMD_EXEC_PID= is set, and read the command line. */
|
||||
const char *e = getenv("SYSTEMD_EXEC_PID");
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
if (streq(e, "*"))
|
||||
/* For testing. */
|
||||
return true;
|
||||
|
||||
pid_t p;
|
||||
r = parse_pid(e, &p);
|
||||
if (r < 0) {
|
||||
/* We know that systemd sets the variable correctly. Something else must have set it. */
|
||||
log_debug_errno(r, "Failed to parse \"SYSTEMD_EXEC_PID=%s\", ignoring: %m", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return getpid_cached() == p;
|
||||
}
|
||||
|
||||
bool argv_looks_like_help(int argc, char **argv) {
|
||||
char **l;
|
||||
|
||||
/* Scans the command line for indications the user asks for help. This is supposed to be called by
|
||||
* tools that do not implement getopt() style command line parsing because they are not primarily
|
||||
* user-facing. Detects four ways of asking for help:
|
||||
*
|
||||
* 1. Passing zero arguments
|
||||
* 2. Passing "help" as first argument
|
||||
* 3. Passing --help as any argument
|
||||
* 4. Passing -h as any argument
|
||||
*/
|
||||
|
||||
if (argc <= 1)
|
||||
return true;
|
||||
|
||||
if (streq_ptr(argv[1], "help"))
|
||||
return true;
|
||||
|
||||
l = strv_skip(argv, 1);
|
||||
|
||||
return strv_contains(l, "--help") ||
|
||||
strv_contains(l, "-h");
|
||||
}
|
||||
|
||||
static int update_argv(const char name[], size_t l) {
|
||||
static int can_do = -1;
|
||||
|
||||
if (can_do == 0)
|
||||
return 0;
|
||||
can_do = false; /* We'll set it to true only if the whole process works */
|
||||
|
||||
/* Let's not bother with this if we don't have euid == 0. Strictly speaking we should check for the
|
||||
* CAP_SYS_RESOURCE capability which is independent of the euid. In our own code the capability generally is
|
||||
* present only for euid == 0, hence let's use this as quick bypass check, to avoid calling mmap() if
|
||||
* PR_SET_MM_ARG_{START,END} fails with EPERM later on anyway. After all geteuid() is dead cheap to call, but
|
||||
* mmap() is not. */
|
||||
if (geteuid() != 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EPERM),
|
||||
"Skipping PR_SET_MM, as we don't have privileges.");
|
||||
|
||||
static size_t mm_size = 0;
|
||||
static char *mm = NULL;
|
||||
int r;
|
||||
|
||||
if (mm_size < l+1) {
|
||||
size_t nn_size;
|
||||
char *nn;
|
||||
|
||||
nn_size = PAGE_ALIGN(l+1);
|
||||
nn = mmap(NULL, nn_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
||||
if (nn == MAP_FAILED)
|
||||
return log_debug_errno(errno, "mmap() failed: %m");
|
||||
|
||||
strncpy(nn, name, nn_size);
|
||||
|
||||
/* Now, let's tell the kernel about this new memory */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_START, (unsigned long) nn, 0, 0) < 0) {
|
||||
if (ERRNO_IS_PRIVILEGE(errno))
|
||||
return log_debug_errno(errno, "PR_SET_MM_ARG_START failed: %m");
|
||||
|
||||
/* HACK: prctl() API is kind of dumb on this point. The existing end address may already be
|
||||
* below the desired start address, in which case the kernel may have kicked this back due
|
||||
* to a range-check failure (see linux/kernel/sys.c:validate_prctl_map() to see this in
|
||||
* action). The proper solution would be to have a prctl() API that could set both start+end
|
||||
* simultaneously, or at least let us query the existing address to anticipate this condition
|
||||
* and respond accordingly. For now, we can only guess at the cause of this failure and try
|
||||
* a workaround--which will briefly expand the arg space to something potentially huge before
|
||||
* resizing it to what we want. */
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_START failed, attempting PR_SET_MM_ARG_END hack: %m");
|
||||
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) nn + l + 1, 0, 0) < 0) {
|
||||
r = log_debug_errno(errno, "PR_SET_MM_ARG_END hack failed, proceeding without: %m");
|
||||
(void) munmap(nn, nn_size);
|
||||
return r;
|
||||
}
|
||||
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_START, (unsigned long) nn, 0, 0) < 0)
|
||||
return log_debug_errno(errno, "PR_SET_MM_ARG_START still failed, proceeding without: %m");
|
||||
} else {
|
||||
/* And update the end pointer to the new end, too. If this fails, we don't really know what
|
||||
* to do, it's pretty unlikely that we can rollback, hence we'll just accept the failure,
|
||||
* and continue. */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) nn + l + 1, 0, 0) < 0)
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_END failed, proceeding without: %m");
|
||||
}
|
||||
|
||||
if (mm)
|
||||
(void) munmap(mm, mm_size);
|
||||
|
||||
mm = nn;
|
||||
mm_size = nn_size;
|
||||
} else {
|
||||
strncpy(mm, name, mm_size);
|
||||
|
||||
/* Update the end pointer, continuing regardless of any failure. */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) mm + l + 1, 0, 0) < 0)
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_END failed, proceeding without: %m");
|
||||
}
|
||||
|
||||
can_do = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rename_process(const char name[]) {
|
||||
bool truncated = false;
|
||||
|
||||
/* This is a like a poor man's setproctitle(). It changes the comm field, argv[0], and also the glibc's
|
||||
* internally used name of the process. For the first one a limit of 16 chars applies; to the second one in
|
||||
* many cases one of 10 (i.e. length of "/sbin/init") — however if we have CAP_SYS_RESOURCES it is unbounded;
|
||||
* to the third one 7 (i.e. the length of "systemd". If you pass a longer string it will likely be
|
||||
* truncated.
|
||||
*
|
||||
* Returns 0 if a name was set but truncated, > 0 if it was set but not truncated. */
|
||||
|
||||
if (isempty(name))
|
||||
return -EINVAL; /* let's not confuse users unnecessarily with an empty name */
|
||||
|
||||
if (!is_main_thread())
|
||||
return -EPERM; /* Let's not allow setting the process name from other threads than the main one, as we
|
||||
* cache things without locking, and we make assumptions that PR_SET_NAME sets the
|
||||
* process name that isn't correct on any other threads */
|
||||
|
||||
size_t l = strlen(name);
|
||||
|
||||
/* First step, change the comm field. The main thread's comm is identical to the process comm. This means we
|
||||
* can use PR_SET_NAME, which sets the thread name for the calling thread. */
|
||||
if (prctl(PR_SET_NAME, name) < 0)
|
||||
log_debug_errno(errno, "PR_SET_NAME failed: %m");
|
||||
if (l >= TASK_COMM_LEN) /* Linux userspace process names can be 15 chars at max */
|
||||
truncated = true;
|
||||
|
||||
/* Second step, change glibc's ID of the process name. */
|
||||
if (program_invocation_name) {
|
||||
size_t k;
|
||||
|
||||
k = strlen(program_invocation_name);
|
||||
strncpy(program_invocation_name, name, k);
|
||||
if (l > k)
|
||||
truncated = true;
|
||||
}
|
||||
|
||||
/* Third step, completely replace the argv[] array the kernel maintains for us. This requires privileges, but
|
||||
* has the advantage that the argv[] array is exactly what we want it to be, and not filled up with zeros at
|
||||
* the end. This is the best option for changing /proc/self/cmdline. */
|
||||
(void) update_argv(name, l);
|
||||
|
||||
/* Fourth step: in all cases we'll also update the original argv[], so that our own code gets it right too if
|
||||
* it still looks here */
|
||||
if (saved_argc > 0) {
|
||||
if (saved_argv[0]) {
|
||||
size_t k;
|
||||
|
||||
k = strlen(saved_argv[0]);
|
||||
strncpy(saved_argv[0], name, k);
|
||||
if (l > k)
|
||||
truncated = true;
|
||||
}
|
||||
|
||||
for (int i = 1; i < saved_argc; i++) {
|
||||
if (!saved_argv[i])
|
||||
break;
|
||||
|
||||
memzero(saved_argv[i], strlen(saved_argv[i]));
|
||||
}
|
||||
}
|
||||
|
||||
return !truncated;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
extern int saved_argc;
|
||||
extern char **saved_argv;
|
||||
|
||||
static inline void save_argc_argv(int argc, char **argv) {
|
||||
/* Protect against CVE-2021-4034 style attacks */
|
||||
assert_se(argc > 0);
|
||||
assert_se(argv);
|
||||
assert_se(argv[0]);
|
||||
|
||||
saved_argc = argc;
|
||||
saved_argv = argv;
|
||||
}
|
||||
|
||||
bool invoked_as(char *argv[], const char *token);
|
||||
bool invoked_by_systemd(void);
|
||||
bool argv_looks_like_help(int argc, char **argv);
|
||||
|
||||
int rename_process(const char name[]);
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "macro.h"
|
||||
#include "process-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int asynchronous_job(void* (*func)(void *p), void *arg) {
|
||||
sigset_t ss, saved_ss;
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "build.h"
|
||||
#include "macro.h"
|
||||
#include "version.h"
|
||||
|
||||
const char* const systemd_features =
|
||||
|
||||
@@ -226,3 +230,9 @@ const char* const systemd_features =
|
||||
|
||||
" default-hierarchy=" DEFAULT_HIERARCHY_NAME
|
||||
;
|
||||
|
||||
int version(void) {
|
||||
printf("systemd " STRINGIFY(PROJECT_VERSION) " (" GIT_VERSION ")\n%s\n",
|
||||
systemd_features);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4,3 +4,5 @@
|
||||
#include "version.h"
|
||||
|
||||
extern const char* const systemd_features;
|
||||
|
||||
int version(void);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static const struct capability_name* lookup_capability(register const char *str, register GPERF_LEN_TYPE len);
|
||||
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
#include "cap-list.h"
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
#include "logarithm.h"
|
||||
#include "macro.h"
|
||||
#include "missing_prctl.h"
|
||||
#include "parse-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int have_effective_cap(int value) {
|
||||
_cleanup_cap_free_ cap_t cap = NULL;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "macro.h"
|
||||
#include "missing_capability.h"
|
||||
#include "util.h"
|
||||
|
||||
#define CAP_ALL UINT64_MAX
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "dirent-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <sys/statfs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "set.h"
|
||||
|
||||
#define SYSTEMD_CGROUP_CONTROLLER_LEGACY "name=systemd"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "unaligned.h"
|
||||
#include "util.h"
|
||||
|
||||
#if HAVE_LZ4
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(LZ4F_compressionContext_t, LZ4F_freeCompressionContext, NULL);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "chase-symlinks.h"
|
||||
#include "conf-files.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "dirent-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "hashmap.h"
|
||||
|
||||
@@ -1,6 +1,30 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(memory_sanitizer)
|
||||
# define HAS_FEATURE_MEMORY_SANITIZER 1
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(HAS_FEATURE_MEMORY_SANITIZER)
|
||||
# define HAS_FEATURE_MEMORY_SANITIZER 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
|
||||
# ifdef __SANITIZE_ADDRESS__
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 1
|
||||
# elif defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 1
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define DEFAULT_TIMEOUT_USEC (90*USEC_PER_SEC)
|
||||
#define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
|
||||
#define DEFAULT_CONFIRM_USEC (30*USEC_PER_SEC)
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "stat-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
/* The maximum number of iterations in the loop to close descriptors in the fallback case
|
||||
* when /proc/self/fd/ is inaccessible. */
|
||||
|
||||
@@ -27,7 +27,7 @@ int fs_type_from_string(const char *name, const statfs_f_type_t **ret) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fs_in_group(const struct statfs *s, FilesystemGroups fs_group) {
|
||||
bool fs_in_group(const struct statfs *s, FilesystemGroups fs_group) {
|
||||
const char *fs;
|
||||
int r;
|
||||
|
||||
@@ -35,7 +35,7 @@ int fs_in_group(const struct statfs *s, FilesystemGroups fs_group) {
|
||||
const statfs_f_type_t *magic;
|
||||
|
||||
r = fs_type_from_string(fs, &magic);
|
||||
if (r == 0) {
|
||||
if (r >= 0)
|
||||
for (size_t i = 0; i < FILESYSTEM_MAGIC_MAX; i++) {
|
||||
if (magic[i] == 0)
|
||||
break;
|
||||
@@ -43,7 +43,6 @@ int fs_in_group(const struct statfs *s, FilesystemGroups fs_group) {
|
||||
if (is_fs_type(s, magic[i]))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -36,7 +36,7 @@ const FilesystemSet *filesystem_set_find(const char *name);
|
||||
|
||||
const char *fs_type_to_string(statfs_f_type_t magic);
|
||||
int fs_type_from_string(const char *name, const statfs_f_type_t **ret);
|
||||
int fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group);
|
||||
bool fs_in_group(const struct statfs *s, enum FilesystemGroups fs_group);
|
||||
|
||||
/* gperf prototypes */
|
||||
const struct FilesystemMagic* filesystems_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "tmpfile-util.h"
|
||||
#include "umask-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int unlink_noerrno(const char *path) {
|
||||
PROTECT_ERRNO;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "fileio.h"
|
||||
#include "hashmap.h"
|
||||
#include "logarithm.h"
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
#include "mempool.h"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "hash-funcs.h"
|
||||
#include "macro.h"
|
||||
#include "util.h"
|
||||
|
||||
/*
|
||||
* A hash table implementation. As a minor optimization a NULL hashmap object
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
#include "alloc-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "logarithm.h"
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "random-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strxcpyx.h"
|
||||
#include "util.h"
|
||||
|
||||
bool in4_addr_is_null(const struct in_addr *a) {
|
||||
assert(a);
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "hash-funcs.h"
|
||||
#include "macro.h"
|
||||
#include "util.h"
|
||||
|
||||
union in_addr_union {
|
||||
struct in_addr in;
|
||||
|
||||
@@ -1,46 +1,15 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "hostname-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "initrd-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
int saved_argc = 0;
|
||||
char **saved_argv = NULL;
|
||||
static int saved_in_initrd = -1;
|
||||
|
||||
int prot_from_flags(int flags) {
|
||||
|
||||
switch (flags & O_ACCMODE) {
|
||||
|
||||
case O_RDONLY:
|
||||
return PROT_READ;
|
||||
|
||||
case O_WRONLY:
|
||||
return PROT_WRITE;
|
||||
|
||||
case O_RDWR:
|
||||
return PROT_READ|PROT_WRITE;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bool in_initrd(void) {
|
||||
int r;
|
||||
const char *e;
|
||||
@@ -104,62 +73,3 @@ bool in_initrd(void) {
|
||||
void in_initrd_force(bool value) {
|
||||
saved_in_initrd = value;
|
||||
}
|
||||
|
||||
int container_get_leader(const char *machine, pid_t *pid) {
|
||||
_cleanup_free_ char *s = NULL, *class = NULL;
|
||||
const char *p;
|
||||
pid_t leader;
|
||||
int r;
|
||||
|
||||
assert(machine);
|
||||
assert(pid);
|
||||
|
||||
if (streq(machine, ".host")) {
|
||||
*pid = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!hostname_is_valid(machine, 0))
|
||||
return -EINVAL;
|
||||
|
||||
p = strjoina("/run/systemd/machines/", machine);
|
||||
r = parse_env_file(NULL, p,
|
||||
"LEADER", &s,
|
||||
"CLASS", &class);
|
||||
if (r == -ENOENT)
|
||||
return -EHOSTDOWN;
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (!s)
|
||||
return -EIO;
|
||||
|
||||
if (!streq_ptr(class, "container"))
|
||||
return -EIO;
|
||||
|
||||
r = parse_pid(s, &leader);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (leader <= 1)
|
||||
return -EIO;
|
||||
|
||||
*pid = leader;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int version(void) {
|
||||
printf("systemd " STRINGIFY(PROJECT_VERSION) " (" GIT_VERSION ")\n%s\n",
|
||||
systemd_features);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Turn off core dumps but only if we're running outside of a container. */
|
||||
void disable_coredumps(void) {
|
||||
int r;
|
||||
|
||||
if (detect_container() > 0)
|
||||
return;
|
||||
|
||||
r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
bool in_initrd(void);
|
||||
void in_initrd_force(bool value);
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "dirent-util.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "sd-messages.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "argv-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
|
||||
@@ -5,25 +5,6 @@
|
||||
|
||||
#include "macro.h"
|
||||
|
||||
extern int saved_argc;
|
||||
extern char **saved_argv;
|
||||
|
||||
static inline void save_argc_argv(int argc, char **argv) {
|
||||
|
||||
/* Protect against CVE-2021-4034 style attacks */
|
||||
assert_se(argc > 0);
|
||||
assert_se(argv);
|
||||
assert_se(argv[0]);
|
||||
|
||||
saved_argc = argc;
|
||||
saved_argv = argv;
|
||||
}
|
||||
|
||||
int prot_from_flags(int flags) _const_;
|
||||
|
||||
bool in_initrd(void);
|
||||
void in_initrd_force(bool value);
|
||||
|
||||
/* Note: log2(0) == log2(1) == 0 here and below. */
|
||||
|
||||
#define CONST_LOG2ULL(x) ((x) > 1 ? (unsigned) __builtin_clzll(x) ^ 63U : 0)
|
||||
@@ -70,9 +51,3 @@ static inline unsigned log2u_round_up(unsigned x) {
|
||||
|
||||
return log2u(x - 1) + 1;
|
||||
}
|
||||
|
||||
int container_get_leader(const char *machine, pid_t *pid);
|
||||
|
||||
int version(void);
|
||||
|
||||
void disable_coredumps(void);
|
||||
+1
-24
@@ -9,32 +9,9 @@
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "constants.h"
|
||||
#include "macro-fundamental.h"
|
||||
|
||||
#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
|
||||
# if defined(__has_feature)
|
||||
# if __has_feature(memory_sanitizer)
|
||||
# define HAS_FEATURE_MEMORY_SANITIZER 1
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(HAS_FEATURE_MEMORY_SANITIZER)
|
||||
# define HAS_FEATURE_MEMORY_SANITIZER 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
|
||||
# ifdef __SANITIZE_ADDRESS__
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 1
|
||||
# elif defined(__has_feature)
|
||||
# if __has_feature(address_sanitizer)
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 1
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
|
||||
# define HAS_FEATURE_ADDRESS_SANITIZER 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Note: on GCC "no_sanitize_address" is a function attribute only, on llvm it may also be applied to global
|
||||
* variables. We define a specific macro which knows this. Note that on GCC we don't need this decorator so much, since
|
||||
* our primary usecase for this attribute is registration structures placed in named ELF sections which shall not be
|
||||
|
||||
@@ -9,6 +9,8 @@ basic_sources = files(
|
||||
'alloc-util.h',
|
||||
'architecture.c',
|
||||
'architecture.h',
|
||||
'argv-util.c',
|
||||
'argv-util.h',
|
||||
'arphrd-util.c',
|
||||
'arphrd-util.h',
|
||||
'async.c',
|
||||
@@ -31,7 +33,7 @@ basic_sources = files(
|
||||
'chattr-util.h',
|
||||
'conf-files.c',
|
||||
'conf-files.h',
|
||||
'def.h',
|
||||
'constants.h',
|
||||
'devnum-util.c',
|
||||
'devnum-util.h',
|
||||
'dirent-util.c',
|
||||
@@ -80,6 +82,8 @@ basic_sources = files(
|
||||
'hostname-util.h',
|
||||
'in-addr-util.c',
|
||||
'in-addr-util.h',
|
||||
'initrd-util.c',
|
||||
'initrd-util.h',
|
||||
'inotify-util.c',
|
||||
'inotify-util.h',
|
||||
'io-util.c',
|
||||
@@ -126,6 +130,7 @@ basic_sources = files(
|
||||
'locale-util.h',
|
||||
'log.c',
|
||||
'log.h',
|
||||
'logarithm.h',
|
||||
'login-util.c',
|
||||
'login-util.h',
|
||||
'macro.h',
|
||||
@@ -254,8 +259,6 @@ basic_sources = files(
|
||||
'user-util.h',
|
||||
'utf8.c',
|
||||
'utf8.h',
|
||||
'util.c',
|
||||
'util.h',
|
||||
'virt.c',
|
||||
'virt.h',
|
||||
'xattr-util.c',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "macro.h"
|
||||
|
||||
typedef enum LookupPathsFlags {
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
#include "efivars.h"
|
||||
#include "extract-word.h"
|
||||
#include "fileio.h"
|
||||
#include "initrd-util.h"
|
||||
#include "macro.h"
|
||||
#include "parse-util.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "process-util.h"
|
||||
#include "special.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
int proc_cmdline(char **ret) {
|
||||
|
||||
+37
-197
@@ -8,7 +8,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/personality.h>
|
||||
#include <sys/prctl.h>
|
||||
@@ -22,12 +21,15 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "architecture.h"
|
||||
#include "argv-util.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "hostname-util.h"
|
||||
#include "locale-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
@@ -35,6 +37,7 @@
|
||||
#include "missing_sched.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "namespace-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "raw-clone.h"
|
||||
@@ -253,151 +256,47 @@ int get_process_cmdline(pid_t pid, size_t max_columns, ProcessCmdlineFlags flags
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int update_argv(const char name[], size_t l) {
|
||||
static int can_do = -1;
|
||||
|
||||
if (can_do == 0)
|
||||
return 0;
|
||||
can_do = false; /* We'll set it to true only if the whole process works */
|
||||
|
||||
/* Let's not bother with this if we don't have euid == 0. Strictly speaking we should check for the
|
||||
* CAP_SYS_RESOURCE capability which is independent of the euid. In our own code the capability generally is
|
||||
* present only for euid == 0, hence let's use this as quick bypass check, to avoid calling mmap() if
|
||||
* PR_SET_MM_ARG_{START,END} fails with EPERM later on anyway. After all geteuid() is dead cheap to call, but
|
||||
* mmap() is not. */
|
||||
if (geteuid() != 0)
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EPERM),
|
||||
"Skipping PR_SET_MM, as we don't have privileges.");
|
||||
|
||||
static size_t mm_size = 0;
|
||||
static char *mm = NULL;
|
||||
int container_get_leader(const char *machine, pid_t *pid) {
|
||||
_cleanup_free_ char *s = NULL, *class = NULL;
|
||||
const char *p;
|
||||
pid_t leader;
|
||||
int r;
|
||||
|
||||
if (mm_size < l+1) {
|
||||
size_t nn_size;
|
||||
char *nn;
|
||||
assert(machine);
|
||||
assert(pid);
|
||||
|
||||
nn_size = PAGE_ALIGN(l+1);
|
||||
nn = mmap(NULL, nn_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
|
||||
if (nn == MAP_FAILED)
|
||||
return log_debug_errno(errno, "mmap() failed: %m");
|
||||
|
||||
strncpy(nn, name, nn_size);
|
||||
|
||||
/* Now, let's tell the kernel about this new memory */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_START, (unsigned long) nn, 0, 0) < 0) {
|
||||
if (ERRNO_IS_PRIVILEGE(errno))
|
||||
return log_debug_errno(errno, "PR_SET_MM_ARG_START failed: %m");
|
||||
|
||||
/* HACK: prctl() API is kind of dumb on this point. The existing end address may already be
|
||||
* below the desired start address, in which case the kernel may have kicked this back due
|
||||
* to a range-check failure (see linux/kernel/sys.c:validate_prctl_map() to see this in
|
||||
* action). The proper solution would be to have a prctl() API that could set both start+end
|
||||
* simultaneously, or at least let us query the existing address to anticipate this condition
|
||||
* and respond accordingly. For now, we can only guess at the cause of this failure and try
|
||||
* a workaround--which will briefly expand the arg space to something potentially huge before
|
||||
* resizing it to what we want. */
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_START failed, attempting PR_SET_MM_ARG_END hack: %m");
|
||||
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) nn + l + 1, 0, 0) < 0) {
|
||||
r = log_debug_errno(errno, "PR_SET_MM_ARG_END hack failed, proceeding without: %m");
|
||||
(void) munmap(nn, nn_size);
|
||||
return r;
|
||||
}
|
||||
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_START, (unsigned long) nn, 0, 0) < 0)
|
||||
return log_debug_errno(errno, "PR_SET_MM_ARG_START still failed, proceeding without: %m");
|
||||
} else {
|
||||
/* And update the end pointer to the new end, too. If this fails, we don't really know what
|
||||
* to do, it's pretty unlikely that we can rollback, hence we'll just accept the failure,
|
||||
* and continue. */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) nn + l + 1, 0, 0) < 0)
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_END failed, proceeding without: %m");
|
||||
}
|
||||
|
||||
if (mm)
|
||||
(void) munmap(mm, mm_size);
|
||||
|
||||
mm = nn;
|
||||
mm_size = nn_size;
|
||||
} else {
|
||||
strncpy(mm, name, mm_size);
|
||||
|
||||
/* Update the end pointer, continuing regardless of any failure. */
|
||||
if (prctl(PR_SET_MM, PR_SET_MM_ARG_END, (unsigned long) mm + l + 1, 0, 0) < 0)
|
||||
log_debug_errno(errno, "PR_SET_MM_ARG_END failed, proceeding without: %m");
|
||||
if (streq(machine, ".host")) {
|
||||
*pid = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
can_do = true;
|
||||
if (!hostname_is_valid(machine, 0))
|
||||
return -EINVAL;
|
||||
|
||||
p = strjoina("/run/systemd/machines/", machine);
|
||||
r = parse_env_file(NULL, p,
|
||||
"LEADER", &s,
|
||||
"CLASS", &class);
|
||||
if (r == -ENOENT)
|
||||
return -EHOSTDOWN;
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (!s)
|
||||
return -EIO;
|
||||
|
||||
if (!streq_ptr(class, "container"))
|
||||
return -EIO;
|
||||
|
||||
r = parse_pid(s, &leader);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (leader <= 1)
|
||||
return -EIO;
|
||||
|
||||
*pid = leader;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rename_process(const char name[]) {
|
||||
bool truncated = false;
|
||||
|
||||
/* This is a like a poor man's setproctitle(). It changes the comm field, argv[0], and also the glibc's
|
||||
* internally used name of the process. For the first one a limit of 16 chars applies; to the second one in
|
||||
* many cases one of 10 (i.e. length of "/sbin/init") — however if we have CAP_SYS_RESOURCES it is unbounded;
|
||||
* to the third one 7 (i.e. the length of "systemd". If you pass a longer string it will likely be
|
||||
* truncated.
|
||||
*
|
||||
* Returns 0 if a name was set but truncated, > 0 if it was set but not truncated. */
|
||||
|
||||
if (isempty(name))
|
||||
return -EINVAL; /* let's not confuse users unnecessarily with an empty name */
|
||||
|
||||
if (!is_main_thread())
|
||||
return -EPERM; /* Let's not allow setting the process name from other threads than the main one, as we
|
||||
* cache things without locking, and we make assumptions that PR_SET_NAME sets the
|
||||
* process name that isn't correct on any other threads */
|
||||
|
||||
size_t l = strlen(name);
|
||||
|
||||
/* First step, change the comm field. The main thread's comm is identical to the process comm. This means we
|
||||
* can use PR_SET_NAME, which sets the thread name for the calling thread. */
|
||||
if (prctl(PR_SET_NAME, name) < 0)
|
||||
log_debug_errno(errno, "PR_SET_NAME failed: %m");
|
||||
if (l >= TASK_COMM_LEN) /* Linux userspace process names can be 15 chars at max */
|
||||
truncated = true;
|
||||
|
||||
/* Second step, change glibc's ID of the process name. */
|
||||
if (program_invocation_name) {
|
||||
size_t k;
|
||||
|
||||
k = strlen(program_invocation_name);
|
||||
strncpy(program_invocation_name, name, k);
|
||||
if (l > k)
|
||||
truncated = true;
|
||||
}
|
||||
|
||||
/* Third step, completely replace the argv[] array the kernel maintains for us. This requires privileges, but
|
||||
* has the advantage that the argv[] array is exactly what we want it to be, and not filled up with zeros at
|
||||
* the end. This is the best option for changing /proc/self/cmdline. */
|
||||
(void) update_argv(name, l);
|
||||
|
||||
/* Fourth step: in all cases we'll also update the original argv[], so that our own code gets it right too if
|
||||
* it still looks here */
|
||||
if (saved_argc > 0) {
|
||||
if (saved_argv[0]) {
|
||||
size_t k;
|
||||
|
||||
k = strlen(saved_argv[0]);
|
||||
strncpy(saved_argv[0], name, k);
|
||||
if (l > k)
|
||||
truncated = true;
|
||||
}
|
||||
|
||||
for (int i = 1; i < saved_argc; i++) {
|
||||
if (!saved_argv[i])
|
||||
break;
|
||||
|
||||
memzero(saved_argv[i], strlen(saved_argv[i]));
|
||||
}
|
||||
}
|
||||
|
||||
return !truncated;
|
||||
}
|
||||
|
||||
int is_kernel_thread(pid_t pid) {
|
||||
_cleanup_free_ char *line = NULL;
|
||||
unsigned long long flags;
|
||||
@@ -1583,40 +1482,6 @@ int setpriority_closest(int priority) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool invoked_as(char *argv[], const char *token) {
|
||||
if (!argv || isempty(argv[0]))
|
||||
return false;
|
||||
|
||||
if (isempty(token))
|
||||
return false;
|
||||
|
||||
return strstr(last_path_component(argv[0]), token);
|
||||
}
|
||||
|
||||
bool invoked_by_systemd(void) {
|
||||
int r;
|
||||
|
||||
/* If the process is directly executed by PID1 (e.g. ExecStart= or generator), systemd-importd,
|
||||
* or systemd-homed, then $SYSTEMD_EXEC_PID= is set, and read the command line. */
|
||||
const char *e = getenv("SYSTEMD_EXEC_PID");
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
if (streq(e, "*"))
|
||||
/* For testing. */
|
||||
return true;
|
||||
|
||||
pid_t p;
|
||||
r = parse_pid(e, &p);
|
||||
if (r < 0) {
|
||||
/* We know that systemd sets the variable correctly. Something else must have set it. */
|
||||
log_debug_errno(r, "Failed to parse \"SYSTEMD_EXEC_PID=%s\", ignoring: %m", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return getpid_cached() == p;
|
||||
}
|
||||
|
||||
_noreturn_ void freeze(void) {
|
||||
log_close();
|
||||
|
||||
@@ -1638,31 +1503,6 @@ _noreturn_ void freeze(void) {
|
||||
pause();
|
||||
}
|
||||
|
||||
bool argv_looks_like_help(int argc, char **argv) {
|
||||
char **l;
|
||||
|
||||
/* Scans the command line for indications the user asks for help. This is supposed to be called by
|
||||
* tools that do not implement getopt() style command line parsing because they are not primarily
|
||||
* user-facing. Detects four ways of asking for help:
|
||||
*
|
||||
* 1. Passing zero arguments
|
||||
* 2. Passing "help" as first argument
|
||||
* 3. Passing --help as any argument
|
||||
* 4. Passing -h as any argument
|
||||
*/
|
||||
|
||||
if (argc <= 1)
|
||||
return true;
|
||||
|
||||
if (streq_ptr(argv[1], "help"))
|
||||
return true;
|
||||
|
||||
l = strv_skip(argv, 1);
|
||||
|
||||
return strv_contains(l, "--help") ||
|
||||
strv_contains(l, "-h");
|
||||
}
|
||||
|
||||
static const char *const sigchld_code_table[] = {
|
||||
[CLD_EXITED] = "exited",
|
||||
[CLD_KILLED] = "killed",
|
||||
|
||||
@@ -50,6 +50,8 @@ int get_process_environ(pid_t pid, char **ret);
|
||||
int get_process_ppid(pid_t pid, pid_t *ret);
|
||||
int get_process_umask(pid_t pid, mode_t *ret);
|
||||
|
||||
int container_get_leader(const char *machine, pid_t *pid);
|
||||
|
||||
int wait_for_terminate(pid_t pid, siginfo_t *status);
|
||||
|
||||
typedef enum WaitFlags {
|
||||
@@ -69,7 +71,6 @@ void sigterm_wait(pid_t pid);
|
||||
|
||||
int kill_and_sigcont(pid_t pid, int sig);
|
||||
|
||||
int rename_process(const char name[]);
|
||||
int is_kernel_thread(pid_t pid);
|
||||
|
||||
int getenv_for_pid(pid_t pid, const char *field, char **_value);
|
||||
@@ -189,10 +190,4 @@ int pidfd_get_pid(int fd, pid_t *ret);
|
||||
|
||||
int setpriority_closest(int priority);
|
||||
|
||||
bool invoked_as(char *argv[], const char *token);
|
||||
|
||||
bool invoked_by_systemd(void);
|
||||
|
||||
_noreturn_ void freeze(void);
|
||||
|
||||
bool argv_looks_like_help(int argc, char **argv);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "parse-util.h"
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "process-util.h"
|
||||
|
||||
/**
|
||||
* raw_clone() - uses clone to create a new process with clone flags
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
|
||||
char* first_word(const char *s, const char *word) {
|
||||
size_t sl, wl;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "devnum-util.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static volatile unsigned cached_columns = 0;
|
||||
static volatile unsigned cached_lines = 0;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "dirent-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "initrd-util.h"
|
||||
#include "macro.h"
|
||||
#include "path-lookup.h"
|
||||
#include "set.h"
|
||||
|
||||
+2
-1
@@ -11,8 +11,9 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "binfmt-util.h"
|
||||
#include "build.h"
|
||||
#include "conf-files.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "efi-loader.h"
|
||||
#include "generator.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "mkdir.h"
|
||||
#include "special.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bootspec.h"
|
||||
#include "build.h"
|
||||
#include "devnum-util.h"
|
||||
#include "efi-api.h"
|
||||
#include "efi-loader.h"
|
||||
@@ -19,7 +20,6 @@
|
||||
#include "pretty-print.h"
|
||||
#include "sync-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
#include "virt.h"
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-error.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "pretty-print.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static int help(void) {
|
||||
_cleanup_free_ char *link = NULL;
|
||||
|
||||
+1
-1
@@ -15,6 +15,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "blkid-util.h"
|
||||
#include "bootspec.h"
|
||||
#include "build.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "copy.h"
|
||||
#include "devnum-util.h"
|
||||
@@ -53,7 +54,6 @@
|
||||
#include "tpm2-util.h"
|
||||
#include "umask-util.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
#include "virt.h"
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "efi-loader.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <sd-messages.h>
|
||||
|
||||
#include "build.h"
|
||||
#include "efivars.h"
|
||||
#include "main-func.h"
|
||||
#include "openssl-util.h"
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "busctl-introspect.h"
|
||||
#include "path-util.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
#include "xml.h"
|
||||
|
||||
#define NODE_DEPTH_MAX 16
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-dump.h"
|
||||
#include "bus-internal.h"
|
||||
#include "bus-message.h"
|
||||
|
||||
+1
-1
@@ -8,6 +8,7 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-util.h"
|
||||
#include "cgroup-show.h"
|
||||
#include "cgroup-util.h"
|
||||
@@ -21,7 +22,6 @@
|
||||
#include "pretty-print.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
|
||||
static PagerFlags arg_pager_flags = 0;
|
||||
static OutputFlags arg_output_flags = OUTPUT_CGROUP_XATTRS | OUTPUT_CGROUP_ID;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-util.h"
|
||||
#include "cgroup-show.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "capability-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
static bool initialized = false;
|
||||
static int audit_fd;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "bpf-dlopen.h"
|
||||
#include "bpf-util.h"
|
||||
#include "cgroup-util.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
|
||||
bool cgroup_bpf_supported(void) {
|
||||
|
||||
+2
-1
@@ -39,6 +39,7 @@
|
||||
#if HAVE_APPARMOR
|
||||
#include "apparmor-util.h"
|
||||
#endif
|
||||
#include "argv-util.h"
|
||||
#include "async.h"
|
||||
#include "barrier.h"
|
||||
#include "bpf-lsm.h"
|
||||
@@ -47,10 +48,10 @@
|
||||
#include "cgroup-setup.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "chown-recursive.h"
|
||||
#include "constants.h"
|
||||
#include "cpu-set-util.h"
|
||||
#include "creds-util.h"
|
||||
#include "data-fd-util.h"
|
||||
#include "def.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-list.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "initrd-util.h"
|
||||
#include "import-creds.h"
|
||||
#include "io-util.h"
|
||||
#include "mkdir-label.h"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "kill.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
void kill_context_init(KillContext *c) {
|
||||
assert(c);
|
||||
|
||||
+3
-2
@@ -22,6 +22,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "apparmor-setup.h"
|
||||
#include "architecture.h"
|
||||
#include "argv-util.h"
|
||||
#if HAVE_LIBBPF
|
||||
#include "bpf-lsm.h"
|
||||
#endif
|
||||
@@ -36,7 +37,7 @@
|
||||
#include "crash-handler.h"
|
||||
#include "dbus-manager.h"
|
||||
#include "dbus.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "dev-setup.h"
|
||||
#include "efi-random.h"
|
||||
#include "efivars.h"
|
||||
@@ -52,6 +53,7 @@
|
||||
#include "hostname-setup.h"
|
||||
#include "ima-setup.h"
|
||||
#include "import-creds.h"
|
||||
#include "initrd-util.h"
|
||||
#include "killall.h"
|
||||
#include "kmod-setup.h"
|
||||
#include "limits-util.h"
|
||||
@@ -92,7 +94,6 @@
|
||||
#include "time-util.h"
|
||||
#include "umask-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "initrd-util.h"
|
||||
#include "macro.h"
|
||||
#include "manager-serialize.h"
|
||||
#include "manager.h"
|
||||
|
||||
+2
-1
@@ -30,13 +30,13 @@
|
||||
#include "bus-util.h"
|
||||
#include "clean-ipc.h"
|
||||
#include "clock-util.h"
|
||||
#include "constants.h"
|
||||
#include "core-varlink.h"
|
||||
#include "creds-util.h"
|
||||
#include "dbus-job.h"
|
||||
#include "dbus-manager.h"
|
||||
#include "dbus-unit.h"
|
||||
#include "dbus.h"
|
||||
#include "def.h"
|
||||
#include "dirent-util.h"
|
||||
#include "env-util.h"
|
||||
#include "escape.h"
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "fileio.h"
|
||||
#include "generator-setup.h"
|
||||
#include "hashmap.h"
|
||||
#include "initrd-util.h"
|
||||
#include "inotify-util.h"
|
||||
#include "install.h"
|
||||
#include "io-util.h"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "exit-status.h"
|
||||
#include "format-util.h"
|
||||
#include "fstab-util.h"
|
||||
#include "initrd-util.h"
|
||||
#include "libmount-util.h"
|
||||
#include "log.h"
|
||||
#include "manager.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "selinux-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "strv.h"
|
||||
#include "util.h"
|
||||
|
||||
static bool initialized = false;
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
#include <selinux/selinux.h>
|
||||
#endif
|
||||
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "selinux-setup.h"
|
||||
#include "selinux-util.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#if HAVE_SELINUX
|
||||
_printf_(2,3)
|
||||
|
||||
+1
-2
@@ -13,9 +13,9 @@
|
||||
#include "bus-kernel.h"
|
||||
#include "bus-util.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "constants.h"
|
||||
#include "dbus-service.h"
|
||||
#include "dbus-unit.h"
|
||||
#include "def.h"
|
||||
#include "env-util.h"
|
||||
#include "escape.h"
|
||||
#include "exit-status.h"
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "unit-name.h"
|
||||
#include "unit.h"
|
||||
#include "utf8.h"
|
||||
#include "util.h"
|
||||
|
||||
#define service_spawn(...) service_spawn_internal(__func__, __VA_ARGS__)
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static const char* const show_status_table[_SHOW_STATUS_MAX] = {
|
||||
[SHOW_STATUS_NO] = "no",
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "macro.h"
|
||||
#include "smack-setup.h"
|
||||
#include "string-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#if ENABLE_SMACK
|
||||
|
||||
|
||||
+1
-1
@@ -15,10 +15,10 @@
|
||||
#include "bus-error.h"
|
||||
#include "bus-util.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "constants.h"
|
||||
#include "copy.h"
|
||||
#include "dbus-socket.h"
|
||||
#include "dbus-unit.h"
|
||||
#include "def.h"
|
||||
#include "errno-list.h"
|
||||
#include "exit-status.h"
|
||||
#include "fd-util.h"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "compress.h"
|
||||
#include "conf-parser.h"
|
||||
#include "copy.h"
|
||||
#include "coredump-util.h"
|
||||
#include "coredump-vacuum.h"
|
||||
#include "dirent-util.h"
|
||||
#include "elf-util.h"
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
#include "sd-messages.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-locator.h"
|
||||
#include "bus-util.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "compress.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "dissect-image.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
@@ -42,7 +43,6 @@
|
||||
#include "terminal-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
#define SHORT_BUS_CALL_TIMEOUT_USEC (3 * USEC_PER_SEC)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "build.h"
|
||||
#include "creds-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "escape.h"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <getopt.h>
|
||||
|
||||
#include "ask-password-api.h"
|
||||
#include "build.h"
|
||||
#include "cryptenroll-fido2.h"
|
||||
#include "cryptenroll-list.h"
|
||||
#include "cryptenroll-password.h"
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
|
||||
typedef struct crypto_device {
|
||||
char *uuid;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "alloc-util.h"
|
||||
#include "dropin.h"
|
||||
#include "generator.h"
|
||||
#include "initrd-util.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "dirent-util.h"
|
||||
#include "fd-util.h"
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "main-func.h"
|
||||
#include "pretty-print.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
static bool arg_quiet = false;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "architecture.h"
|
||||
#include "blockdev-util.h"
|
||||
#include "build.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "copy.h"
|
||||
#include "device-util.h"
|
||||
@@ -42,7 +43,6 @@
|
||||
#include "terminal-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static enum {
|
||||
ACTION_DISSECT,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "sd-path.h"
|
||||
|
||||
#include "conf-files.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "env-file.h"
|
||||
#include "escape.h"
|
||||
#include "glyph-util.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "path-util.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "ask-password-api.h"
|
||||
#include "build.h"
|
||||
#include "chase-symlinks.h"
|
||||
#include "copy.h"
|
||||
#include "creds-util.h"
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "socket-util.h"
|
||||
#include "special.h"
|
||||
#include "stdio-util.h"
|
||||
#include "util.h"
|
||||
|
||||
static bool arg_skip = false;
|
||||
static bool arg_force = false;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "fstab-util.h"
|
||||
#include "generator.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "mkdir.h"
|
||||
@@ -29,7 +30,6 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
#include "volatile-util.h"
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "fd-util.h"
|
||||
#include "fuzz.h"
|
||||
#include "time-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
_cleanup_free_ char *str = NULL;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
static const char *arg_dest = NULL;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "fstab-util.h"
|
||||
#include "generator.h"
|
||||
#include "gpt.h"
|
||||
#include "initrd-util.h"
|
||||
#include "mkdir.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "parse-util.h"
|
||||
@@ -34,7 +35,6 @@
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "unit-name.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
static const char *arg_dest = NULL;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "dropin.h"
|
||||
#include "fstab-util.h"
|
||||
#include "generator.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "mkdir-label.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "alloc-util.h"
|
||||
#include "devnum-util.h"
|
||||
#include "fileio.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct stat st;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "ask-password-api.h"
|
||||
#include "build.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-locator.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "home-util.h"
|
||||
#include "homed-conf.h"
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "architecture.h"
|
||||
#include "build.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-map-properties.h"
|
||||
@@ -23,7 +24,6 @@
|
||||
#include "pretty-print.h"
|
||||
#include "spawn-polkit-agent.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static bool arg_ask_password = true;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "bus-get-properties.h"
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "def.h"
|
||||
#include "constants.h"
|
||||
#include "env-file-label.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
#include "util.h"
|
||||
#include "virt.h"
|
||||
|
||||
#define VALID_DEPLOYMENT_CHARS (DIGITS LETTERS "-.:")
|
||||
|
||||
+1
-1
@@ -5,12 +5,12 @@
|
||||
#include "sd-hwdb.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "hwdb-util.h"
|
||||
#include "main-func.h"
|
||||
#include "pretty-print.h"
|
||||
#include "selinux-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static const char *arg_hwdb_bin_dir = NULL;
|
||||
|
||||
+1
-1
@@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "gpt.h"
|
||||
#include "id128-print.h"
|
||||
#include "main-func.h"
|
||||
@@ -11,7 +12,6 @@
|
||||
#include "strv.h"
|
||||
#include "format-table.h"
|
||||
#include "terminal-util.h"
|
||||
#include "util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static Id128PrettyPrintMode arg_mode = ID128_PRINT_ID128;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#define COPY_BUFFER_SIZE (16*1024)
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "ratelimit.h"
|
||||
#include "string-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
#define COPY_BUFFER_SIZE (16*1024)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
#include "discover-image.h"
|
||||
#include "export-raw.h"
|
||||
#include "export-tar.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "signal-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "util.h"
|
||||
|
||||
int import_fork_tar_x(const char *path, pid_t *ret) {
|
||||
_cleanup_close_pair_ int pipefd[2] = { -1, -1 };
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "import-compress.h"
|
||||
#include "string-table.h"
|
||||
#include "util.h"
|
||||
|
||||
void import_compress_free(ImportCompress *c) {
|
||||
assert(c);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user