Split out of #37344.
#include <stdlib.h>
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "dns-domain.h"
#include "fd-util.h"
+#include "hash-funcs.h"
#include "home-util.h"
-#include "libcrypt-util.h"
-#include "memory-util.h"
#include "path-util.h"
#include "string-util.h"
#include "strv.h"
+#include "user-record.h"
#include "user-util.h"
+/* This should be 83% right now, i.e. 100 of (100 + 20). Let's protect us against accidental changes. */
+assert_cc(USER_DISK_SIZE_DEFAULT_PERCENT == 83U);
+
DEFINE_HASH_OPS_FULL(blob_fd_hash_ops, char, path_hash_func, path_compare, free, void, close_fd_ptr);
bool suitable_user_name(const char *name) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-
-#include "sd-bus.h"
-
-#include "hash-funcs.h"
-#include "time-util.h"
-#include "user-record.h"
+#include "forward.h"
/* Flags supported by UpdateEx() */
#define SD_HOMED_UPDATE_OFFLINE (UINT64_C(1) << 0)
* rebalancing. */
#define USER_DISK_SIZE_DEFAULT_PERCENT ((unsigned) ((100 * REBALANCE_WEIGHT_DEFAULT) / (REBALANCE_WEIGHT_DEFAULT + REBALANCE_WEIGHT_BACKING)))
-/* This should be 83% right now, i.e. 100 of (100 + 20). Let's protect us against accidental changes. */
-assert_cc(USER_DISK_SIZE_DEFAULT_PERCENT == 83U);
-
extern const struct hash_ops blob_fd_hash_ops;
bool suitable_user_name(const char *name);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#if HAVE_LIBFIDO2
-#include <fido.h>
-#endif
-
#include "alloc-util.h"
-#include "ask-password-api.h"
#include "errno-util.h"
#include "fido2-util.h"
-#include "format-table.h"
#include "hexdecoct.h"
#include "homectl-fido2.h"
#include "homectl-pkcs11.h"
#include "json-util.h"
#include "libcrypt-util.h"
#include "libfido2-util.h"
-#include "locale-util.h"
#include "log.h"
-#include "memory-util.h"
-#include "random-util.h"
#include "string-util.h"
#include "strv.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
-
-#include "libfido2-util.h"
+#include "forward.h"
int identity_add_fido2_parameters(sd_json_variant **v, const char *device, Fido2EnrollFlags lock_with, int cred_alg);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-json.h"
+
#include "errno-util.h"
-#include "format-table.h"
#include "hexdecoct.h"
#include "homectl-pkcs11.h"
#include "libcrypt-util.h"
#include "log.h"
-#include "memory-util.h"
#include "openssl-util.h"
#include "pkcs11-util.h"
+#include "string-util.h"
#include "strv.h"
int identity_add_token_pin(sd_json_variant **v, const char *pin) {
return 0;
}
+#endif
+
int identity_add_pkcs11_key_data(sd_json_variant **v, const char *uri) {
+#if HAVE_P11KIT
_cleanup_(erase_and_freep) void *decrypted_key = NULL, *saved_key = NULL;
_cleanup_(erase_and_freep) char *pin = NULL;
size_t decrypted_key_size, saved_key_size;
return r;
return 0;
-}
-
+#else
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "PKCS#11 tokens not supported on this build.");
#endif
+}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
-
-#include "log.h"
+#include "forward.h"
int identity_add_token_pin(sd_json_variant **v, const char *pin);
-
-#if HAVE_P11KIT
int identity_add_pkcs11_key_data(sd_json_variant **v, const char *token_uri);
-#else
-static inline int identity_add_pkcs11_key_data(sd_json_variant **v, const char *token_uri) {
- return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "PKCS#11 tokens not supported on this build.");
-}
-#endif
int list_pkcs11_tokens(void);
int find_pkcs11_token_auto(char **ret);
#include "log.h"
#include "memory-util.h"
#include "qrcode-util.h"
-#include "random-util.h"
#include "recovery-key.h"
#include "strv.h"
-#include "terminal-util.h"
static int add_privileged(sd_json_variant **v, const char *hashed) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *e = NULL, *w = NULL, *l = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-json.h"
+#include "forward.h"
int identity_add_recovery_key(sd_json_variant **v);
#include "cap-list.h"
#include "capability-util.h"
#include "cgroup-util.h"
-#include "copy.h"
#include "creds-util.h"
#include "dirent-util.h"
#include "dns-domain.h"
#include "env-util.h"
+#include "errno-util.h"
#include "extract-word.h"
#include "fd-util.h"
#include "fileio.h"
#include "format-table.h"
+#include "format-util.h"
#include "fs-util.h"
#include "glyph-util.h"
#include "hashmap.h"
#include "libfido2-util.h"
#include "locale-util.h"
#include "main-func.h"
-#include "memory-util.h"
#include "openssl-util.h"
#include "pager.h"
#include "parse-argument.h"
#include "process-util.h"
#include "recurse-dir.h"
#include "rlimit-util.h"
-#include "rm-rf.h"
+#include "runtime-scope.h"
+#include "stat-util.h"
+#include "string-util.h"
+#include "strv.h"
#include "terminal-util.h"
+#include "time-util.h"
#include "uid-classification.h"
#include "user-record.h"
#include "user-record-password-quality.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+#include "sd-json.h"
+
#include "alloc-util.h"
#include "fd-util.h"
+#include "hashmap.h"
#include "home-util.h"
#include "homed-bus.h"
#include "stat-util.h"
-#include "strv.h"
+#include "user-record.h"
int bus_message_read_secret(sd_bus_message *m, UserRecord **ret, sd_bus_error *error) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL, *full = NULL;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-#include "sd-json.h"
-
-#include "hashmap.h"
-#include "user-record.h"
+#include "forward.h"
int bus_message_read_secret(sd_bus_message *m, UserRecord **ret, sd_bus_error *error);
int bus_message_read_home_record(sd_bus_message *m, UserRecordLoadFlags flags, UserRecord **ret, sd_bus_error *error);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include "conf-parser.h"
-#include "constants.h"
#include "home-util.h"
#include "homed-conf.h"
+#include "string-util.h"
+#include "user-record.h"
int manager_parse_config_file(Manager *m) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "conf-parser.h"
-#include "homed-manager.h"
+#include "homed-forward.h"
int manager_parse_config_file(Manager *m);
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "conf-parser-forward.h" /* IWYU pragma: export */
+#include "forward.h" /* IWYU pragma: export */
+
+typedef struct Manager Manager;
+typedef struct Home Home;
+typedef struct Operation Operation;
#include <stddef.h>
#include "conf-parser.h"
#include "homed-conf.h"
+#include "homed-manager.h"
%}
struct ConfigPerfItem;
%null_strings
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/capability.h>
+#include "sd-bus.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "fd-util.h"
#include "format-util.h"
+#include "hashmap.h"
#include "home-util.h"
#include "homed-bus.h"
#include "homed-home.h"
#include "homed-home-bus.h"
#include "homed-manager.h"
+#include "homed-operation.h"
#include "log.h"
+#include "string-util.h"
#include "strv.h"
#include "user-record-util.h"
#include "user-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "bus-object.h"
-#include "homed-home.h"
+#include "homed-forward.h"
int bus_home_get_record_json(Home *h, sd_bus_message *message, char **ret, bool *ret_incomplete);
#include <sys/quota.h>
#include <sys/vfs.h>
+#include "sd-bus.h"
+
#include "blockdev-util.h"
#include "btrfs-util.h"
#include "build-path.h"
#include "fd-util.h"
#include "fileio.h"
#include "filesystems.h"
-#include "fs-util.h"
+#include "format-util.h"
#include "glyph-util.h"
#include "home-util.h"
#include "homed-home.h"
#include "homed-home-bus.h"
#include "homed-manager.h"
+#include "homed-operation.h"
#include "json-util.h"
#include "log.h"
#include "memfd-util.h"
-#include "missing_magic.h"
#include "missing_mman.h"
#include "mkdir.h"
+#include "ordered-set.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "quota-util.h"
#include "resize-fs.h"
#include "rm-rf.h"
-#include "set.h"
#include "signal-util.h"
#include "stat-util.h"
#include "string-table.h"
#include "strv.h"
+#include "time-util.h"
#include "uid-classification.h"
#include "user-record.h"
#include "user-record-password-quality.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "hashmap.h"
-#include "homed-operation.h"
-#include "list.h"
-#include "ordered-set.h"
+#include "forward.h"
+#include "homed-forward.h"
#include "pidref.h"
#include "stat-util.h"
-#include "user-record.h"
-
-typedef struct Manager Manager;
typedef enum HomeState {
HOME_UNFIXATED, /* home exists, but local record does not */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <linux/capability.h>
+#include <grp.h>
+#include <pwd.h>
+
+#include "sd-bus.h"
+#include "sd-event.h"
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-message-util.h"
+#include "bus-object.h"
#include "bus-polkit.h"
#include "fileio.h"
#include "format-util.h"
#include "home-util.h"
#include "homed-bus.h"
#include "homed-home-bus.h"
+#include "homed-home.h"
#include "homed-manager.h"
#include "homed-manager-bus.h"
+#include "homed-operation.h"
#include "log.h"
#include "openssl-util.h"
#include "path-util.h"
+#include "set.h"
+#include "string-util.h"
#include "strv.h"
#include "user-record-sign.h"
#include "user-record-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "bus-object.h"
+#include "homed-forward.h"
extern const BusObjectImplementation manager_object;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <grp.h>
+#include <linux/fscrypt.h>
#include <linux/magic.h>
#include <math.h>
#include <openssl/pem.h>
#include <pwd.h>
+#include <sys/inotify.h>
#include <sys/ioctl.h>
#include <sys/quota.h>
#include <sys/stat.h>
+#include "sd-bus.h"
+#include "sd-event.h"
+#include "sd-gpt.h"
#include "sd-id128.h"
+#include "alloc-util.h"
#include "btrfs-util.h"
#include "bus-common-errors.h"
#include "bus-error.h"
#include "bus-log-control-api.h"
-#include "bus-polkit.h"
+#include "bus-object.h"
#include "clean-ipc.h"
#include "common-signal.h"
#include "conf-files.h"
#include "device-util.h"
#include "dirent-util.h"
+#include "errno-util.h"
#include "fd-util.h"
+#include "fdset.h"
#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
#include "glyph-util.h"
-#include "gpt.h"
#include "home-util.h"
#include "homed-conf.h"
#include "homed-home.h"
-#include "homed-home-bus.h"
#include "homed-manager.h"
#include "homed-manager-bus.h"
+#include "homed-operation.h"
#include "homed-varlink.h"
-#include "io-util.h"
-#include "missing_fs.h"
#include "mkdir.h"
#include "notify-recv.h"
#include "openssl-util.h"
-#include "process-util.h"
+#include "ordered-set.h"
#include "quota-util.h"
#include "random-util.h"
#include "resize-fs.h"
#include "rm-rf.h"
-#include "socket-util.h"
+#include "set.h"
+#include "siphash24.h"
#include "sort-util.h"
#include "stat-util.h"
+#include "string-util.h"
#include "strv.h"
#include "sync-util.h"
+#include "time-util.h"
#include "tmpfile-util.h"
#include "udev-util.h"
#include "user-record.h"
#include <openssl/evp.h>
-#include "sd-bus.h"
-#include "sd-device.h"
-#include "sd-event.h"
-#include "sd-varlink.h"
-
-#include "hashmap.h"
-#include "homed-home.h"
+#include "homed-forward.h"
+#include "user-record.h"
/* The LUKS free disk space rebalancing logic goes through this state machine */
typedef enum RebalanceState {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "fd-util.h"
#include "homed-operation.h"
#include "log.h"
+#include "user-record.h"
Operation *operation_new(OperationType type, sd_bus_message *m) {
Operation *o;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
+#include "sd-bus-protocol.h"
-#include "user-record.h"
+#include "homed-forward.h"
typedef enum OperationType {
OPERATION_ACQUIRE, /* enqueued on AcquireHome() */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "format-util.h"
+#include "sd-varlink.h"
+
#include "group-record.h"
+#include "hashmap.h"
+#include "homed-home.h"
+#include "homed-manager.h"
#include "homed-varlink.h"
#include "json-util.h"
#include "log.h"
+#include "string-util.h"
#include "strv.h"
#include "user-record.h"
#include "user-record-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "homed-manager.h"
+#include "homed-forward.h"
int vl_method_get_user_record(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);
int vl_method_get_group_record(sd_varlink *link, sd_json_variant *parameters, sd_varlink_method_flags_t flags, void *userdata);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
-#include <sys/types.h>
+
+#include "sd-event.h"
#include "bus-log-control-api.h"
+#include "bus-object.h"
#include "daemon-util.h"
#include "homed-manager.h"
#include "homed-manager-bus.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <unistd.h>
+
+#include "alloc-util.h"
#include "copy.h"
#include "fd-util.h"
-#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "hashmap.h"
#include "home-util.h"
-#include "homework.h"
#include "homework-blob.h"
#include "install-file.h"
#include "log.h"
-#include "macro.h"
-#include "path-util.h"
#include "recurse-dir.h"
#include "rm-rf.h"
#include "sha256.h"
-#include "string-util.h"
+#include "stat-util.h"
#include "tmpfile-util.h"
-#include "umask-util.h"
-#include "utf8.h"
+#include "user-record-util.h"
+#include "user-record.h"
+#include "user-util.h"
static int copy_one_blob(
int src_fd,
#pragma once
-#include "user-record.h"
+#include "homework-forward.h"
int home_reconcile_blob_dirs(UserRecord *h, int root_fd, int reconciled);
#include <sys/mount.h>
-#include "dirent-util.h"
+#include "alloc-util.h"
+#include "env-util.h"
#include "fd-util.h"
-#include "fileio.h"
#include "format-util.h"
#include "fs-util.h"
+#include "homework.h"
#include "homework-cifs.h"
#include "homework-mount.h"
#include "log.h"
#include "memfd-util.h"
-#include "mkdir.h"
#include "mount-util.h"
+#include "path-util.h"
#include "process-util.h"
#include "stat-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "user-record-util.h"
+#include "user-record.h"
int home_setup_cifs(
UserRecord *h,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "homework.h"
-#include "user-record.h"
+#include "homework-forward.h"
int home_setup_cifs(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup);
#include <sys/mount.h>
#include "btrfs-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "homework-blob.h"
#include "homework-directory.h"
#include "log.h"
#include "mkdir.h"
#include "mount-util.h"
-#include "path-util.h"
+#include "homework.h"
#include "rm-rf.h"
+#include "string-util.h"
#include "tmpfile-util.h"
#include "umask-util.h"
+#include "user-record-util.h"
+#include "user-record.h"
#include "user-util.h"
int home_setup_directory(UserRecord *h, HomeSetup *setup) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "homework.h"
-#include "user-record.h"
+#include "homework-forward.h"
int home_setup_directory(UserRecord *h, HomeSetup *setup);
int home_activate_directory(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <fido.h>
-
#include "hexdecoct.h"
#include "homework-fido2.h"
#include "libfido2-util.h"
#include "log.h"
#include "memory-util.h"
#include "strv.h"
+#include "user-record.h"
int fido2_use_token(
UserRecord *h,
const Fido2HmacSalt *salt,
char **ret) {
+#if HAVE_LIBFIDO2
_cleanup_(erase_and_freep) void *hmac = NULL;
size_t hmac_size;
Fido2EnrollFlags flags = 0;
return log_error_errno(ss, "Failed to base64 encode HMAC secret: %m");
return 0;
+#else
+ return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "FIDO2 token support not available.");
+#endif
}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "user-record.h"
+#include "homework-forward.h"
int fido2_use_token(UserRecord *h, UserRecord *secret, const Fido2HmacSalt *salt, char **ret);
--- /dev/null
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "forward.h" /* IWYU pragma: export */
+
+typedef enum HomeSetupFlags HomeSetupFlags;
+
+typedef struct PasswordCache PasswordCache;
+typedef struct HomeSetup HomeSetup;
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <linux/fscrypt.h>
#include <openssl/evp.h>
#include <openssl/sha.h>
#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
#include <sys/xattr.h>
+#include "alloc-util.h"
#include "errno-util.h"
#include "fd-util.h"
+#include "format-util.h"
#include "hexdecoct.h"
#include "homework-fscrypt.h"
#include "homework-mount.h"
+#include "homework-password-cache.h"
#include "homework-quota.h"
+#include "homework.h"
#include "keyring-util.h"
#include "log.h"
#include "memory-util.h"
-#include "missing_fs.h"
#include "missing_keyctl.h"
#include "missing_syscall.h"
#include "mkdir.h"
#include "random-util.h"
#include "rm-rf.h"
#include "stdio-util.h"
+#include "string-util.h"
#include "strv.h"
#include "tmpfile-util.h"
+#include "user-record-util.h"
+#include "user-record.h"
#include "user-util.h"
#include "xattr-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "homework.h"
-#include "user-record.h"
+#include "homework-forward.h"
int home_setup_fscrypt(UserRecord *h, HomeSetup *setup, const PasswordCache *cache);
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/xattr.h>
-
#if HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
#include "sd-daemon.h"
#include "sd-device.h"
#include "sd-event.h"
+#include "sd-gpt.h"
#include "sd-id128.h"
#include "blkid-util.h"
#include "blockdev-util.h"
#include "btrfs-util.h"
#include "chattr-util.h"
+#include "cryptsetup-util.h"
#include "device-util.h"
#include "devnum-util.h"
-#include "dm-util.h"
+#include "dissect-image.h"
#include "env-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "fdisk-util.h"
#include "fileio.h"
#include "filesystems.h"
+#include "format-util.h"
#include "fs-util.h"
#include "fsck-util.h"
#include "glyph-util.h"
-#include "gpt.h"
#include "home-util.h"
+#include "homework.h"
#include "homework-blob.h"
#include "homework-luks.h"
#include "homework-mount.h"
+#include "homework-password-cache.h"
#include "io-util.h"
#include "json-util.h"
#include "keyring-util.h"
+#include "loop-util.h"
#include "memory-util.h"
#include "missing_magic.h"
+#include "missing_syscall.h"
#include "mkdir.h"
#include "mkfs-util.h"
-#include "mount-util.h"
#include "openssl-util.h"
#include "parse-util.h"
#include "path-util.h"
#include "process-util.h"
#include "random-util.h"
#include "resize-fs.h"
+#include "string-util.h"
#include "strv.h"
#include "sync-util.h"
+#include "time-util.h"
#include "tmpfile-util.h"
#include "udev-util.h"
+#include "user-record-util.h"
+#include "user-record.h"
#include "user-util.h"
/* Round down to the nearest 4K size. Given that newer hardware generally prefers 4K sectors, let's align our
return 1;
}
+
+uint64_t luks_volume_key_size_convert(struct crypt_device *cd) {
+ int k;
+
+ assert(cd);
+
+ /* Convert the "int" to uint64_t, which we usually use for byte sizes stored on disk. */
+
+ k = sym_crypt_get_volume_key_size(cd);
+ if (k <= 0)
+ return UINT64_MAX;
+
+ return (uint64_t) k;
+}
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "cryptsetup-util.h"
-#include "homework.h"
-#include "user-record.h"
+#include "homework-forward.h"
int home_setup_luks(UserRecord *h, HomeSetupFlags flags, const char *force_image_path, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_luks_home);
int home_auto_shrink_luks(UserRecord *h, HomeSetup *setup, PasswordCache *cache);
-static inline uint64_t luks_volume_key_size_convert(struct crypt_device *cd) {
- int k;
-
- assert(cd);
-
- /* Convert the "int" to uint64_t, which we usually use for byte sizes stored on disk. */
-
- k = sym_crypt_get_volume_key_size(cd);
- if (k <= 0)
- return UINT64_MAX;
-
- return (uint64_t) k;
-}
+uint64_t luks_volume_key_size_convert(struct crypt_device *cd);
int run_fitrim(int root_fd);
int run_fallocate(int backing_fd, const struct stat *st);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sched.h>
+#include <stdlib.h>
#include <sys/mount.h>
#include "alloc-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "glyph-util.h"
-#include "home-util.h"
#include "homework.h"
#include "homework-mount.h"
#include "log.h"
-#include "missing_syscall.h"
#include "mkdir.h"
#include "mount-util.h"
#include "namespace-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <stdbool.h>
-#include <sys/types.h>
+#include "homework-forward.h"
int home_mount_node(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options);
int home_unshare_and_mkdir(void);
#include "keyring-util.h"
#include "log.h"
#include "missing_syscall.h"
+#include "string-util.h"
#include "user-record.h"
void password_cache_free(PasswordCache *cache) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
+#include "homework-forward.h"
#include "strv.h"
-#include "user-record.h"
typedef struct PasswordCache {
/* The volume key from the kernel keyring */
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#if HAVE_P11KIT
+
#include "alloc-util.h"
#include "hexdecoct.h"
#include "homework-pkcs11.h"
#include "log.h"
#include "pkcs11-util.h"
#include "strv.h"
+#include "user-record.h"
+
+void pkcs11_callback_data_release(struct pkcs11_callback_data *data) {
+ erase_and_free(data->decrypted_password);
+}
int pkcs11_callback(
CK_FUNCTION_LIST *m,
return 1;
}
+
+#endif
#pragma once
#if HAVE_P11KIT
-#include "memory-util.h"
+#include "homework-forward.h"
#include "pkcs11-util.h"
-#include "user-record.h"
struct pkcs11_callback_data {
UserRecord *user_record;
char *decrypted_password;
};
-static inline void pkcs11_callback_data_release(struct pkcs11_callback_data *data) {
- erase_and_free(data->decrypted_password);
-}
+void pkcs11_callback_data_release(struct pkcs11_callback_data *data);
int pkcs11_callback(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slot_id, const CK_SLOT_INFO *slot_info, const CK_TOKEN_INFO *token_info, P11KitUri *uri, void *userdata);
#endif
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/quota.h>
-#include "blockdev-util.h"
#include "btrfs-util.h"
#include "errno-util.h"
#include "fd-util.h"
#include "format-util.h"
#include "homework-quota.h"
#include "log.h"
+#include "memory-util.h"
#include "missing_magic.h"
#include "quota-util.h"
#include "stat-util.h"
+#include "user-record.h"
#include "user-util.h"
int home_update_quota_btrfs(UserRecord *h, int fd, const char *path) {
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "user-record.h"
+#include "homework-forward.h"
int home_update_quota_btrfs(UserRecord *h, int fd, const char *path);
int home_update_quota_classic(UserRecord *h, int fd, const char *path);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <stddef.h>
+#include <stdlib.h>
#include <sys/mount.h>
#include "sd-daemon.h"
#include "bus-unit-util.h"
#include "chown-recursive.h"
#include "copy.h"
+#include "cryptsetup-util.h"
#include "env-util.h"
+#include "errno-util.h"
#include "fd-util.h"
#include "fileio.h"
#include "filesystems.h"
#include "format-util.h"
-#include "fs-util.h"
+#include "hashmap.h"
#include "home-util.h"
+#include "homework-fido2.h"
+#include "homework-password-cache.h"
+#include "homework-pkcs11.h"
#include "homework.h"
#include "homework-blob.h"
#include "homework-cifs.h"
#include "homework-directory.h"
-#include "homework-fido2.h"
#include "homework-fscrypt.h"
#include "homework-luks.h"
#include "homework-mount.h"
-#include "homework-pkcs11.h"
#include "json-util.h"
#include "libcrypt-util.h"
+#include "loop-util.h"
#include "main-func.h"
#include "memory-util.h"
#include "missing_magic.h"
+#include "missing_syscall.h"
#include "mount-util.h"
-#include "parse-util.h"
#include "path-util.h"
#include "recovery-key.h"
#include "rm-rf.h"
#include "stat-util.h"
+#include "string-util.h"
#include "strv.h"
#include "sync-util.h"
+#include "time-util.h"
#include "tmpfile-util.h"
+#include "user-record.h"
+#include "user-record-util.h"
#include "user-util.h"
#include "virt.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <sys/vfs.h>
+#include <linux/fscrypt.h>
#include "sd-id128.h"
-#include "cryptsetup-util.h"
-#include "homework-password-cache.h"
-#include "loop-util.h"
-#include "missing_fs.h"
+#include "homework-forward.h"
#include "missing_keyctl.h"
-#include "missing_syscall.h"
-#include "user-record.h"
#include "user-record-util.h"
typedef struct HomeSetup {
)
systemd_homework_sources = files(
+ 'homework.c',
'homework-blob.c',
'homework-cifs.c',
'homework-directory.c',
+ 'homework-fido2.c',
'homework-fscrypt.c',
'homework-luks.c',
'homework-mount.c',
'homework-password-cache.c',
+ 'homework-pkcs11.c',
'homework-quota.c',
- 'homework.c',
)
-if conf.get('HAVE_P11KIT') == 1
- systemd_homework_sources += files('homework-pkcs11.c')
-endif
-if conf.get('HAVE_LIBFIDO2') == 1
- systemd_homework_sources += files('homework-fido2.c')
-endif
-
homed_gperf_c = custom_target(
'homed-gperf.c',
input : 'homed-gperf.gperf',
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include <libintl.h>
#include <security/pam_ext.h>
#include <security/pam_misc.h>
#include <security/pam_modules.h>
#include "bus-common-errors.h"
#include "bus-locator.h"
#include "bus-util.h"
-#include "errno-util.h"
#include "fd-util.h"
#include "home-util.h"
#include "locale-util.h"
-#include "log.h"
-#include "memory-util.h"
#include "pam-util.h"
#include "parse-util.h"
#include "path-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "time-util.h"
#include "user-record.h"
#include "user-record-util.h"
#include "user-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "bus-locator.h"
#include "main-func.h"
#include "tests.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#include "sd-bus.h"
+
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "errno-util.h"
-#include "home-util.h"
#include "libcrypt-util.h"
#include "log.h"
#include "password-quality-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "user-record.h"
#include "user-record-password-quality.h"
-#include "user-record-util.h"
#if HAVE_PASSWDQC || HAVE_PWQUALITY
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "user-record.h"
+#include "forward.h"
int user_record_check_password_quality(UserRecord *hr, UserRecord *secret, sd_bus_error *error);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include <openssl/pem.h>
-
#include "alloc-util.h"
-#include "fd-util.h"
-#include "fileio.h"
#include "json-util.h"
#include "log.h"
-#include "memstream-util.h"
#include "openssl-util.h"
#include "user-record-sign.h"
+#include "user-record.h"
static int user_record_signable_json(UserRecord *ur, char **ret) {
_cleanup_(user_record_unrefp) UserRecord *reduced = NULL;
#include <openssl/evp.h>
-#include "user-record.h"
+#include "forward.h"
int user_record_sign(UserRecord *ur, EVP_PKEY *private_key, UserRecord **ret);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/xattr.h>
+#include <unistd.h>
+#include "sd-bus.h"
#include "sd-json.h"
#include "alloc-util.h"
#include "errno-util.h"
#include "fd-util.h"
+#include "group-record.h"
+#include "hashmap.h"
#include "home-util.h"
-#include "id128-util.h"
#include "json-util.h"
#include "libcrypt-util.h"
#include "log.h"
-#include "memory-util.h"
#include "mountpoint-util.h"
#include "path-util.h"
#include "recovery-key.h"
#include "sha256.h"
#include "stat-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "time-util.h"
+#include "user-record.h"
#include "user-record-util.h"
#include "user-util.h"
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include "sd-bus.h"
-
-#include "group-record.h"
-#include "user-record.h"
+#include "forward.h"
/* We intentionally use snake_case instead of the usual camelCase here to further
* reduce the chance of collision with a field any legitimate user record may ever