core: Clean up includes

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-22 09:37:20 +02:00
parent 6288739eaf
commit 836e4e7ea8
144 changed files with 654 additions and 732 deletions
+12 -12
View File
@@ -1,15 +1,15 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "automount.h"
#include "device.h"
#include "mount.h"
#include "path.h"
#include "scope.h"
#include "service.h"
#include "slice.h"
#include "socket.h"
#include "swap.h"
#include "target.h"
#include "timer.h"
#include "unit.h"
#include "automount.h" /* IWYU pragma: export */
#include "device.h" /* IWYU pragma: export */
#include "mount.h" /* IWYU pragma: export */
#include "path.h" /* IWYU pragma: export */
#include "scope.h" /* IWYU pragma: export */
#include "service.h" /* IWYU pragma: export */
#include "slice.h" /* IWYU pragma: export */
#include "socket.h" /* IWYU pragma: export */
#include "swap.h" /* IWYU pragma: export */
#include "target.h" /* IWYU pragma: export */
#include "timer.h" /* IWYU pragma: export */
#include "unit.h" /* IWYU pragma: export */
-2
View File
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <unistd.h>
#include "alloc-util.h"
@@ -10,7 +9,6 @@
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "macro.h"
#include "string-util.h"
#include "strv.h"
-2
View File
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "audit-fd.h"
#include "capability-util.h"
#include "libaudit-util.h"
+2
View File
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "forward.h"
int get_core_audit_fd(void);
void close_core_audit_fd(void);
+4 -5
View File
@@ -1,21 +1,19 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <linux/auto_dev-ioctl.h>
#include <sys/epoll.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-bus.h"
#include "alloc-util.h"
#include "async.h"
#include "automount.h"
#include "bus-error.h"
#include "bus-util.h"
#include "dbus-automount.h"
#include "dbus-unit.h"
#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "fstab-util.h"
@@ -30,6 +28,7 @@
#include "path-util.h"
#include "process-util.h"
#include "serialize.h"
#include "set.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
+1
View File
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "core-forward.h"
#include "unit.h"
typedef enum AutomountResult {
+3 -1
View File
@@ -2,18 +2,20 @@
#include <fnmatch.h>
#include <linux/bpf_insn.h>
#include <sys/stat.h>
#include "alloc-util.h"
#include "bpf-devices.h"
#include "bpf-program.h"
#include "cgroup.h"
#include "devnum-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "missing_bpf.h"
#include "nulstr-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "stdio-util.h"
#include "string-util.h"
#define PASS_JUMP_OFF 4096
+1 -5
View File
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "cgroup.h"
typedef struct BPFProgram BPFProgram;
#include "core-forward.h"
int bpf_devices_cgroup_init(BPFProgram **ret, CGroupDevicePolicy policy, bool allow_list);
int bpf_devices_apply_policy(
+4 -8
View File
@@ -1,27 +1,23 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <arpa/inet.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/bpf_insn.h>
#include <net/ethernet.h>
#include <linux/if_ether.h>
#include <net/if.h>
#include <netinet/ip.h>
#include <netinet/ip6.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "alloc-util.h"
#include "bpf-firewall.h"
#include "bpf-program.h"
#include "errno-util.h"
#include "fd-util.h"
#include "in-addr-prefix-util.h"
#include "manager.h"
#include "memory-util.h"
#include "missing_syscall.h"
#include "set.h"
#include "string-util.h"
#include "strv.h"
#include "unit.h"
#include "virt.h"
+1 -4
View File
@@ -1,10 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include "cgroup.h"
#include "unit.h"
#include "core-forward.h"
int bpf_firewall_compile(Unit *u);
int bpf_firewall_install(Unit *u);
+7 -6
View File
@@ -1,19 +1,20 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "alloc-util.h"
#include "bpf-foreign.h"
#include "bpf-program.h"
#include "cgroup.h"
#include "memory-util.h"
#include "hash-funcs.h"
#include "hashmap.h"
#include "missing_magic.h"
#include "mountpoint-util.h"
#include "set.h"
#include "siphash24.h"
#include "stat-util.h"
#include "unit.h"
typedef struct BPFForeignKey BPFForeignKey;
struct BPFForeignKey {
typedef struct BPFForeignKey {
uint32_t prog_id;
uint32_t attach_type;
};
} BPFForeignKey;
static int bpf_foreign_key_new(uint32_t prog_id,
enum bpf_attach_type attach_type,
+1 -1
View File
@@ -2,7 +2,7 @@
#pragma once
#include "unit.h"
#include "core-forward.h"
/*
* Attach cgroup-bpf programs foreign to systemd, i.e. loaded to the kernel by an entity
+3 -13
View File
@@ -1,27 +1,17 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <linux/types.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include "alloc-util.h"
#include "bpf-restrict-fs.h"
#include "cgroup-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "filesystems.h"
#include "log.h"
#include "lsm-util.h"
#include "manager.h"
#include "mkdir.h"
#include "nulstr-util.h"
#include "set.h"
#include "stat-util.h"
#include "strv.h"
#include "unit.h"
#if BPF_FRAMEWORK
/* libbpf, clang and llc compile time dependencies are satisfied */
+1 -6
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "hashmap.h"
#include "core-forward.h"
typedef enum FilesystemParseFlags {
FILESYSTEM_PARSE_INVERT = 1 << 0,
@@ -9,11 +9,6 @@ typedef enum FilesystemParseFlags {
FILESYSTEM_PARSE_LOG = 1 << 2,
} FilesystemParseFlags;
typedef struct Unit Unit;
typedef struct Manager Manager;
typedef struct restrict_fs_bpf restrict_fs_bpf;
bool bpf_restrict_fs_supported(bool initialize);
int bpf_restrict_fs_setup(Manager *m);
int bpf_restrict_fs_update(const Set *filesystems, uint64_t cgroup_id, int outer_map_fd, bool allow_list);
+6
View File
@@ -1,8 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-netlink.h"
#include "alloc-util.h"
#include "bpf-restrict-ifaces.h"
#include "cgroup.h"
#include "fd-util.h"
#include "fdset.h"
#include "netlink-util.h"
#include "set.h"
#include "unit.h"
#if BPF_FRAMEWORK
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "fdset.h"
typedef struct Unit Unit;
#include "core-forward.h"
int bpf_restrict_ifaces_supported(void);
int bpf_restrict_ifaces_install(Unit *u);
+3 -4
View File
@@ -1,11 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if BPF_FRAMEWORK
#include <bpf/bpf.h>
#endif
#include "alloc-util.h"
#include "bpf-socket-bind.h"
#include "cgroup.h"
#include "fd-util.h"
#include "fdset.h"
#include "unit.h"
#if BPF_FRAMEWORK
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "fdset.h"
typedef struct Unit Unit;
#include "core-forward.h"
int bpf_socket_bind_supported(void);
+11 -2
View File
@@ -1,7 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include "sd-bus.h"
#include "sd-messages.h"
#include "af-list.h"
@@ -10,6 +12,7 @@
#include "bpf-devices.h"
#include "bpf-firewall.h"
#include "bpf-foreign.h"
#include "bpf-program.h"
#include "bpf-restrict-ifaces.h"
#include "bpf-socket-bind.h"
#include "btrfs-util.h"
@@ -19,12 +22,14 @@
#include "cgroup-setup.h"
#include "cgroup-util.h"
#include "devnum-util.h"
#include "errno-util.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fdset.h"
#include "fileio.h"
#include "firewall-util.h"
#include "in-addr-prefix-util.h"
#include "inotify-util.h"
#include "io-util.h"
#include "ip-protocol-list.h"
#include "limits-util.h"
#include "manager.h"
@@ -32,18 +37,22 @@
#include "parse-util.h"
#include "path-util.h"
#include "percent-util.h"
#include "pidref.h"
#include "process-util.h"
#include "procfs-util.h"
#include "serialize.h"
#include "set.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "virt.h"
#if BPF_FRAMEWORK
#include "bpf-dlopen.h"
#include "bpf-link.h"
#include "bpf-restrict-fs.h"
#include "bpf/restrict_fs/restrict-fs-skel.h"
#endif
@@ -52,7 +61,7 @@
/* Returns the log level to use when cgroup attribute writes fail. When an attribute is missing or we have access
* problems we downgrade to LOG_DEBUG. This is supposed to be nice to container managers and kernels which want to mask
* out specific attributes from us. */
#define LOG_LEVEL_CGROUP_WRITE(r) (IN_SET(abs(r), ENOENT, EROFS, EACCES, EPERM) ? LOG_DEBUG : LOG_WARNING)
#define LOG_LEVEL_CGROUP_WRITE(r) (IN_SET(ABS(r), ENOENT, EROFS, EACCES, EPERM) ? LOG_DEBUG : LOG_WARNING)
static void unit_remove_from_cgroup_empty_queue(Unit *u);
+15 -35
View File
@@ -1,18 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "sd-event.h"
#include "bpf-program.h"
#include "bpf-restrict-fs.h"
#include "cgroup-util.h"
#include "core-forward.h"
#include "cpu-set-util.h"
#include "firewall-util.h"
#include "list.h"
#include "pidref.h"
#include "time-util.h"
typedef struct CGroupTasksMax {
/* If scale == 0, just use value; otherwise, value / scale.
@@ -29,15 +22,6 @@ static inline bool cgroup_tasks_max_isset(const CGroupTasksMax *tasks_max) {
uint64_t cgroup_tasks_max_resolve(const CGroupTasksMax *tasks_max);
typedef struct CGroupContext CGroupContext;
typedef struct CGroupDeviceAllow CGroupDeviceAllow;
typedef struct CGroupIODeviceWeight CGroupIODeviceWeight;
typedef struct CGroupIODeviceLimit CGroupIODeviceLimit;
typedef struct CGroupIODeviceLatency CGroupIODeviceLatency;
typedef struct CGroupBPFForeignProgram CGroupBPFForeignProgram;
typedef struct CGroupSocketBindItem CGroupSocketBindItem;
typedef struct CGroupRuntime CGroupRuntime;
typedef enum CGroupDevicePolicy {
/* When devices listed, will allow those, plus built-in ones, if none are listed will allow
* everything. */
@@ -72,43 +56,43 @@ typedef enum CGroupDevicePermissions {
_CGROUP_DEVICE_PERMISSIONS_INVALID = -EINVAL,
} CGroupDevicePermissions;
struct CGroupDeviceAllow {
typedef struct CGroupDeviceAllow {
LIST_FIELDS(CGroupDeviceAllow, device_allow);
char *path;
CGroupDevicePermissions permissions;
};
} CGroupDeviceAllow;
struct CGroupIODeviceWeight {
typedef struct CGroupIODeviceWeight {
LIST_FIELDS(CGroupIODeviceWeight, device_weights);
char *path;
uint64_t weight;
};
} CGroupIODeviceWeight;
struct CGroupIODeviceLimit {
typedef struct CGroupIODeviceLimit {
LIST_FIELDS(CGroupIODeviceLimit, device_limits);
char *path;
uint64_t limits[_CGROUP_IO_LIMIT_TYPE_MAX];
};
} CGroupIODeviceLimit;
struct CGroupIODeviceLatency {
typedef struct CGroupIODeviceLatency {
LIST_FIELDS(CGroupIODeviceLatency, device_latencies);
char *path;
usec_t target_usec;
};
} CGroupIODeviceLatency;
struct CGroupBPFForeignProgram {
typedef struct CGroupBPFForeignProgram {
LIST_FIELDS(CGroupBPFForeignProgram, programs);
uint32_t attach_type;
char *bpffs_path;
};
} CGroupBPFForeignProgram;
struct CGroupSocketBindItem {
typedef struct CGroupSocketBindItem {
LIST_FIELDS(CGroupSocketBindItem, socket_bind_items);
int address_family;
int ip_protocol;
uint16_t nr_ports;
uint16_t port_min;
};
} CGroupSocketBindItem;
typedef enum CGroupPressureWatch {
CGROUP_PRESSURE_WATCH_NO, /* → tells the service payload explicitly not to watch for memory pressure */
@@ -122,7 +106,7 @@ typedef enum CGroupPressureWatch {
/* The user-supplied cgroup-related configuration options. This remains mostly immutable while the service
* manager is running (except for an occasional SetProperty() configuration change), outside of reload
* cycles. */
struct CGroupContext {
typedef struct CGroupContext {
bool io_accounting;
bool memory_accounting;
bool tasks_accounting;
@@ -222,7 +206,7 @@ struct CGroupContext {
/* Forward coredumps for processes that crash within this cgroup.
* Requires 'delegate' to also be true. */
bool coredump_receive;
};
} CGroupContext;
/* Used when querying IP accounting data */
typedef enum CGroupIPAccountingMetric {
@@ -349,10 +333,6 @@ typedef struct CGroupRuntime {
bool warned_clamping_cpu_quota_period:1;
} CGroupRuntime;
typedef struct Unit Unit;
typedef struct Manager Manager;
typedef enum ManagerState ManagerState;
uint64_t cgroup_context_cpu_weight(CGroupContext *c, ManagerState state);
usec_t cgroup_cpu_adjust_period(usec_t period, usec_t quota, usec_t resolution, usec_t max_period);
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "forward.h"
int clock_reset_timewarp(void);
void clock_apply_epoch(bool allow_backwards);
+53
View File
@@ -0,0 +1,53 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser-forward.h" /* IWYU pragma: export */
#include "forward.h" /* IWYU pragma: export */
#include "unit-def.h" /* IWYU pragma: export */
typedef enum CGroupDevicePermissions CGroupDevicePermissions;
typedef enum CGroupDevicePolicy CGroupDevicePolicy;
typedef enum CGroupMask CGroupMask;
typedef enum ExecCleanMask ExecCleanMask;
typedef enum ExecPreserveMode ExecPreserveMode;
typedef enum FreezerAction FreezerAction;
typedef enum JobResult JobResult;
typedef enum JobState JobState;
typedef enum JobType JobType;
typedef enum ManagerState ManagerState;
typedef enum TransactionAddFlags TransactionAddFlags;
typedef enum UnitDependencyAtom UnitDependencyAtom;
typedef enum UnitWriteFlags UnitWriteFlags;
typedef struct ActivationDetails ActivationDetails;
typedef struct BindMount BindMount;
typedef struct CGroupBPFForeignProgram CGroupBPFForeignProgram;
typedef struct CGroupContext CGroupContext;
typedef struct CGroupDeviceAllow CGroupDeviceAllow;
typedef struct CGroupIODeviceLatency CGroupIODeviceLatency;
typedef struct CGroupIODeviceLimit CGroupIODeviceLimit;
typedef struct CGroupIODeviceWeight CGroupIODeviceWeight;
typedef struct CGroupRuntime CGroupRuntime;
typedef struct CGroupSocketBindItem CGroupSocketBindItem;
typedef struct DynamicCreds DynamicCreds;
typedef struct DynamicUser DynamicUser;
typedef struct ExecCommand ExecCommand;
typedef struct ExecContext ExecContext;
typedef struct ExecParameters ExecParameters;
typedef struct ExecRuntime ExecRuntime;
typedef struct ExecSharedRuntime ExecSharedRuntime;
typedef struct Job Job;
typedef struct JobDependency JobDependency;
typedef struct KillContext KillContext;
typedef struct Manager Manager;
typedef struct MountImage MountImage;
typedef struct PathSpec PathSpec;
typedef struct Scope Scope;
typedef struct Service Service;
typedef struct Socket Socket;
typedef struct SocketPeer SocketPeer;
typedef struct TemporaryFileSystem TemporaryFileSystem;
typedef struct Unit Unit;
typedef struct UnitRef UnitRef;
struct restrict_fs_bpf;
+4 -2
View File
@@ -4,16 +4,18 @@
#include "sd-messages.h"
#include "constants.h"
#include "crash-handler.h"
#include "exit-status.h"
#include "macro.h"
#include "format-util.h"
#include "log.h"
#include "main.h"
#include "missing_syscall.h"
#include "process-util.h"
#include "raw-clone.h"
#include "rlimit-util.h"
#include "signal-util.h"
#include "string-table.h"
#include "string-util.h"
#include "terminal-util.h"
#include "virt.h"
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include "macro.h"
#include "forward.h"
typedef enum CrashAction {
CRASH_FREEZE,
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_automount_vtable[];
+4 -10
View File
@@ -1,32 +1,26 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <arpa/inet.h>
#include "af-list.h"
#include "alloc-util.h"
#include "bpf-firewall.h"
#include "bpf-foreign.h"
#include "bpf-program.h"
#include "bus-get-properties.h"
#include "bus-message-util.h"
#include "bus-util.h"
#include "cgroup.h"
#include "cgroup-util.h"
#include "dbus-cgroup.h"
#include "dbus-util.h"
#include "errno-util.h"
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "firewall-util.h"
#include "in-addr-prefix-util.h"
#include "ip-protocol-list.h"
#include "limits-util.h"
#include "manager.h"
#include "memstream-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "percent-util.h"
#include "set.h"
#include "socket-util.h"
#include "string-util.h"
#include "strv.h"
#include "varlink.h"
BUS_DEFINE_PROPERTY_GET(bus_property_get_tasks_max, "t", CGroupTasksMax, cgroup_tasks_max_resolve);
+1 -3
View File
@@ -1,11 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "cgroup.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_cgroup_vtable[];
-1
View File
@@ -2,7 +2,6 @@
#include "dbus-device.h"
#include "device.h"
#include "unit.h"
const sd_bus_vtable bus_device_vtable[] = {
SD_BUS_VTABLE_START(0),
+7 -9
View File
@@ -1,48 +1,46 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <syslog.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include "af-list.h"
#include "alloc-util.h"
#include "bpf-restrict-fs.h"
#include "bus-get-properties.h"
#include "bus-unit-util.h"
#include "bus-util.h"
#include "cap-list.h"
#include "capability-util.h"
#include "cpu-set-util.h"
#include "creds-util.h"
#include "dbus-execute.h"
#include "dbus-util.h"
#include "dissect-image.h"
#include "env-util.h"
#include "errno-list.h"
#include "escape.h"
#include "exec-credential.h"
#include "execute.h"
#include "fd-util.h"
#include "fileio.h"
#include "hexdecoct.h"
#include "hostname-util.h"
#include "image-policy.h"
#include "ioprio-util.h"
#include "iovec-util.h"
#include "journal-file.h"
#include "load-fragment.h"
#include "memstream-util.h"
#include "mountpoint-util.h"
#include "namespace.h"
#include "parse-util.h"
#include "nsflags.h"
#include "ordered-set.h"
#include "path-util.h"
#include "pcre2-util.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "seccomp-util.h"
#include "securebits-util.h"
#include "set.h"
#include "specifier.h"
#include "stat-util.h"
#include "strv.h"
#include "syslog-util.h"
#include "unit-printf.h"
#include "unit.h"
#include "user-util.h"
#include "utf8.h"
+2 -3
View File
@@ -1,11 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "execute.h"
#include "unit.h"
#include "bus-get-properties.h"
#include "core-forward.h"
#define BUS_EXEC_STATUS_VTABLE(prefix, offset, flags) \
BUS_PROPERTY_DUAL_TIMESTAMP(prefix "StartTimestamp", (offset) + offsetof(ExecStatus, start_timestamp), flags), \
+3 -1
View File
@@ -4,15 +4,17 @@
#include "alloc-util.h"
#include "bus-get-properties.h"
#include "bus-object.h"
#include "bus-util.h"
#include "dbus.h"
#include "dbus-job.h"
#include "dbus-unit.h"
#include "dbus-util.h"
#include "hashmap.h"
#include "job.h"
#include "log.h"
#include "manager.h"
#include "selinux-access.h"
#include "string-util.h"
#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, job_type, JobType);
+2 -4
View File
@@ -1,11 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "bus-object.h"
typedef struct Job Job;
#include "core-forward.h"
extern const sd_bus_vtable bus_job_vtable[];
extern const BusObjectImplementation job_object;
+1
View File
@@ -5,6 +5,7 @@
#include "dbus-util.h"
#include "kill.h"
#include "signal-util.h"
#include "string-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_kill_mode, kill_mode, KillMode);
+1 -3
View File
@@ -1,11 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "kill.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_kill_vtable[];
+9 -6
View File
@@ -1,8 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <linux/capability.h>
#include <sys/prctl.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include "alloc-util.h"
@@ -16,9 +15,9 @@
#include "bus-util.h"
#include "chase.h"
#include "confidential-virt.h"
#include "dbus.h"
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus.h"
#include "dbus-job.h"
#include "dbus-manager.h"
#include "dbus-scope.h"
@@ -27,25 +26,29 @@
#include "dbus-util.h"
#include "dynamic-user.h"
#include "env-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-util.h"
#include "glyph-util.h"
#include "hashmap.h"
#include "initrd-util.h"
#include "install.h"
#include "locale-util.h"
#include "log.h"
#include "manager-dump.h"
#include "manager.h"
#include "memfd-util.h"
#include "os-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "pidref.h"
#include "process-util.h"
#include "selinux-access.h"
#include "stat-util.h"
#include "set.h"
#include "string-util.h"
#include "strv.h"
#include "syslog-util.h"
#include "taint.h"
#include "unit-name.h"
#include "user-util.h"
#include "version.h"
#include "virt.h"
+1 -3
View File
@@ -3,9 +3,7 @@
#include "sd-bus-vtable.h"
#include "time-util.h"
typedef struct Manager Manager;
#include "core-forward.h"
extern const sd_bus_vtable bus_manager_vtable[];
extern const sd_bus_vtable bus_manager_log_control_vtable[];
-1
View File
@@ -10,7 +10,6 @@
#include "mount.h"
#include "string-util.h"
#include "unit.h"
#include "utf8.h"
static int property_get_what(
sd_bus *bus,
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_mount_vtable[];
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_path_vtable[];
+3 -2
View File
@@ -4,15 +4,16 @@
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-util.h"
#include "dbus.h"
#include "dbus-cgroup.h"
#include "dbus-kill.h"
#include "dbus-manager.h"
#include "dbus-scope.h"
#include "dbus-unit.h"
#include "dbus-util.h"
#include "manager.h"
#include "pidref.h"
#include "scope.h"
#include "selinux-access.h"
#include "string-util.h"
#include "unit.h"
int bus_scope_method_abandon(sd_bus_message *message, void *userdata, sd_bus_error *error) {
+1 -4
View File
@@ -1,12 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
typedef struct Scope Scope;
#include "core-forward.h"
extern const sd_bus_vtable bus_scope_vtable[];
+7 -4
View File
@@ -1,32 +1,35 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include "alloc-util.h"
#include "async.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "constants.h"
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-manager.h"
#include "dbus-service.h"
#include "dbus-util.h"
#include "exec-credential.h"
#include "dissect-image.h"
#include "execute.h"
#include "exit-status.h"
#include "fd-util.h"
#include "fileio.h"
#include "glyph-util.h"
#include "locale-util.h"
#include "manager.h"
#include "missing_fcntl.h"
#include "mount-util.h"
#include "open-file.h"
#include "parse-util.h"
#include "path-util.h"
#include "selinux-access.h"
#include "service.h"
#include "signal-util.h"
#include "string-util.h"
#include "strv.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, service_type, ServiceType);
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_service_vtable[];
+1
View File
@@ -5,6 +5,7 @@
#include "dbus-slice.h"
#include "dbus-util.h"
#include "slice.h"
#include "string-util.h"
#include "unit.h"
static int property_get_currently_active(
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_slice_vtable[];
+1 -1
View File
@@ -9,12 +9,12 @@
#include "dbus-util.h"
#include "fd-util.h"
#include "ip-protocol-list.h"
#include "parse-util.h"
#include "path-util.h"
#include "socket.h"
#include "socket-netlink.h"
#include "socket-util.h"
#include "string-util.h"
#include "strv.h"
#include "unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, socket_result, SocketResult);
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_socket_vtable[];
-1
View File
@@ -7,7 +7,6 @@
#include "dbus-cgroup.h"
#include "dbus-execute.h"
#include "dbus-swap.h"
#include "string-util.h"
#include "swap.h"
#include "unit.h"
+1 -2
View File
@@ -5,10 +5,9 @@
Copyright © 2010 Maarten Lankhorst
***/
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_swap_vtable[];
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "dbus-target.h"
#include "unit.h"
const sd_bus_vtable bus_target_vtable[] = {
SD_BUS_VTABLE_START(0),
+2
View File
@@ -2,8 +2,10 @@
#include "alloc-util.h"
#include "bus-get-properties.h"
#include "calendarspec.h"
#include "dbus-timer.h"
#include "dbus-util.h"
#include "string-util.h"
#include "strv.h"
#include "timer.h"
#include "unit.h"
+1 -2
View File
@@ -1,10 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_timer_vtable[];
+6 -4
View File
@@ -4,10 +4,8 @@
#include "alloc-util.h"
#include "bitfield.h"
#include "bpf-firewall.h"
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "cgroup-util.h"
#include "condition.h"
@@ -17,19 +15,23 @@
#include "dbus-unit.h"
#include "dbus-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "install.h"
#include "locale-util.h"
#include "log.h"
#include "manager.h"
#include "namespace-util.h"
#include "path-util.h"
#include "process-util.h"
#include "selinux-access.h"
#include "service.h"
#include "set.h"
#include "signal-util.h"
#include "special.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "user-util.h"
#include "transaction.h"
#include "unit-name.h"
#include "web-util.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_collect_mode, collect_mode, CollectMode);
+2 -2
View File
@@ -1,9 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "sd-bus-vtable.h"
#include "unit.h"
#include "core-forward.h"
extern const sd_bus_vtable bus_unit_vtable[];
extern const sd_bus_vtable bus_unit_cgroup_vtable[];
+20 -4
View File
@@ -1,15 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "bus-polkit.h"
#include "bus-util.h"
#include "dbus-util.h"
#include "dissect-image.h"
#include "escape.h"
#include "manager.h"
#include "parse-util.h"
#include "path-util.h"
#include "reboot-util.h"
#include "strv.h"
#include "unit.h"
#include "unit-printf.h"
#include "user-util.h"
int bus_property_get_triggered_unit(
@@ -120,7 +119,7 @@ int bus_set_transient_tristate(
return 1;
}
int bus_set_transient_usec_internal(
static int bus_set_transient_usec_internal(
Unit *u,
const char *name,
usec_t *p,
@@ -151,6 +150,14 @@ int bus_set_transient_usec_internal(
return 1;
}
int bus_set_transient_usec(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error) {
return bus_set_transient_usec_internal(u, name, p, false, message, flags, error);
}
int bus_set_transient_usec_fix_0(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error) {
return bus_set_transient_usec_internal(u, name, p, true, message, flags, error);
}
int bus_verify_manage_units_async_impl(
Manager *manager,
const char *id,
@@ -193,6 +200,15 @@ int bus_verify_manage_units_async_impl(
error);
}
int bus_verify_manage_units_async_full(Unit *u, const char *verb, const char *polkit_message, sd_bus_message *call, sd_bus_error *error) {
assert(u);
return bus_verify_manage_units_async_impl(u->manager, u->id, verb, polkit_message, call, error);
}
int bus_verify_manage_units_async(Manager *manager, sd_bus_message *call, sd_bus_error *error) {
return bus_verify_manage_units_async_impl(manager, NULL, NULL, NULL, call, error);
}
int bus_verify_manage_unit_files_async(Manager *m, sd_bus_message *call, sd_bus_error *error) {
assert(m);
assert(call);
+6 -16
View File
@@ -3,7 +3,8 @@
#include "sd-bus.h"
#include "dissect-image.h"
#include "core-forward.h"
#include "string-util.h"
#include "unit.h"
int bus_property_get_triggered_unit(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
@@ -243,22 +244,11 @@ int bus_set_transient_reboot_parameter(Unit *u, const char *name, char **p, sd_b
int bus_set_transient_string(Unit *u, const char *name, char **p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
int bus_set_transient_bool(Unit *u, const char *name, bool *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
int bus_set_transient_tristate(Unit *u, const char *name, int *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
int bus_set_transient_usec_internal(Unit *u, const char *name, usec_t *p, bool fix_0, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
static inline int bus_set_transient_usec(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error) {
return bus_set_transient_usec_internal(u, name, p, false, message, flags, error);
}
static inline int bus_set_transient_usec_fix_0(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error) {
return bus_set_transient_usec_internal(u, name, p, true, message, flags, error);
}
int bus_set_transient_usec(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
int bus_set_transient_usec_fix_0(Unit *u, const char *name, usec_t *p, sd_bus_message *message, UnitWriteFlags flags, sd_bus_error *error);
int bus_verify_manage_units_async_impl(Manager *manager, const char *id, const char *verb, const char *polkit_message, sd_bus_message *call, sd_bus_error *error);
static inline int bus_verify_manage_units_async_full(Unit *u, const char *verb, const char *polkit_message, sd_bus_message *call, sd_bus_error *error) {
assert(u);
return bus_verify_manage_units_async_impl(u->manager, u->id, verb, polkit_message, call, error);
}
static inline int bus_verify_manage_units_async(Manager *manager, sd_bus_message *call, sd_bus_error *error) {
return bus_verify_manage_units_async_impl(manager, NULL, NULL, NULL, call, error);
}
int bus_verify_manage_units_async_full(Unit *u, const char *verb, const char *polkit_message, sd_bus_message *call, sd_bus_error *error);
int bus_verify_manage_units_async(Manager *manager, sd_bus_message *call, sd_bus_error *error);
int bus_verify_manage_unit_files_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
int bus_verify_reload_daemon_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
int bus_verify_set_environment_async(Manager *m, sd_bus_message *call, sd_bus_error *error);
+8 -6
View File
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <sys/epoll.h>
#include <unistd.h>
#include "sd-bus.h"
@@ -11,7 +9,7 @@
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-internal.h"
#include "bus-polkit.h"
#include "bus-object.h"
#include "bus-util.h"
#include "dbus.h"
#include "dbus-automount.h"
@@ -31,19 +29,23 @@
#include "dbus-target.h"
#include "dbus-timer.h"
#include "dbus-unit.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fdset.h"
#include "format-util.h"
#include "fs-util.h"
#include "log.h"
#include "manager.h"
#include "path-util.h"
#include "pidref.h"
#include "process-util.h"
#include "selinux-access.h"
#include "serialize.h"
#include "service.h"
#include "set.h"
#include "special.h"
#include "string-util.h"
#include "strv.h"
#include "strxcpyx.h"
#include "umask-util.h"
#include "user-util.h"
#define CONNECTIONS_MAX 4096
+1 -5
View File
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-bus.h"
#include "fdset.h"
typedef struct Manager Manager;
#include "core-forward.h"
void bus_send_pending_reload_message(Manager *m);
+5 -7
View File
@@ -1,25 +1,23 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <sys/epoll.h>
#include "sd-bus.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "dbus-device.h"
#include "dbus-unit.h"
#include "device.h"
#include "device-private.h"
#include "device-util.h"
#include "extract-word.h"
#include "hashmap.h"
#include "log.h"
#include "manager.h"
#include "parse-util.h"
#include "path-util.h"
#include "ratelimit.h"
#include "serialize.h"
#include "stat-util.h"
#include "set.h"
#include "string-util.h"
#include "strv.h"
#include "swap.h"
#include "udev-util.h"
#include "unit.h"
+1
View File
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "core-forward.h"
#include "unit.h"
/* A mask specifying where we have seen the device currently. This is a bitmask because the device might show up
+6 -4
View File
@@ -1,25 +1,27 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <grp.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "clean-ipc.h"
#include "dynamic-user.h"
#include "errno-list.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fdset.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "hashmap.h"
#include "iovec-util.h"
#include "lock-util.h"
#include "manager.h"
#include "parse-util.h"
#include "random-util.h"
#include "serialize.h"
#include "siphash24.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "string-util.h"
#include "strv.h"
#include "uid-classification.h"
#include "user-util.h"
+1 -8
View File
@@ -1,14 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include <sys/types.h>
#include "fdset.h"
#include "memory-util.h"
typedef struct Manager Manager;
#include "core-forward.h"
/* Note that this object always allocates a pair of user and group under the same name, even if one of them isn't
* used. This means, if you want to allocate a group and user pair, and they might have two different names, then you
+1 -5
View File
@@ -1,17 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include "alloc-util.h"
#include "chattr-util.h"
#include "efi-random.h"
#include "efivars.h"
#include "fd-util.h"
#include "fs-util.h"
#include "log.h"
#include "random-util.h"
#include "strv.h"
void lock_down_efi_variables(void) {
_cleanup_close_ int fd = -EBADF;
+1 -3
View File
@@ -3,15 +3,13 @@
#include <sys/reboot.h>
#include "ansi-color.h"
#include "bus-error.h"
#include "bus-util.h"
#include "emergency-action.h"
#include "manager.h"
#include "raw-reboot.h"
#include "reboot-util.h"
#include "special.h"
#include "string-table.h"
#include "terminal-util.h"
#include "string-util.h"
#include "virt.h"
static const char* const emergency_action_table[_EMERGENCY_ACTION_MAX] = {
+1 -6
View File
@@ -1,12 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include "macro.h"
#include "runtime-scope.h"
typedef struct Manager Manager;
#include "core-forward.h"
typedef enum EmergencyAction {
EMERGENCY_ACTION_NONE,
+8
View File
@@ -4,9 +4,11 @@
#include "acl-util.h"
#include "creds-util.h"
#include "errno-util.h"
#include "exec-credential.h"
#include "execute.h"
#include "fileio.h"
#include "fs-util.h"
#include "glob-util.h"
#include "io-util.h"
#include "iovec-util.h"
@@ -15,10 +17,16 @@
#include "mkdir-label.h"
#include "mount-util.h"
#include "mountpoint-util.h"
#include "ordered-set.h"
#include "path-lookup.h"
#include "path-util.h"
#include "process-util.h"
#include "random-util.h"
#include "recurse-dir.h"
#include "rm-rf.h"
#include "siphash24.h"
#include "stat-util.h"
#include "strv.h"
#include "tmpfile-util.h"
#include "user-util.h"
+1 -8
View File
@@ -1,14 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>
#include "hash-funcs.h"
typedef struct ExecContext ExecContext;
typedef struct ExecParameters ExecParameters;
#include "core-forward.h"
/* A credential configured with LoadCredential= */
typedef struct ExecLoadCredential {
+15 -4
View File
@@ -1,8 +1,11 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <grp.h>
#include <linux/ioprio.h>
#include <linux/prctl.h>
#include <linux/sched.h>
#include <linux/securebits.h>
#include <poll.h>
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
@@ -10,7 +13,6 @@
#if HAVE_PAM
#include <security/pam_appl.h>
#include <security/pam_misc.h>
#endif
#include "sd-messages.h"
@@ -24,12 +26,14 @@
#include "bpf-restrict-fs.h"
#include "btrfs-util.h"
#include "capability-util.h"
#include "cgroup.h"
#include "cgroup-setup.h"
#include "cgroup.h"
#include "chase.h"
#include "chattr-util.h"
#include "chown-recursive.h"
#include "constants.h"
#include "copy.h"
#include "coredump-util.h"
#include "dissect-image.h"
#include "dynamic-user.h"
#include "env-util.h"
#include "escape.h"
@@ -38,11 +42,11 @@
#include "execute.h"
#include "exit-status.h"
#include "fd-util.h"
#include "fs-util.h"
#include "hexdecoct.h"
#include "hostname-setup.h"
#include "image-policy.h"
#include "io-util.h"
#include "ioprio-util.h"
#include "iovec-util.h"
#include "journal-send.h"
#include "manager.h"
@@ -51,16 +55,23 @@
#include "missing_syscall.h"
#include "mkdir-label.h"
#include "mount-util.h"
#include "namespace-util.h"
#include "nsflags.h"
#include "open-file.h"
#include "osc-context.h"
#include "path-util.h"
#include "pidref.h"
#include "proc-cmdline.h"
#include "process-util.h"
#include "psi-util.h"
#include "rlimit-util.h"
#include "seccomp-util.h"
#include "selinux-util.h"
#include "set.h"
#include "signal-util.h"
#include "smack-util.h"
#include "socket-util.h"
#include "stat-util.h"
#include "string-table.h"
#include "strv.h"
#include "terminal-util.h"
+1 -5
View File
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
typedef struct ExecCommand ExecCommand;
typedef struct ExecContext ExecContext;
typedef struct ExecParameters ExecParameters;
typedef struct ExecRuntime ExecRuntime;
typedef struct CGroupContext CGroupContext;
#include "core-forward.h"
int exec_invoke(
const ExecCommand *command,
+11 -3
View File
@@ -3,23 +3,31 @@
#include "af-list.h"
#include "capability-util.h"
#include "cgroup.h"
#include "cgroup-setup.h"
#include "dissect-image.h"
#include "dynamic-user.h"
#include "escape.h"
#include "exec-credential.h"
#include "execute.h"
#include "execute-serialize.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "hexdecoct.h"
#include "image-policy.h"
#include "in-addr-prefix-util.h"
#include "log.h"
#include "nsflags.h"
#include "open-file.h"
#include "ordered-set.h"
#include "parse-helpers.h"
#include "parse-util.h"
#include "percent-util.h"
#include "path-util.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "serialize.h"
#include "set.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
static int exec_cgroup_context_serialize(const CGroupContext *c, FILE *f) {
_cleanup_free_ char *disable_controllers_str = NULL, *delegate_controllers_str = NULL,
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "execute.h"
#include "core-forward.h"
/* These functions serialize/deserialize for invocation purposes (i.e.: serialized object is passed to a
* child process) rather than to save state across reload/reexec. */
+46 -25
View File
@@ -1,20 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <linux/prctl.h>
#include <poll.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/personality.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <sys/un.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>
#include <utmpx.h>
#include "sd-messages.h"
#include "af-list.h"
#include "alloc-util.h"
@@ -23,55 +17,51 @@
#include "cap-list.h"
#include "capability-util.h"
#include "cgroup-setup.h"
#include "constants.h"
#include "coredump-util.h"
#include "cpu-set-util.h"
#include "dissect-image.h"
#include "dynamic-user.h"
#include "env-file.h"
#include "env-util.h"
#include "errno-list.h"
#include "escape.h"
#include "exec-credential.h"
#include "execute.h"
#include "execute-serialize.h"
#include "exit-status.h"
#include "fd-util.h"
#include "fdset.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "glob-util.h"
#include "hexdecoct.h"
#include "image-policy.h"
#include "io-util.h"
#include "ioprio-util.h"
#include "lock-util.h"
#include "log.h"
#include "macro.h"
#include "manager.h"
#include "manager-dump.h"
#include "memory-util.h"
#include "missing_fs.h"
#include "mkdir-label.h"
#include "mkdir.h"
#include "namespace-util.h"
#include "namespace.h"
#include "nsflags.h"
#include "open-file.h"
#include "ordered-set.h"
#include "osc-context.h"
#include "parse-util.h"
#include "path-util.h"
#include "pidref.h"
#include "process-util.h"
#include "rlimit-util.h"
#include "rm-rf.h"
#include "seccomp-util.h"
#include "securebits-util.h"
#include "selinux-util.h"
#include "serialize.h"
#include "set.h"
#include "sort-util.h"
#include "special.h"
#include "stat-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "syslog-util.h"
#include "terminal-util.h"
#include "tmpfile-util.h"
#include "umask-util.h"
#include "unit-serialize.h"
#include "user-util.h"
#include "utmp-wtmp.h"
#include "vpick.h"
@@ -386,6 +376,16 @@ const char* exec_get_private_notify_socket_path(const ExecContext *context, cons
return "/run/host/notify";
}
int exec_log_level_max(const ExecContext *context, const ExecParameters *params) {
assert(context);
assert(params);
if (params->debug_invocation)
return LOG_DEBUG;
return context->log_level_max < 0 ? log_get_max_level() : context->log_level_max;
}
bool exec_directory_is_private(const ExecContext *context, ExecDirectoryType type) {
assert(context);
@@ -1995,6 +1995,27 @@ char** exec_context_get_restrict_filesystems(const ExecContext *c) {
#endif
}
bool exec_context_restrict_namespaces_set(const ExecContext *c) {
assert(c);
return (c->restrict_namespaces & NAMESPACE_FLAGS_ALL) != NAMESPACE_FLAGS_ALL;
}
bool exec_context_restrict_filesystems_set(const ExecContext *c) {
assert(c);
return c->restrict_filesystems_allow_list ||
!set_isempty(c->restrict_filesystems);
}
bool exec_context_with_rootfs(const ExecContext *c) {
assert(c);
/* Checks if RootDirectory= or RootImage= are used */
return !empty_or_root(c->root_directory) || c->root_image;
}
int exec_context_has_vpicked_extensions(const ExecContext *context) {
int r;
+18 -67
View File
@@ -1,44 +1,21 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <sched.h>
#include <stdbool.h>
#include <stdio.h>
#include <sys/capability.h>
#include <sys/socket.h>
#include "sd-id128.h"
#include "bus-unit-util.h"
#include "cgroup-util.h"
#include "coredump-util.h"
#include "core-forward.h"
#include "cpu-set-util.h"
#include "exec-util.h"
#include "fdset.h"
#include "list.h"
#include "log.h"
#include "log-context.h"
#include "namespace.h"
#include "nsflags.h"
#include "numa-util.h"
#include "open-file.h"
#include "ordered-set.h"
#include "path-util.h"
#include "ratelimit.h"
#include "rlimit-util.h"
#include "runtime-scope.h"
#include "set.h"
#include "time-util.h"
typedef struct CGroupContext CGroupContext;
typedef struct ExecStatus ExecStatus;
typedef struct ExecCommand ExecCommand;
typedef struct ExecContext ExecContext;
typedef struct ExecSharedRuntime ExecSharedRuntime;
typedef struct DynamicCreds DynamicCreds;
typedef struct ExecRuntime ExecRuntime;
typedef struct ExecParameters ExecParameters;
typedef struct Manager Manager;
typedef struct Unit Unit;
#define EXEC_STDIN_DATA_MAX (64U*1024U*1024U)
typedef enum ExecUtmpMode {
@@ -96,29 +73,29 @@ typedef enum ExecKeyringMode {
} ExecKeyringMode;
/* Contains start and exit information about an executed command. */
struct ExecStatus {
typedef struct ExecStatus {
dual_timestamp start_timestamp;
dual_timestamp exit_timestamp;
dual_timestamp handoff_timestamp;
pid_t pid;
int code; /* as in siginfo_t::si_code */
int status; /* as in siginfo_t::si_status */
};
} ExecStatus;
/* Stores information about commands we execute. Covers both configuration settings as well as runtime data. */
struct ExecCommand {
typedef struct ExecCommand {
char *path;
char **argv;
ExecStatus exec_status; /* Note that this is not serialized to sd-executor */
ExecCommandFlags flags;
LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */
};
} ExecCommand;
/* Encapsulates certain aspects of the runtime environment that is to be shared between multiple otherwise separate
* invocations of commands. Specifically, this allows sharing of /tmp and /var/tmp data as well as network namespaces
* between invocations of commands. This is a reference counted object, with one reference taken by each currently
* active command invocation that wants to share this runtime. */
struct ExecSharedRuntime {
typedef struct ExecSharedRuntime {
unsigned n_ref;
Manager *manager;
@@ -134,9 +111,9 @@ struct ExecSharedRuntime {
/* Like netns_storage_socket, but the file descriptor is referring to the IPC namespace. */
int ipcns_storage_socket[2];
};
} ExecSharedRuntime;
struct ExecRuntime {
typedef struct ExecRuntime {
ExecSharedRuntime *shared;
DynamicCreds *dynamic_creds;
@@ -147,7 +124,7 @@ struct ExecRuntime {
* the root directory or root image. The lock prevents tmpfiles from removing the ephemeral snapshot
* until we're done using it. */
int ephemeral_storage_socket[2];
};
} ExecRuntime;
typedef enum ExecDirectoryType {
EXEC_DIRECTORY_RUNTIME,
@@ -195,7 +172,7 @@ typedef enum ExecCleanMask {
/* Encodes configuration parameters applied to invoked commands. Does not carry runtime data, but only configuration
* changes sourced from unit files and suchlike. ExecContext objects are usually embedded into Unit objects, and do not
* change after being loaded. */
struct ExecContext {
typedef struct ExecContext {
char **environment;
char **environment_files;
char **pass_environment;
@@ -386,28 +363,7 @@ struct ExecContext {
OrderedSet *import_credentials; /* ExecImportCredential */
ImagePolicy *root_image_policy, *mount_image_policy, *extension_image_policy;
};
static inline bool exec_context_restrict_namespaces_set(const ExecContext *c) {
assert(c);
return (c->restrict_namespaces & NAMESPACE_FLAGS_ALL) != NAMESPACE_FLAGS_ALL;
}
static inline bool exec_context_restrict_filesystems_set(const ExecContext *c) {
assert(c);
return c->restrict_filesystems_allow_list ||
!set_isempty(c->restrict_filesystems);
}
static inline bool exec_context_with_rootfs(const ExecContext *c) {
assert(c);
/* Checks if RootDirectory= or RootImage= are used */
return !empty_or_root(c->root_directory) || c->root_image;
}
} ExecContext;
typedef enum ExecFlags {
EXEC_APPLY_SANDBOXING = 1 << 0,
@@ -431,7 +387,7 @@ typedef enum ExecFlags {
/* Parameters for a specific invocation of a command. This structure is put together right before a command is
* executed. */
struct ExecParameters {
typedef struct ExecParameters {
RuntimeScope runtime_scope;
char **environment;
@@ -486,7 +442,7 @@ struct ExecParameters {
char invocation_id_string[SD_ID128_STRING_MAX];
bool debug_invocation;
};
} ExecParameters;
#define EXEC_PARAMETERS_INIT(_flags) \
(ExecParameters) { \
@@ -566,6 +522,9 @@ char** exec_context_get_syscall_archs(const ExecContext *c);
char** exec_context_get_syscall_log(const ExecContext *c);
char** exec_context_get_address_families(const ExecContext *c);
char** exec_context_get_restrict_filesystems(const ExecContext *c);
bool exec_context_restrict_namespaces_set(const ExecContext *c);
bool exec_context_restrict_filesystems_set(const ExecContext *c);
bool exec_context_with_rootfs(const ExecContext *c);
int exec_context_has_vpicked_extensions(const ExecContext *context);
@@ -645,15 +604,7 @@ bool exec_is_cgroup_mount_read_only(const ExecContext *context);
const char* exec_get_private_notify_socket_path(const ExecContext *context, const ExecParameters *params, bool needs_sandboxing);
static inline int exec_log_level_max(const ExecContext *context, const ExecParameters *params) {
assert(context);
assert(params);
if (params->debug_invocation)
return LOG_DEBUG;
return context->log_level_max < 0 ? log_get_max_level() : context->log_level_max;
}
int exec_log_level_max(const ExecContext *context, const ExecParameters *params);
/* These logging macros do the same logging as those in unit.h, but using ExecContext and ExecParameters
* instead of the unit object, so that it can be used in the sd-executor context (where the unit object is
+2 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <unistd.h>
#include <stdlib.h>
#include "sd-messages.h"
@@ -20,6 +20,7 @@
#include "fileio.h"
#include "getopt-defs.h"
#include "label-util.h"
#include "log.h"
#include "parse-util.h"
#include "pretty-print.h"
#include "selinux-util.h"
+4 -2
View File
@@ -18,13 +18,15 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include "alloc-util.h"
#include "cgroup.h"
#include "dynamic-user.h"
#include "execute-serialize.h"
#include "execute.h"
#include "fd-util.h"
#include "fdset.h"
#include "fuzz.h"
#include "service.h"
static void exec_fuzz_one(FILE *f, FDSet *fdset) {
_cleanup_(exec_params_deep_clear) ExecParameters params = EXEC_PARAMETERS_INIT(/* flags= */ 0);
+1 -2
View File
@@ -2,12 +2,11 @@
#include <stdio.h>
#include "alloc-util.h"
#include "fd-util.h"
#include "fdset.h"
#include "fuzz.h"
#include "manager.h"
#include "manager-serialize.h"
#include "service.h"
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
_cleanup_(manager_freep) Manager *m = NULL;
-1
View File
@@ -3,7 +3,6 @@
#include "conf-parser.h"
#include "fd-util.h"
#include "fuzz.h"
#include "install.h"
#include "load-fragment.h"
#include "manager.h"
#include "manager-dump.h"
+1 -1
View File
@@ -4,8 +4,8 @@
#include "errno-util.h"
#include "generator-setup.h"
#include "macro.h"
#include "mkdir-label.h"
#include "path-lookup.h"
#include "rm-rf.h"
int lookup_paths_mkdir_generator(LookupPaths *p) {
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "path-lookup.h"
#include "forward.h"
int lookup_paths_mkdir_generator(LookupPaths *p);
void lookup_paths_trim_generator(LookupPaths *p);
-3
View File
@@ -4,10 +4,7 @@
TORSEC group — http://security.polito.it
***/
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "alloc-util.h"
+5
View File
@@ -1,10 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/mount.h>
#include "confidential-virt.h"
#include "copy.h"
#include "creds-util.h"
#include "errno-util.h"
#include "escape.h"
#include "fileio.h"
#include "format-util.h"
@@ -13,6 +15,7 @@
#include "import-creds.h"
#include "initrd-util.h"
#include "io-util.h"
#include "log.h"
#include "mkdir-label.h"
#include "mount-util.h"
#include "mountpoint-util.h"
@@ -21,6 +24,8 @@
#include "proc-cmdline.h"
#include "recurse-dir.h"
#include "smbios11.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "virt.h"
-1
View File
@@ -10,7 +10,6 @@
#include "fileio.h"
#include "ipe-setup.h"
#include "log.h"
#include "nulstr-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
+3 -7
View File
@@ -1,32 +1,28 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include "sd-id128.h"
#include "sd-bus.h"
#include "sd-messages.h"
#include "alloc-util.h"
#include "ansi-color.h"
#include "async.h"
#include "cgroup.h"
#include "condition.h"
#include "dbus.h"
#include "dbus-job.h"
#include "escape.h"
#include "fileio.h"
#include "job.h"
#include "log.h"
#include "macro.h"
#include "manager.h"
#include "parse-util.h"
#include "prioq.h"
#include "serialize.h"
#include "set.h"
#include "sort-util.h"
#include "special.h"
#include "stdio-util.h"
#include "string-table.h"
#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "unit.h"
#include "virt.h"
+9 -25
View File
@@ -1,24 +1,8 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "sd-bus.h"
#include "sd-event.h"
#include "core-forward.h"
#include "list.h"
#include "memory-util.h"
#include "time-util.h"
#include "unit-dependency-atom.h"
typedef struct ActivationDetails ActivationDetails;
typedef struct Job Job;
typedef struct JobDependency JobDependency;
typedef enum JobType JobType;
typedef enum JobState JobState;
typedef enum JobResult JobResult;
typedef struct Manager Manager;
typedef struct Unit Unit;
/* Be careful when changing the job types! Adjust job_merging_table[] accordingly! */
enum JobType {
@@ -65,14 +49,14 @@ enum JobType {
_JOB_TYPE_INVALID = -EINVAL,
};
enum JobState {
typedef enum JobState {
JOB_WAITING,
JOB_RUNNING,
_JOB_STATE_MAX,
_JOB_STATE_INVALID = -EINVAL,
};
} JobState;
enum JobResult {
typedef enum JobResult {
JOB_DONE, /* Job completed successfully (or skipped due to an unmet ConditionXYZ=) */
JOB_CANCELED, /* Job canceled by a conflicting job installation or by explicit cancel request */
JOB_TIMEOUT, /* Job timeout elapsed */
@@ -88,9 +72,9 @@ enum JobResult {
JOB_CONCURRENCY, /* Slice the unit is in has its hard concurrency limit reached */
_JOB_RESULT_MAX,
_JOB_RESULT_INVALID = -EINVAL,
};
} JobResult;
struct JobDependency {
typedef struct JobDependency {
/* Encodes that the 'subject' job needs the 'object' job in
* some way. This structure is used only while building a transaction. */
Job *subject;
@@ -101,9 +85,9 @@ struct JobDependency {
bool matters:1;
bool conflicts:1;
};
} JobDependency;
struct Job {
typedef struct Job {
Manager *manager;
Unit *unit;
@@ -158,7 +142,7 @@ struct Job {
bool ref_by_private_bus:1;
bool in_gc_queue:1;
};
} Job;
Job* job_new(Unit *unit, JobType type);
Job* job_new_raw(Unit *unit);
+2
View File
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdio.h>
#include "kill.h"
#include "signal-util.h"
#include "string-table.h"
+1 -5
View File
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include "macro.h"
#include "forward.h"
typedef enum KillMode {
/* The kill mode is a property of a unit. */
-2
View File
@@ -3,13 +3,11 @@
#include <unistd.h>
#include "alloc-util.h"
#include "bus-util.h"
#include "capability-util.h"
#include "efi-api.h"
#include "fileio.h"
#include "kmod-setup.h"
#include "log.h"
#include "macro.h"
#include "module-util.h"
#include "recurse-dir.h"
#include "string-util.h"
-1
View File
@@ -8,7 +8,6 @@
#include "log.h"
#include "manager.h"
#include "stat-util.h"
#include "string-util.h"
#include "strv.h"
#include "unit.h"
#include "unit-name.h"
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
typedef struct Unit Unit;
#include "core-forward.h"
/* Read service data supplementary drop-in directories */
+1
View File
@@ -275,6 +275,7 @@ _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
#endif
#include <stddef.h>
#include "all-units.h"
#include "condition.h"
#include "conf-parser.h"
#include "image-policy.h"
#include "in-addr-prefix-util.h"
+12 -13
View File
@@ -3,40 +3,37 @@
Copyright © 2012 Holger Hans Peter Freyther
***/
#include <errno.h>
#include <fcntl.h>
#include <linux/oom.h>
#include <sched.h>
#include <sys/resource.h>
#include "sd-bus.h"
#include "sd-messages.h"
#include "af-list.h"
#include "all-units.h"
#include "alloc-util.h"
#include "bpf-firewall.h"
#include "bpf-program.h"
#include "bpf-restrict-fs.h"
#include "bpf-socket-bind.h"
#include "bus-error.h"
#include "bus-internal.h"
#include "bus-util.h"
#include "calendarspec.h"
#include "cap-list.h"
#include "capability-util.h"
#include "cgroup-setup.h"
#include "condition.h"
#include "conf-parser.h"
#include "coredump-util.h"
#include "cpu-set-util.h"
#include "creds-util.h"
#include "dissect-image.h"
#include "env-util.h"
#include "errno-list.h"
#include "escape.h"
#include "exec-credential.h"
#include "execute.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "firewall-util.h"
#include "fs-util.h"
#include "fstab-util.h"
#include "hashmap.h"
#include "hexdecoct.h"
#include "hostname-util.h"
#include "ioprio-util.h"
@@ -46,10 +43,12 @@
#include "limits-util.h"
#include "load-fragment.h"
#include "log.h"
#include "missing_fs.h"
#include "manager.h"
#include "mountpoint-util.h"
#include "nsflags.h"
#include "nulstr-util.h"
#include "open-file.h"
#include "ordered-set.h"
#include "parse-helpers.h"
#include "parse-util.h"
#include "path-util.h"
@@ -60,6 +59,8 @@
#include "seccomp-util.h"
#include "securebits-util.h"
#include "selinux-util.h"
#include "set.h"
#include "show-status.h"
#include "signal-util.h"
#include "socket-netlink.h"
#include "specifier.h"
@@ -71,8 +72,6 @@
#include "unit-name.h"
#include "unit-printf.h"
#include "user-util.h"
#include "utf8.h"
#include "varlink.h"
#include "web-util.h"
static int parse_socket_protocol(const char *s) {
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "conf-parser.h"
typedef struct Unit Unit;
#include "core-forward.h"
/* These functions are declared in the header to make them accessible to unit tests. */
bool contains_instance_specifier_superset(const char *s);
+6 -7
View File
@@ -1,13 +1,14 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <linux/oom.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/utsname.h>
#include <unistd.h>
#if HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#endif
@@ -22,10 +23,8 @@
#include "argv-util.h"
#include "build.h"
#include "bus-error.h"
#include "bus-util.h"
#include "capability-util.h"
#include "cgroup-setup.h"
#include "cgroup-util.h"
#include "chase.h"
#include "clock-util.h"
#include "clock-warp.h"
@@ -33,25 +32,24 @@
#include "confidential-virt.h"
#include "constants.h"
#include "copy.h"
#include "coredump-util.h"
#include "cpu-set-util.h"
#include "crash-handler.h"
#include "dbus.h"
#include "dbus-manager.h"
#include "dev-setup.h"
#include "efi-random.h"
#include "efivars.h"
#include "emergency-action.h"
#include "env-util.h"
#include "escape.h"
#include "exit-status.h"
#include "fd-util.h"
#include "fdset.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "getopt-defs.h"
#include "hexdecoct.h"
#include "hostname-setup.h"
#include "id128-util.h"
#include "ima-setup.h"
#include "import-creds.h"
#include "initrd-util.h"
@@ -80,7 +78,6 @@
#include "pretty-print.h"
#include "proc-cmdline.h"
#include "process-util.h"
#include "psi-util.h"
#include "random-util.h"
#include "rlimit-util.h"
#include "rm-rf.h"
@@ -88,6 +85,7 @@
#include "selinux-setup.h"
#include "selinux-util.h"
#include "serialize.h"
#include "set.h"
#include "signal-util.h"
#include "smack-setup.h"
#include "special.h"
@@ -99,6 +97,7 @@
#include "terminal-util.h"
#include "time-util.h"
#include "umask-util.h"
#include "unit-name.h"
#include "user-util.h"
#include "version.h"
#include "virt.h"
+1 -2
View File
@@ -1,8 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include "forward.h"
#include "crash-handler.h"
extern bool arg_dump_core;
+5 -2
View File
@@ -1,14 +1,17 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fnmatch.h>
#include <stdio.h>
#include "sd-bus.h"
#include "build.h"
#include "fd-util.h"
#include "fileio.h"
#include "hashmap.h"
#include "manager.h"
#include "manager-dump.h"
#include "memstream-util.h"
#include "string-util.h"
#include "strv.h"
#include "unit-serialize.h"
#include "version.h"
+1 -3
View File
@@ -1,9 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdio.h>
typedef struct Manager Manager;
#include "core-forward.h"
void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix);
int manager_get_dump_jobs_string(Manager *m, char **patterns, const char *prefix, char **ret);
+6 -4
View File
@@ -1,19 +1,21 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "sd-varlink.h"
#include "clean-ipc.h"
#include "alloc-util.h"
#include "dbus.h"
#include "dynamic-user.h"
#include "fd-util.h"
#include "fdset.h"
#include "fileio.h"
#include "format-util.h"
#include "glyph-util.h"
#include "hashmap.h"
#include "initrd-util.h"
#include "macro.h"
#include "manager.h"
#include "manager-serialize.h"
#include "parse-util.h"
#include "serialize.h"
#include "string-util.h"
#include "strv.h"
#include "syslog-util.h"
#include "unit-serialize.h"
#include "user-util.h"
+1 -6
View File
@@ -1,12 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include "fdset.h"
typedef struct Manager Manager;
#include "core-forward.h"
#define DESTROY_IPC_FLAG (UINT32_C(1) << 31)
+6
View File
@@ -2,11 +2,17 @@
#include <sys/prctl.h>
#include "sd-varlink.h"
#include "alloc-util.h"
#include "architecture.h"
#include "build.h"
#include "confidential-virt.h"
#include "json-util.h"
#include "manager-varlink.h"
#include "manager.h"
#include "set.h"
#include "strv.h"
#include "syslog-util.h"
#include "taint.h"
#include "version.h"
+1 -2
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-json.h"
#include "sd-varlink.h"
#include "forward.h"
int vl_method_describe_manager(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);

Some files were not shown because too many files have changed in this diff Show More