Clean up includes (#37467)
Split out of #37344 More small components that shouldn't be all too controversial.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-bus-vtable.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "busctl-introspect.h"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include "forward.h"
|
||||
|
||||
typedef struct XMLIntrospectOps {
|
||||
int (*on_path)(const char *path, void *userdata);
|
||||
|
||||
+6
-3
@@ -1,29 +1,31 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <getopt.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-json.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bitfield.h"
|
||||
#include "build.h"
|
||||
#include "bus-dump.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-internal.h"
|
||||
#include "bus-message.h"
|
||||
#include "bus-signature.h"
|
||||
#include "bus-type.h"
|
||||
#include "bus-util.h"
|
||||
#include "busctl-introspect.h"
|
||||
#include "capsule-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
#include "fdset.h"
|
||||
#include "fileio.h"
|
||||
#include "format-table.h"
|
||||
#include "glyph-util.h"
|
||||
#include "json-util.h"
|
||||
#include "log.h"
|
||||
#include "logarithm.h"
|
||||
#include "main-func.h"
|
||||
@@ -36,9 +38,10 @@
|
||||
#include "pretty-print.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "set.h"
|
||||
#include "sort-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "user-util.h"
|
||||
#include "verbs.h"
|
||||
#include "version.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "busctl-introspect.h"
|
||||
#include "set.h"
|
||||
#include "strv.h"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
@@ -12,7 +11,6 @@
|
||||
#include "fs-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
#include "forward.h"
|
||||
|
||||
int coredump_vacuum(int exclude_fd, uint64_t keep_free, uint64_t max_use);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/auxv.h>
|
||||
#include <sys/mount.h>
|
||||
@@ -9,6 +8,7 @@
|
||||
#include <sys/xattr.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-journal.h"
|
||||
#include "sd-json.h"
|
||||
@@ -27,24 +27,25 @@
|
||||
#include "coredump-vacuum.h"
|
||||
#include "dirent-util.h"
|
||||
#include "elf-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "io-util.h"
|
||||
#include "iovec-util.h"
|
||||
#include "journal-importer.h"
|
||||
#include "journal-send.h"
|
||||
#include "json-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "main-func.h"
|
||||
#include "memory-util.h"
|
||||
#include "memstream-util.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "namespace-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pidref.h"
|
||||
#include "process-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
@@ -52,8 +53,6 @@
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "sync-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "uid-classification.h"
|
||||
#include "user-util.h"
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <getopt.h>
|
||||
#include <locale.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
@@ -18,11 +20,13 @@
|
||||
#include "bus-util.h"
|
||||
#include "chase.h"
|
||||
#include "compress.h"
|
||||
#include "constants.h"
|
||||
#include "dissect-image.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-table.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "glob-util.h"
|
||||
#include "image-policy.h"
|
||||
@@ -31,7 +35,7 @@
|
||||
#include "json-util.h"
|
||||
#include "log.h"
|
||||
#include "logs-show.h"
|
||||
#include "macro.h"
|
||||
#include "loop-util.h"
|
||||
#include "main-func.h"
|
||||
#include "mount-util.h"
|
||||
#include "pager.h"
|
||||
@@ -40,11 +44,11 @@
|
||||
#include "path-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "process-util.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "coredump-vacuum.h"
|
||||
#include "tests.h"
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "efivars.h"
|
||||
#include "fstab-util.h"
|
||||
#include "hibernate-resume-config.h"
|
||||
#include "log.h"
|
||||
#include "os-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "sd-id128.h"
|
||||
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
typedef struct KernelHibernateLocation KernelHibernateLocation;
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "hibernate-resume-config.h"
|
||||
#include "initrd-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "parse-util.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "special.h"
|
||||
#include "static-destruct.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -15,7 +14,6 @@
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "static-destruct.h"
|
||||
#include "terminal-util.h"
|
||||
|
||||
static HibernateInfo arg_info = {};
|
||||
static bool arg_clear = false;
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fileio.h"
|
||||
#include "integrity-util.h"
|
||||
#include "log.h"
|
||||
#include "path-util.h"
|
||||
#include "percent-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
|
||||
static int supported_integrity_algorithm(char *user_supplied) {
|
||||
if (!STR_IN_SET(user_supplied, "crc32", "crc32c", "xxhash64", "sha1", "sha256", "hmac-sha256"))
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cryptsetup-util.h"
|
||||
#include "time-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
int parse_integrity_options(
|
||||
const char *options,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -11,14 +9,9 @@
|
||||
#include "fileio.h"
|
||||
#include "fstab-util.h"
|
||||
#include "generator.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "id128-util.h"
|
||||
#include "integrity-util.h"
|
||||
#include "main-func.h"
|
||||
#include "mkdir.h"
|
||||
#include "parse-util.h"
|
||||
#include "log.h"
|
||||
#include "path-util.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "specifier.h"
|
||||
#include "string-util.h"
|
||||
#include "unit-name.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -8,17 +7,13 @@
|
||||
#include "argv-util.h"
|
||||
#include "cryptsetup-util.h"
|
||||
#include "fileio.h"
|
||||
#include "hexdecoct.h"
|
||||
#include "integrity-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "memory-util.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "process-util.h"
|
||||
#include "string-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static uint32_t arg_activate_flags;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
@@ -20,12 +19,11 @@
|
||||
#include "pager.h"
|
||||
#include "polkit-agent.h"
|
||||
#include "pretty-print.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "set.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "verbs.h"
|
||||
#include "virt.h"
|
||||
|
||||
/* Enough time for locale-gen to finish server-side (in case it is in use) */
|
||||
#define LOCALE_SLOW_BUS_CALL_TIMEOUT_USEC (2*USEC_PER_MINUTE)
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "copy.h"
|
||||
#include "env-file.h"
|
||||
#include "env-file-label.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "kbd-util.h"
|
||||
#include "localed-util.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "hashmap.h"
|
||||
#include "forward.h"
|
||||
#include "locale-setup.h"
|
||||
#include "vconsole-util.h"
|
||||
|
||||
|
||||
@@ -1,34 +1,29 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-locator.h"
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-message.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-unit-util.h"
|
||||
#include "bus-util.h"
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "kbd-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "label-util.h"
|
||||
#include "localed-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "main-func.h"
|
||||
#include "path-util.h"
|
||||
#include "selinux-util.h"
|
||||
#include "service-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
static int vconsole_reload(sd_bus *bus) {
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "localed-util.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "dlfcn-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
#include "xkbcommon-util.h"
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "dlfcn-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
#if HAVE_XKBCOMMON
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
@@ -1,22 +1,26 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build-path.h"
|
||||
#include "common-signal.h"
|
||||
#include "env-util.h"
|
||||
#include "event-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "format-util.h"
|
||||
#include "log.h"
|
||||
#include "mkdir.h"
|
||||
#include "mountfsd-manager.h"
|
||||
#include "process-util.h"
|
||||
#include "set.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
#include "umask-util.h"
|
||||
|
||||
#define LISTEN_TIMEOUT_USEC (25 * USEC_PER_SEC)
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
#include "hashmap.h"
|
||||
#include "forward.h"
|
||||
#include "ratelimit.h"
|
||||
|
||||
#define MOUNTFS_WORKERS_MIN 3
|
||||
#define MOUNTFS_WORKERS_MAX 4096
|
||||
|
||||
struct Manager {
|
||||
typedef struct Manager {
|
||||
sd_event *event;
|
||||
|
||||
Set *workers_fixed; /* Workers 0…MOUNTFS_WORKERS_MIN */
|
||||
@@ -21,7 +16,7 @@ struct Manager {
|
||||
int listen_fd;
|
||||
|
||||
RateLimit worker_ratelimit;
|
||||
};
|
||||
} Manager;
|
||||
|
||||
int manager_new(Manager **ret);
|
||||
Manager* manager_free(Manager *m);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "daemon-util.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <linux/loop.h>
|
||||
#include <poll.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "argv-util.h"
|
||||
@@ -14,20 +17,28 @@
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "image-policy.h"
|
||||
#include "io-util.h"
|
||||
#include "json-util.h"
|
||||
#include "loop-util.h"
|
||||
#include "main-func.h"
|
||||
#include "memory-util.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "namespace-util.h"
|
||||
#include "nsresource.h"
|
||||
#include "nulstr-util.h"
|
||||
#include "os-util.h"
|
||||
#include "process-util.h"
|
||||
#include "path-util.h"
|
||||
#include "pidref.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "uid-classification.h"
|
||||
#include "uid-range.h"
|
||||
#include "user-util.h"
|
||||
#include "varlink-io.systemd.MountFileSystem.h"
|
||||
#include "varlink-util.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
@@ -14,6 +15,7 @@
|
||||
#include "env-util.h"
|
||||
#include "event-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "mkdir.h"
|
||||
@@ -24,9 +26,10 @@
|
||||
#include "set.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "umask-util.h"
|
||||
#include "unaligned.h"
|
||||
#include "user-util.h"
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
#include "hashmap.h"
|
||||
#include "forward.h"
|
||||
#include "ratelimit.h"
|
||||
|
||||
#define NSRESOURCE_WORKERS_MIN 5
|
||||
#define NSRESOURCE_WORKERS_MAX 4096
|
||||
|
||||
struct Manager {
|
||||
typedef struct Manager {
|
||||
sd_event *event;
|
||||
|
||||
Set *workers_fixed; /* Workers 0…NSRESOURCE_WORKERS_MIN */
|
||||
@@ -31,7 +26,7 @@ struct Manager {
|
||||
#endif
|
||||
|
||||
int registry_fd;
|
||||
};
|
||||
} Manager;
|
||||
|
||||
int manager_new(Manager **ret);
|
||||
Manager* manager_free(Manager *m);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "daemon-util.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <linux/nsfs.h>
|
||||
#include <linux/veth.h>
|
||||
#include <net/if.h>
|
||||
#include <poll.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -12,36 +13,40 @@
|
||||
#include <utmpx.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-event.h"
|
||||
#include "sd-netlink.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "argv-util.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "ether-addr-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "group-record.h"
|
||||
#include "format-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "io-util.h"
|
||||
#include "json-util.h"
|
||||
#include "lock-util.h"
|
||||
#include "main-func.h"
|
||||
#include "missing_magic.h"
|
||||
#include "missing_sched.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "mount-util.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "namespace-util.h"
|
||||
#include "netlink-util.h"
|
||||
#include "pidref.h"
|
||||
#include "process-util.h"
|
||||
#include "random-util.h"
|
||||
#include "siphash24.h"
|
||||
#include "socket-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "uid-classification.h"
|
||||
#include "uid-range.h"
|
||||
#include "user-record.h"
|
||||
#include "user-record-nss.h"
|
||||
#include "user-util.h"
|
||||
#include "userdb.h"
|
||||
#include "userns-registry.h"
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "missing_syscall.h"
|
||||
#include "missing_sched.h"
|
||||
#include "namespace-util.h"
|
||||
#include "process-util.h"
|
||||
#include "rm-rf.h"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-json.h"
|
||||
#include "sd-netlink.h"
|
||||
|
||||
@@ -15,6 +17,8 @@
|
||||
#include "path-util.h"
|
||||
#include "recurse-dir.h"
|
||||
#include "rm-rf.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
#include "userns-registry.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "memory-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
#define USER_NAMESPACE_CGROUPS_DELEGATE_MAX 16U
|
||||
#define USER_NAMESPACE_NETIFS_DELEGATE_MAX 16U
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "log.h"
|
||||
#include "userns-restrict.h"
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sched.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
@@ -12,12 +8,14 @@
|
||||
#include "bpf-link.h"
|
||||
#include "fd-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "lsm-util.h"
|
||||
#include "mkdir.h"
|
||||
#include "mount-util.h"
|
||||
#include "mountpoint-util.h"
|
||||
#include "namespace-util.h"
|
||||
#include "path-util.h"
|
||||
#include "string-util.h"
|
||||
#include "userns-restrict.h"
|
||||
|
||||
#define USERNS_MAX (16U*1024U)
|
||||
#define MOUNTS_MAX 4096U
|
||||
@@ -26,10 +24,14 @@
|
||||
#define MAP_LINK_PREFIX "/sys/fs/bpf/systemd/userns-restrict/maps"
|
||||
|
||||
struct userns_restrict_bpf *userns_restrict_bpf_free(struct userns_restrict_bpf *obj) {
|
||||
#if HAVE_VMLINUX_H
|
||||
(void) userns_restrict_bpf__destroy(obj); /* this call is fine with NULL */
|
||||
#endif
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
static int make_inner_hash_map(void) {
|
||||
int fd;
|
||||
|
||||
@@ -45,11 +47,13 @@ static int make_inner_hash_map(void) {
|
||||
|
||||
return fd;
|
||||
}
|
||||
#endif
|
||||
|
||||
int userns_restrict_install(
|
||||
bool pin,
|
||||
struct userns_restrict_bpf **ret) {
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
_cleanup_(userns_restrict_bpf_freep) struct userns_restrict_bpf *obj = NULL;
|
||||
_cleanup_close_ int dummy_mnt_id_hash_fd = -EBADF;
|
||||
int r;
|
||||
@@ -176,6 +180,9 @@ int userns_restrict_install(
|
||||
*ret = TAKE_PTR(obj);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
#endif
|
||||
}
|
||||
|
||||
int userns_restrict_put_by_inode(
|
||||
@@ -185,6 +192,7 @@ int userns_restrict_put_by_inode(
|
||||
const int mount_fds[],
|
||||
size_t n_mount_fds) {
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
_cleanup_close_ int inner_map_fd = -EBADF;
|
||||
_cleanup_free_ int *mnt_ids = NULL;
|
||||
uint64_t ino = userns_inode;
|
||||
@@ -268,6 +276,9 @@ int userns_restrict_put_by_inode(
|
||||
}
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
#endif
|
||||
}
|
||||
|
||||
int userns_restrict_put_by_fd(
|
||||
@@ -277,6 +288,7 @@ int userns_restrict_put_by_fd(
|
||||
const int mount_fds[],
|
||||
size_t n_mount_fds) {
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
struct stat st;
|
||||
int r;
|
||||
|
||||
@@ -299,12 +311,16 @@ int userns_restrict_put_by_fd(
|
||||
replace,
|
||||
mount_fds,
|
||||
n_mount_fds);
|
||||
#else
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
#endif
|
||||
}
|
||||
|
||||
int userns_restrict_reset_by_inode(
|
||||
struct userns_restrict_bpf *obj,
|
||||
uint64_t ino) {
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
int r, outer_map_fd;
|
||||
unsigned u;
|
||||
|
||||
@@ -325,26 +341,7 @@ int userns_restrict_reset_by_inode(
|
||||
return log_debug_errno(r, "Failed to remove entry for inode %" PRIu64 " from outer map: %m", ino);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
int userns_restrict_install(bool pin, struct userns_restrict_bpf **ret) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
}
|
||||
|
||||
struct userns_restrict_bpf *userns_restrict_bpf_free(struct userns_restrict_bpf *obj) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int userns_restrict_put_by_fd(struct userns_restrict_bpf *obj, int userns_fd, bool replace, const int mount_fds[], size_t n_mount_fds) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
}
|
||||
|
||||
int userns_restrict_put_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode, bool replace, const int mount_fds[], size_t n_mount_fds) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
}
|
||||
|
||||
int userns_restrict_reset_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode) {
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "User Namespace Restriction BPF support disabled.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
#if HAVE_VMLINUX_H
|
||||
#include "bpf/userns_restrict/userns-restrict-skel.h"
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <net/if.h>
|
||||
#include <netdb.h>
|
||||
#include <nss.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "hostname-setup.h"
|
||||
#include "hostname-util.h"
|
||||
#include "local-addresses.h"
|
||||
#include "macro.h"
|
||||
#include "nss-util.h"
|
||||
#include "resolve-util.h"
|
||||
#include "signal-util.h"
|
||||
|
||||
@@ -3,21 +3,16 @@
|
||||
#include <netdb.h>
|
||||
#include <nss.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-login.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-locator.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "format-util.h"
|
||||
#include "hostname-util.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "memory-util.h"
|
||||
#include "nss-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
#include <nss.h>
|
||||
#include <pthread.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-varlink.h"
|
||||
@@ -15,12 +12,12 @@
|
||||
#include "glyph-util.h"
|
||||
#include "in-addr-util.h"
|
||||
#include "json-util.h"
|
||||
#include "macro.h"
|
||||
#include "nss-util.h"
|
||||
#include "resolved-def.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
|
||||
static sd_json_dispatch_flags_t json_dispatch_flags = SD_JSON_ALLOW_EXTENSIONS;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <gshadow.h>
|
||||
#include <nss.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
@@ -8,13 +9,12 @@
|
||||
#include "alloc-util.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "nss-systemd.h"
|
||||
#include "nss-util.h"
|
||||
#include "pthread-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-record-nss.h"
|
||||
#include "user-util.h"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "assert-util.h"
|
||||
#include "forward.h"
|
||||
|
||||
int _nss_systemd_block(bool b);
|
||||
bool _nss_systemd_is_blocked(void);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <gshadow.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "nss-systemd.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "user-record.h"
|
||||
#include "user-record-nss.h"
|
||||
#include "user-util.h"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include <grp.h>
|
||||
#include <nss.h>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "forward.h"
|
||||
#include "userdb.h"
|
||||
|
||||
UserDBFlags nss_glue_userdb_flags(void);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sd-path.h"
|
||||
|
||||
@@ -11,7 +9,6 @@
|
||||
#include "build.h"
|
||||
#include "errno-util.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "main-func.h"
|
||||
#include "pager.h"
|
||||
#include "pretty-print.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <linux/loop.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-messages.h"
|
||||
|
||||
#include "bus-common-errors.h"
|
||||
@@ -9,7 +10,6 @@
|
||||
#include "bus-locator.h"
|
||||
#include "chase.h"
|
||||
#include "conf-files.h"
|
||||
#include "constants.h"
|
||||
#include "copy.h"
|
||||
#include "data-fd-util.h"
|
||||
#include "dirent-util.h"
|
||||
@@ -17,19 +17,20 @@
|
||||
#include "dissect-image.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-list.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "extension-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "glyph-util.h"
|
||||
#include "install.h"
|
||||
#include "iovec-util.h"
|
||||
#include "locale-util.h"
|
||||
#include "log-context.h"
|
||||
#include "log.h"
|
||||
#include "loop-util.h"
|
||||
#include "mkdir.h"
|
||||
#include "nulstr-util.h"
|
||||
#include "os-util.h"
|
||||
#include "path-lookup.h"
|
||||
#include "portable.h"
|
||||
@@ -44,7 +45,7 @@
|
||||
#include "string-table.h"
|
||||
#include "strv.h"
|
||||
#include "tmpfile-util.h"
|
||||
#include "user-util.h"
|
||||
#include "unit-name.h"
|
||||
#include "vpick.h"
|
||||
|
||||
/* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "dissect-image.h"
|
||||
#include "hashmap.h"
|
||||
#include "macro.h"
|
||||
#include "forward.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "set.h"
|
||||
#include "string-util.h"
|
||||
|
||||
typedef struct PortableMetadata {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
@@ -12,18 +11,15 @@
|
||||
#include "bus-unit-util.h"
|
||||
#include "bus-wait-for-jobs.h"
|
||||
#include "chase.h"
|
||||
#include "constants.h"
|
||||
#include "dirent-util.h"
|
||||
#include "env-file.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-table.h"
|
||||
#include "fs-util.h"
|
||||
#include "locale-util.h"
|
||||
#include "install.h"
|
||||
#include "main-func.h"
|
||||
#include "os-util.h"
|
||||
#include "pager.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
#include "polkit-agent.h"
|
||||
@@ -31,7 +27,6 @@
|
||||
#include "pretty-print.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static PagerFlags arg_pager_flags = 0;
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "btrfs-util.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-error.h"
|
||||
#include "bus-object.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "discover-image.h"
|
||||
#include "fd-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "io-util.h"
|
||||
#include "log.h"
|
||||
#include "portable.h"
|
||||
#include "portabled.h"
|
||||
#include "portabled-bus.h"
|
||||
#include "portabled-image.h"
|
||||
#include "portabled-image-bus.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
|
||||
static int property_get_pool_path(
|
||||
sd_bus *bus,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-bus-vtable.h"
|
||||
|
||||
typedef struct PortableChange PortableChange;
|
||||
#include "portabled-forward.h"
|
||||
|
||||
extern const sd_bus_vtable manager_vtable[];
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "forward.h" // IWYU pragma: export
|
||||
|
||||
typedef struct Manager Manager;
|
||||
typedef struct Operation Operation;
|
||||
typedef struct PortableChange PortableChange;
|
||||
@@ -2,29 +2,32 @@
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-get-properties.h"
|
||||
#include "bus-label.h"
|
||||
#include "bus-object.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "hashmap.h"
|
||||
#include "image-policy.h"
|
||||
#include "io-util.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "portable.h"
|
||||
#include "portabled.h"
|
||||
#include "portabled-bus.h"
|
||||
#include "portabled-image.h"
|
||||
#include "portabled-image-bus.h"
|
||||
#include "portabled-operation.h"
|
||||
#include "process-util.h"
|
||||
#include "strv.h"
|
||||
#include "user-util.h"
|
||||
|
||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, image_type, ImageType);
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-bus-vtable.h"
|
||||
|
||||
#include "bus-object.h"
|
||||
#include "discover-image.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
#include "portabled-forward.h"
|
||||
|
||||
int bus_image_common_get_os_release(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, sd_bus_error *error);
|
||||
int bus_image_common_get_metadata(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, sd_bus_error *error);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "portable.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "discover-image.h"
|
||||
#include "hashmap.h"
|
||||
#include "portabled.h"
|
||||
#include "portabled-image.h"
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "discover-image.h"
|
||||
#include "hashmap.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
#include "portabled-forward.h"
|
||||
|
||||
Image *manager_image_cache_get(Manager *m, const char *name_or_path);
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
#include "log.h"
|
||||
#include "portabled.h"
|
||||
#include "portabled-operation.h"
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "list.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
typedef struct Operation Operation;
|
||||
#include "portabled-forward.h"
|
||||
|
||||
#define OPERATIONS_MAX 64
|
||||
|
||||
struct Operation {
|
||||
typedef struct Operation {
|
||||
Manager *manager;
|
||||
pid_t pid;
|
||||
sd_bus_message *message;
|
||||
@@ -22,7 +15,7 @@ struct Operation {
|
||||
sd_event_source *event_source;
|
||||
int (*done)(Operation *o, int ret, sd_bus_error *error);
|
||||
LIST_FIELDS(Operation, operations);
|
||||
};
|
||||
} Operation;
|
||||
|
||||
int operation_new(Manager *manager, pid_t child, sd_bus_message *message, int errno_fd, Operation **ret);
|
||||
Operation *operation_free(Operation *o);
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-log-control-api.h"
|
||||
#include "bus-polkit.h"
|
||||
#include "bus-util.h"
|
||||
#include "common-signal.h"
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "portabled.h"
|
||||
#include "portabled-bus.h"
|
||||
#include "portabled-image-bus.h"
|
||||
#include "process-util.h"
|
||||
#include "service-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
static Manager* manager_unref(Manager *m);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref);
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "bus-object.h"
|
||||
#include "hashmap.h"
|
||||
#include "list.h"
|
||||
#include "portabled-operation.h"
|
||||
#include "portabled-forward.h"
|
||||
#include "runtime-scope.h"
|
||||
|
||||
typedef struct Manager {
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef enum UserDisposition {
|
||||
_USER_DISPOSITION_INVALID = -EINVAL,
|
||||
} UserDisposition;
|
||||
|
||||
typedef enum UserHomeStorage {
|
||||
typedef enum UserStorage {
|
||||
USER_CLASSIC,
|
||||
USER_LUKS,
|
||||
USER_DIRECTORY, /* A directory, and a .identity file in it, which USER_CLASSIC lacks */
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "forward.h"
|
||||
|
||||
int dm_detach_all(bool *changed, bool last_try);
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "forward.h"
|
||||
|
||||
int loopback_detach_all(bool *changed, bool last_try);
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "forward.h"
|
||||
|
||||
int md_detach_all(bool *changed, bool last_try);
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "forward.h"
|
||||
#include "list.h"
|
||||
|
||||
int swapoff_all(bool *changed);
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
@@ -30,13 +28,16 @@
|
||||
#include "detach-swap.h"
|
||||
#include "errno-util.h"
|
||||
#include "exec-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "getopt-defs.h"
|
||||
#include "initrd-util.h"
|
||||
#include "killall.h"
|
||||
#include "log.h"
|
||||
#include "parse-util.h"
|
||||
#include "pidref.h"
|
||||
#include "process-util.h"
|
||||
#include "reboot-util.h"
|
||||
#include "rlimit-util.h"
|
||||
@@ -46,6 +47,7 @@
|
||||
#include "switch-root.h"
|
||||
#include "sysctl-util.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "umount.h"
|
||||
#include "virt.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "log.h"
|
||||
#include "path-util.h"
|
||||
#include "string-util.h"
|
||||
#include "tests.h"
|
||||
#include "umount.h"
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "chase.h"
|
||||
#include "dirent-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "fstab-util.h"
|
||||
#include "libmount-util.h"
|
||||
@@ -27,8 +27,10 @@
|
||||
#include "process-util.h"
|
||||
#include "random-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "stat-util.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
#include "umount.h"
|
||||
#include "user-util.h"
|
||||
#include "virt.h"
|
||||
|
||||
static void mount_point_free(MountPoint **head, MountPoint *m) {
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
Copyright © 2010 ProFUSION embedded systems
|
||||
***/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "forward.h"
|
||||
#include "list.h"
|
||||
|
||||
int umount_all(bool *changed, bool last_try);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "errno-util.h"
|
||||
#include "fd-util.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include <time.h>
|
||||
#include "forward.h"
|
||||
|
||||
int hwclock_get(struct tm *tm);
|
||||
int hwclock_set(const struct tm *tm);
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
#include <getopt.h>
|
||||
#include <locale.h>
|
||||
#include <math.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build.h"
|
||||
@@ -23,10 +23,13 @@
|
||||
#include "parse-util.h"
|
||||
#include "polkit-agent.h"
|
||||
#include "pretty-print.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "sparse-endian.h"
|
||||
#include "string-table.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "time-util.h"
|
||||
#include "verbs.h"
|
||||
|
||||
static PagerFlags arg_pager_flags = 0;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/timex.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-bus.h"
|
||||
@@ -25,25 +24,26 @@
|
||||
#include "conf-files.h"
|
||||
#include "constants.h"
|
||||
#include "daemon-util.h"
|
||||
#include "extract-word.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "fs-util.h"
|
||||
#include "hashmap.h"
|
||||
#include "hwclock-util.h"
|
||||
#include "label-util.h"
|
||||
#include "list.h"
|
||||
#include "log.h"
|
||||
#include "log-context.h"
|
||||
#include "main-func.h"
|
||||
#include "memory-util.h"
|
||||
#include "path-util.h"
|
||||
#include "selinux-util.h"
|
||||
#include "service-util.h"
|
||||
#include "signal-util.h"
|
||||
#include "set.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "unit-def.h"
|
||||
#include "unit-name.h"
|
||||
#include "user-util.h"
|
||||
|
||||
#define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n"
|
||||
#define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <getopt.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bitfield.h"
|
||||
@@ -9,22 +11,23 @@
|
||||
#include "creds-util.h"
|
||||
#include "dirent-util.h"
|
||||
#include "errno-list.h"
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "format-table.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "main-func.h"
|
||||
#include "mkdir-label.h"
|
||||
#include "mkdir.h"
|
||||
#include "pager.h"
|
||||
#include "parse-argument.h"
|
||||
#include "parse-util.h"
|
||||
#include "pretty-print.h"
|
||||
#include "recurse-dir.h"
|
||||
#include "socket-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "terminal-util.h"
|
||||
#include "uid-classification.h"
|
||||
#include "uid-range.h"
|
||||
#include "umask-util.h"
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "build-path.h"
|
||||
#include "common-signal.h"
|
||||
#include "env-util.h"
|
||||
#include "event-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-util.h"
|
||||
#include "fs-util.h"
|
||||
#include "log.h"
|
||||
#include "mkdir.h"
|
||||
@@ -16,8 +19,9 @@
|
||||
#include "set.h"
|
||||
#include "signal-util.h"
|
||||
#include "socket-util.h"
|
||||
#include "stdio-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "time-util.h"
|
||||
#include "umask-util.h"
|
||||
#include "userdbd-manager.h"
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "sd-bus.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
typedef struct Manager Manager;
|
||||
|
||||
#include "hashmap.h"
|
||||
#include "forward.h"
|
||||
#include "ratelimit.h"
|
||||
|
||||
#define USERDB_WORKERS_MIN 3
|
||||
#define USERDB_WORKERS_MAX 4096
|
||||
|
||||
struct Manager {
|
||||
typedef struct Manager {
|
||||
sd_event *event;
|
||||
|
||||
Set *workers_fixed; /* Workers 0…USERDB_WORKERS_MIN */
|
||||
@@ -23,7 +18,7 @@ struct Manager {
|
||||
RateLimit worker_ratelimit;
|
||||
|
||||
sd_event_source *deferred_start_worker_event_source;
|
||||
};
|
||||
} Manager;
|
||||
|
||||
int manager_new(Manager **ret);
|
||||
Manager* manager_free(Manager *m);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "daemon-util.h"
|
||||
#include "log.h"
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-varlink.h"
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "argv-util.h"
|
||||
#include "env-util.h"
|
||||
#include "errno-util.h"
|
||||
@@ -14,11 +15,10 @@
|
||||
#include "io-util.h"
|
||||
#include "json-util.h"
|
||||
#include "main-func.h"
|
||||
#include "process-util.h"
|
||||
#include "strv.h"
|
||||
#include "pidref.h"
|
||||
#include "string-util.h"
|
||||
#include "time-util.h"
|
||||
#include "user-record.h"
|
||||
#include "user-record-nss.h"
|
||||
#include "user-util.h"
|
||||
#include "userdb.h"
|
||||
#include "varlink-io.systemd.UserDatabase.h"
|
||||
|
||||
Reference in New Issue
Block a user