]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
home: Clean up includes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 11:49:13 +0000 (13:49 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 May 2025 14:46:47 +0000 (23:46 +0900)
Split out of #37344.

60 files changed:
src/home/home-util.c
src/home/home-util.h
src/home/homectl-fido2.c
src/home/homectl-fido2.h
src/home/homectl-pkcs11.c
src/home/homectl-pkcs11.h
src/home/homectl-recovery-key.c
src/home/homectl-recovery-key.h
src/home/homectl.c
src/home/homed-bus.c
src/home/homed-bus.h
src/home/homed-conf.c
src/home/homed-conf.h
src/home/homed-forward.h [new file with mode: 0644]
src/home/homed-gperf.gperf
src/home/homed-home-bus.c
src/home/homed-home-bus.h
src/home/homed-home.c
src/home/homed-home.h
src/home/homed-manager-bus.c
src/home/homed-manager-bus.h
src/home/homed-manager.c
src/home/homed-manager.h
src/home/homed-operation.c
src/home/homed-operation.h
src/home/homed-varlink.c
src/home/homed-varlink.h
src/home/homed.c
src/home/homework-blob.c
src/home/homework-blob.h
src/home/homework-cifs.c
src/home/homework-cifs.h
src/home/homework-directory.c
src/home/homework-directory.h
src/home/homework-fido2.c
src/home/homework-fido2.h
src/home/homework-forward.h [new file with mode: 0644]
src/home/homework-fscrypt.c
src/home/homework-fscrypt.h
src/home/homework-luks.c
src/home/homework-luks.h
src/home/homework-mount.c
src/home/homework-mount.h
src/home/homework-password-cache.c
src/home/homework-password-cache.h
src/home/homework-pkcs11.c
src/home/homework-pkcs11.h
src/home/homework-quota.c
src/home/homework-quota.h
src/home/homework.c
src/home/homework.h
src/home/meson.build
src/home/pam_systemd_home.c
src/home/test-homed-regression-31896.c
src/home/user-record-password-quality.c
src/home/user-record-password-quality.h
src/home/user-record-sign.c
src/home/user-record-sign.h
src/home/user-record-util.c
src/home/user-record-util.h

index b695c5a49dd876674411bfb2e566a9a322422f74..1e9d120a18beecf9dbe67b7fcac6596adc1b866b 100644 (file)
@@ -2,17 +2,22 @@
 
 #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) {
index f8472cb7c86c4cbdd5541eefb3a2142bdcc7f977..425ad7be631f2f7caf1869d1e05022139be27eeb 100644 (file)
@@ -1,13 +1,7 @@
 /* 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)
@@ -25,9 +19,6 @@
  * 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);
index 1b89e5889062ac71899883ef41d60904216f7583..2c44d00324e948eb568196c50fc63080cea5eec3 100644 (file)
@@ -1,14 +1,8 @@
 /* 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"
 
index 2ced71c97aa3887399158865c03efd439f6c4c27..840dd79d1972bdc4a67a7fef92b6bc82af6e449b 100644 (file)
@@ -1,8 +1,6 @@
 /* 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);
index c80cfc5216102f424edadb0df286abf756d2a0d2..12037a667dee8aa57c45532904d92e1616273d38 100644 (file)
@@ -1,14 +1,15 @@
 /* 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) {
@@ -145,7 +146,10 @@ static int add_pkcs11_encrypted_key(
         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;
@@ -191,6 +195,7 @@ int identity_add_pkcs11_key_data(sd_json_variant **v, const char *uri) {
                 return r;
 
         return 0;
-}
-
+#else
+        return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "PKCS#11 tokens not supported on this build.");
 #endif
+}
index ffe0bd90fbcaaf114c337a341b9dfdb580143d67..cee12b49eda262854a8239a0e31ba8600babbb00 100644 (file)
@@ -1,19 +1,10 @@
 /* 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);
index bb4a01f8959885bae74cde623a19dc6b7790e669..ad1850d056469757cb381648bd4e23d918352e06 100644 (file)
@@ -9,10 +9,8 @@
 #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;
index 387ae64df5ffec904e94a8eb911cb50a9b9af7a4..5a48f5fec10c4e7ee91e0885573cc5ddc19df6e1 100644 (file)
@@ -1,6 +1,6 @@
 /* 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);
index 8c22066652816ab74db1ad1b0b6004bc2b25f57b..ea5e27bfa95c234a1c963fbfa310de12447d8f14 100644 (file)
 #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"
@@ -34,7 +35,6 @@
 #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"
index 5ea50ca66c1e43be8d8a8c9594c544f2a28eb94a..2491a887fec5f242d2e7511faaf202942536db21 100644 (file)
@@ -1,11 +1,15 @@
 /* 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;
index c7e11efdfb0b0ed4e7baf220c7383ab2d6eea2b8..4adb60e8a26a62076c54981911eb3920b4522c7a 100644 (file)
@@ -1,11 +1,7 @@
 /* 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);
index 87b3e8cd845550ba804f307ea7ca3344438de846..b1e71b7dbc638b756119204f8621b2b7da38e6a2 100644 (file)
@@ -1,9 +1,10 @@
 /* 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) {
 
index 1defaa998b6b93e4675d9cfba9814ef6c327c3be..093dfeff76fe4d33246fcffe6494fce20b38b70e 100644 (file)
@@ -1,8 +1,7 @@
 /* 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);
 
diff --git a/src/home/homed-forward.h b/src/home/homed-forward.h
new file mode 100644 (file)
index 0000000..3672b16
--- /dev/null
@@ -0,0 +1,9 @@
+/* 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;
index d5b798a411cf5ff50c2e0ccd4a537dc75650a7ff..b96a4f167ae1f7066be4561eae4261fe0d2d23b6 100644 (file)
@@ -7,6 +7,7 @@ _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
 #include <stddef.h>
 #include "conf-parser.h"
 #include "homed-conf.h"
+#include "homed-manager.h"
 %}
 struct ConfigPerfItem;
 %null_strings
index 732f6d5e9a9683eb6ce4a27b015433b541037d4e..bec95aea6d35bec94ef079bdfd631a8b750a8e76 100644 (file)
@@ -1,18 +1,23 @@
 /* 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"
index 8d4ddf909f3e5df7c180fd2d9305fdae9ecd40ec..da784daa9a3a06de365e894f516454d9a1c7fbd5 100644 (file)
@@ -1,10 +1,7 @@
 /* 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);
 
index 58a8ffff8334d1ca9d259c01897707a84a3fae22..2d292163d0974b791eec0f958ec889ba63c5941e 100644 (file)
@@ -4,6 +4,8 @@
 #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"
index 7d29e554a333b6bcd14066bb576c509f1feea861..8fcdca32ce4a8c72f7dc3de87c90a1c734896d69 100644 (file)
@@ -1,15 +1,10 @@
 /* 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 */
index 2280cb7768866c62b6f33a4c710e8c295464bcd1..77b8ed92ee1bbea71042de981ded2dcad366f208 100644 (file)
@@ -1,21 +1,30 @@
 /* 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"
index 56aca18b7d79f94ced5bbfcf7a4c709c3e18ded8..4ba561ea347ca3fdbcd76f8cc5424a0dc6f2c277 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "bus-object.h"
+#include "homed-forward.h"
 
 extern const BusObjectImplementation manager_object;
index 5575662ca6295fbbfe2fe2a99ce6299440ff61b0..511bc81707eabad34141baa70610c5a8c8a092e6 100644 (file)
@@ -1,54 +1,62 @@
 /* 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"
index f8490a563999c98ca7bac9a6b9b8082d82951c9f..fe1041e01e5fc267018c5bddaf7db48aa842801a 100644 (file)
@@ -3,13 +3,8 @@
 
 #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 {
index ba6e602828c1d1b052e0da8ff6264e2a27ffaf26..c40d8025e3afc92365e2e36c840ec987a51ac3ad 100644 (file)
@@ -1,9 +1,12 @@
 /* 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;
index e190e8e9704f723f6ea57a3b1e52e5a200a8113f..9bb7aba59a2734be22b50e11aa729a5786babade 100644 (file)
@@ -1,9 +1,9 @@
 /* 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() */
index e3a748e2512b27581a9e009de542de8dbb035335..92e5992258779bf26ccde08015f27cdac0167790 100644 (file)
@@ -1,10 +1,15 @@
 /* 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"
index 9bfea3a448bd77703718adcd49f830a5e199459a..90c2f55256c12daee2d5de23468320233986632b 100644 (file)
@@ -1,7 +1,7 @@
 /* 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);
index 652e32ec7c10aea94250cd071c24d45310e04ffa..bb319925d036cb8f019327ce16cd7ce50801bdf2 100644 (file)
@@ -1,9 +1,11 @@
 /* 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"
index b9c71b56e730258a63680b5824851302d5157281..6cd38fca5e5a8c696397d1338f57c9cd92322a23 100644 (file)
@@ -1,24 +1,25 @@
 /* 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,
index fbe6c82cd4f9a89d341e9adddf70b328f3cb2b6c..4d345d10b756842934986f55f698bd42b230e488 100644 (file)
@@ -2,7 +2,7 @@
 
 #pragma once
 
-#include "user-record.h"
+#include "homework-forward.h"
 
 int home_reconcile_blob_dirs(UserRecord *h, int root_fd, int reconciled);
 
index 6c18472d581cb3d5029899843428ac61dd5533c5..d04f65a3f82a550a1d209270e55db154fa2c766b 100644 (file)
@@ -2,20 +2,24 @@
 
 #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,
index af8c466629ac79c7390c1cdda67072ab1d6c348a..9945335b3b25ef4a57c48b781b3d097b4945a0ed 100644 (file)
@@ -1,8 +1,7 @@
 /* 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);
 
index e471a4a92afb70fb3228a26235e06b994e252b58..65ead3ffd3796672b7be35d21cdf329d31382337 100644 (file)
@@ -3,6 +3,7 @@
 #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) {
index fe03e5deb19cd3ea94212d0ed934e39048625d0c..fe51748e45cc4ec21809f23f8ed83345730eb35c 100644 (file)
@@ -1,8 +1,7 @@
 /* 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);
index 483487aecc6c7daa52023222ed095a6665fb633b..bbd38c58b1df0b0b670666a3f90b4f9755ec0e7a 100644 (file)
@@ -1,13 +1,12 @@
 /* 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,
@@ -15,6 +14,7 @@ int fido2_use_token(
                 const Fido2HmacSalt *salt,
                 char **ret) {
 
+#if HAVE_LIBFIDO2
         _cleanup_(erase_and_freep) void *hmac = NULL;
         size_t hmac_size;
         Fido2EnrollFlags flags = 0;
@@ -72,4 +72,7 @@ int fido2_use_token(
                 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
 }
index a1dcba2d86c3d29431ecd3b4cf60b11c51fa723e..d4355700a14f94ec15f3247e9bc2b6a9d641aa06 100644 (file)
@@ -1,6 +1,6 @@
 /* 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);
diff --git a/src/home/homework-forward.h b/src/home/homework-forward.h
new file mode 100644 (file)
index 0000000..21871d4
--- /dev/null
@@ -0,0 +1,9 @@
+/* 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;
index 663138988a90f500c10040daaa124229b119b85e..9debaf943aff03322581997903382c531fdccfbf 100644 (file)
@@ -1,20 +1,26 @@
 /* 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"
 
index 289e9d86fb1eb75544d315faa9b563c9526a97d1..fb93242e1a84efe460d630586017b09e926471fe 100644 (file)
@@ -1,8 +1,7 @@
 /* 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);
 
index 75632f5d474e6980331d23b062c5d8ff062e1ac3..dc510eb1f5f046b7aa8026e875e09966e60113b7 100644 (file)
@@ -5,7 +5,6 @@
 #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
@@ -3913,3 +3921,17 @@ int home_auto_shrink_luks(UserRecord *h, HomeSetup *setup, PasswordCache *cache)
 
         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;
+}
index 0218de8ccdbc164b24d6568ba2ef3af52232e932..b9c5054a1340158b9994309bf228b31e9ff3e5fb 100644 (file)
@@ -1,9 +1,7 @@
 /* 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);
 
@@ -26,19 +24,7 @@ int home_unlock_luks(UserRecord *h, HomeSetup *setup, const PasswordCache *cache
 
 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);
index 356f5fb8b6155b4c3fd73ba39242c48017cd2586..2b340ce54cb84979d0043186f4cd7b27a5d6456b 100644 (file)
@@ -1,17 +1,17 @@
 /* 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"
index 615b7d36e7a4d7fb50d5565285bf1d14bacc2b3a..8f5244717d0aa81bbe2788e31bc37d5a9616667a 100644 (file)
@@ -1,8 +1,7 @@
 /* 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);
index 5ffe717e2eb891f619711d70732874f72b68777c..cd497b46e7b0029782171806b3d270d0d22c4b3b 100644 (file)
@@ -5,6 +5,7 @@
 #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) {
index e2d86eb9393f03776e3ad8fc767b32ac3f0d6e77..a4b156a2e4857f3b73dc13fb13a8263aeb644028 100644 (file)
@@ -1,8 +1,8 @@
 /* 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 */
index 42e4976bfb730cb8a3baf39a16f7363e28813f12..626473d2c9111a2d08cf7e93b7636f9b361610fe 100644 (file)
@@ -1,11 +1,18 @@
 /* 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,
@@ -102,3 +109,5 @@ decrypt:
 
         return 1;
 }
+
+#endif
index fd1d0b7714f9ecd27e1facc204e93bb6991ced9d..197e789c27b7602257c522b15fc58ec128d2c8de 100644 (file)
@@ -2,9 +2,8 @@
 #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;
@@ -13,9 +12,7 @@ struct pkcs11_callback_data {
         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
index e2b43afbeacce1f47fa416cd1a46a21a704dbff2..5d256c5dcdd44d16ac249661d135f47cb94774c3 100644 (file)
@@ -1,16 +1,17 @@
 /* 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) {
index a03510c75e26a668794e67632321120dbec9d743..9e6b85ffd60342d667d41c267e723751f309bb8a 100644 (file)
@@ -1,7 +1,7 @@
 /* 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);
index 8af0847c78f03821034c1aba288b416d7d906c57..d26d4529e555837431c2bff379bf963f1b66c528 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stddef.h>
+#include <stdlib.h>
 #include <sys/mount.h>
 
 #include "sd-daemon.h"
@@ -9,36 +9,44 @@
 #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"
 
index 138483bbc64ebbd1b48e110364ebbf942f00cacf..abd1c482da80bd022299efdc7b0292776deaa621 100644 (file)
@@ -1,17 +1,12 @@
 /* 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 {
index c549adf79d7596a3284f5936daaf0c30d44efc4f..94c26ef08821d81f9fa1efc978073b071ba1c870 100644 (file)
@@ -23,24 +23,19 @@ systemd_homed_extract_sources = files(
 )
 
 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',
index 3bf6ffbae84c430fe9b386978759451bac470ec1..78cd06b8e80ee6c80be95811aab7ec12847960e0 100644 (file)
@@ -1,5 +1,6 @@
 /* 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"
index 1530a2f22b9d0b5f149f39e15be84087223c2407..46c578da89412a215216b73eacb8be13dc6e136a 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "bus-locator.h"
 #include "main-func.h"
 #include "tests.h"
index 4e480b16d247651ac275ad16036db4742a1bf19d..844c42c52b2492460f5b625d6c44bdbd9fc3884c 100644 (file)
@@ -1,15 +1,17 @@
 /* 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
 
index 41473aabde4df23607742d5c039de5a26ba01f9d..b76092113cd665ac942485b05fe2bfb1afe67847 100644 (file)
@@ -1,8 +1,6 @@
 /* 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);
index 1f0bc88e4171059e8ec9591977ddefbc6ae27377..367ab38330a0faff3af4f3e3bf4aece631f755ea 100644 (file)
@@ -1,15 +1,11 @@
 /* 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;
index 87c6813e92825bc2baac1d4b34c8c8df6b26d0fe..350e7457660883533cb235d5f171e1937a968ff8 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <openssl/evp.h>
 
-#include "user-record.h"
+#include "forward.h"
 
 int user_record_sign(UserRecord *ur, EVP_PKEY *private_key, UserRecord **ret);
 
index 13c7675faf49cbb4e169b31a847436f2c1c4b569..fdc99e1c4f05f1ea28ca0bbe0348affbba5aa65a 100644 (file)
@@ -1,23 +1,29 @@
 /* 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"
 
index 4268396b905f21942934f023071fd2aae27ae878..31961184a8b1d4b7cff2b8ae50ddcab46d3c2876 100644 (file)
@@ -1,10 +1,7 @@
 /* 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