diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-10-26 17:16:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-10-28 08:17:46 +0200 |
commit | c00b2ddc6e5995421d75740d8d6ec0ae10d92ee9 (patch) | |
tree | ed9593e9b69d15319157bff17488041ed82eb053 | |
parent | a70e0ad764b5e797e40455c3bbeffacff58ae7df (diff) | |
download | systemd-c00b2ddc6e5995421d75740d8d6ec0ae10d92ee9.tar.gz |
homework: always pass HomeSetup param first, PasswordCache second
Some of our operations did it one way, most the other. Let's unify on
the order that is more popular.
-rw-r--r-- | src/home/homework-cifs.c | 2 | ||||
-rw-r--r-- | src/home/homework-directory.c | 6 | ||||
-rw-r--r-- | src/home/homework-directory.h | 2 | ||||
-rw-r--r-- | src/home/homework-fscrypt.c | 4 | ||||
-rw-r--r-- | src/home/homework-fscrypt.h | 2 | ||||
-rw-r--r-- | src/home/homework-luks.c | 8 | ||||
-rw-r--r-- | src/home/homework-luks.h | 4 | ||||
-rw-r--r-- | src/home/homework.c | 16 | ||||
-rw-r--r-- | src/home/homework.h | 2 |
9 files changed, 23 insertions, 23 deletions
diff --git a/src/home/homework-cifs.c b/src/home/homework-cifs.c index 6a4431c229..c76d6a6b13 100644 --- a/src/home/homework-cifs.c +++ b/src/home/homework-cifs.c @@ -159,7 +159,7 @@ int home_activate_cifs( assert_se(hdo = user_record_home_directory(h)); hd = strdupa_safe(hdo); /* copy the string out, since it might change later in the home record object */ - r = home_setup(h, 0, cache, setup, &header_home); + r = home_setup(h, 0, setup, cache, &header_home); if (r < 0) return r; diff --git a/src/home/homework-directory.c b/src/home/homework-directory.c index 3418034bd1..af13fa026a 100644 --- a/src/home/homework-directory.c +++ b/src/home/homework-directory.c @@ -74,7 +74,7 @@ int home_activate_directory( assert_se(hdo = user_record_home_directory(h)); hd = strdupa_safe(hdo); - r = home_setup(h, 0, cache, setup, &header_home); + r = home_setup(h, 0, setup, cache, &header_home); if (r < 0) return r; @@ -259,8 +259,8 @@ int home_create_directory_or_subvolume(UserRecord *h, HomeSetup *setup, UserReco int home_resize_directory( UserRecord *h, HomeSetupFlags flags, - PasswordCache *cache, HomeSetup *setup, + PasswordCache *cache, UserRecord **ret_home) { _cleanup_(user_record_unrefp) UserRecord *embedded_home = NULL, *new_home = NULL; @@ -271,7 +271,7 @@ int home_resize_directory( assert(ret_home); assert(IN_SET(user_record_storage(h), USER_DIRECTORY, USER_SUBVOLUME, USER_FSCRYPT)); - r = home_setup(h, flags, cache, setup, NULL); + r = home_setup(h, flags, setup, cache, NULL); if (r < 0) return r; diff --git a/src/home/homework-directory.h b/src/home/homework-directory.h index 92cc755546..ecbb2f143c 100644 --- a/src/home/homework-directory.h +++ b/src/home/homework-directory.h @@ -7,4 +7,4 @@ int home_setup_directory(UserRecord *h, HomeSetup *setup); int home_activate_directory(UserRecord *h, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); int home_create_directory_or_subvolume(UserRecord *h, HomeSetup *setup, UserRecord **ret_home); -int home_resize_directory(UserRecord *h, HomeSetupFlags flags, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_home); +int home_resize_directory(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); diff --git a/src/home/homework-fscrypt.c b/src/home/homework-fscrypt.c index 057bf0d45e..f9fef73f75 100644 --- a/src/home/homework-fscrypt.c +++ b/src/home/homework-fscrypt.c @@ -282,8 +282,8 @@ static int fscrypt_setup( int home_setup_fscrypt( UserRecord *h, - const PasswordCache *cache, - HomeSetup *setup) { + HomeSetup *setup, + const PasswordCache *cache) { _cleanup_(erase_and_freep) void *volume_key = NULL; struct fscrypt_policy policy = {}; diff --git a/src/home/homework-fscrypt.h b/src/home/homework-fscrypt.h index e9262c6349..7c2d7aace4 100644 --- a/src/home/homework-fscrypt.h +++ b/src/home/homework-fscrypt.h @@ -4,7 +4,7 @@ #include "homework.h" #include "user-record.h" -int home_setup_fscrypt(UserRecord *h, const PasswordCache *cache, HomeSetup *setup); +int home_setup_fscrypt(UserRecord *h, HomeSetup *setup, const PasswordCache *cache); int home_create_fscrypt(UserRecord *h, HomeSetup *setup, char **effective_passwords, UserRecord **ret_home); diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 56e232523d..cd584b0f45 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -1168,8 +1168,8 @@ int home_setup_luks( UserRecord *h, HomeSetupFlags flags, const char *force_image_path, - PasswordCache *cache, HomeSetup *setup, + PasswordCache *cache, UserRecord **ret_luks_home) { sd_id128_t found_partition_uuid, found_luks_uuid, found_fs_uuid; @@ -1446,8 +1446,8 @@ int home_activate_luks( h, 0, NULL, - cache, setup, + cache, &luks_home_record); if (r < 0) return r; @@ -2735,8 +2735,8 @@ static int apply_resize_partition(int fd, sd_id128_t disk_uuids, struct fdisk_ta int home_resize_luks( UserRecord *h, HomeSetupFlags flags, - PasswordCache *cache, HomeSetup *setup, + PasswordCache *cache, UserRecord **ret_home) { uint64_t old_image_size, new_image_size, old_fs_size, new_fs_size, crypto_offset, new_partition_size; @@ -2835,7 +2835,7 @@ int home_resize_luks( new_image_size = new_image_size_rounded; } - r = home_setup_luks(h, flags, whole_disk, cache, setup, &header_home); + r = home_setup_luks(h, flags, whole_disk, setup, cache, &header_home); if (r < 0) return r; diff --git a/src/home/homework-luks.h b/src/home/homework-luks.h index 25d096a175..f8af66e083 100644 --- a/src/home/homework-luks.h +++ b/src/home/homework-luks.h @@ -5,7 +5,7 @@ #include "homework.h" #include "user-record.h" -int home_setup_luks(UserRecord *h, HomeSetupFlags flags, const char *force_image_path, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_luks_home); +int home_setup_luks(UserRecord *h, HomeSetupFlags flags, const char *force_image_path, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_luks_home); int home_activate_luks(UserRecord *h, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); int home_deactivate_luks(UserRecord *h, HomeSetup *setup); @@ -17,7 +17,7 @@ int home_create_luks(UserRecord *h, HomeSetup *setup, const PasswordCache *cache int home_get_state_luks(UserRecord *h, HomeSetup *setup); -int home_resize_luks(UserRecord *h, HomeSetupFlags flags, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_home); +int home_resize_luks(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_home); int home_passwd_luks(UserRecord *h, HomeSetup *setup, const PasswordCache *cache, char **effective_passwords); diff --git a/src/home/homework.c b/src/home/homework.c index 8634a93230..22a960efd5 100644 --- a/src/home/homework.c +++ b/src/home/homework.c @@ -407,8 +407,8 @@ int home_setup_done(HomeSetup *setup) { int home_setup( UserRecord *h, HomeSetupFlags flags, - PasswordCache *cache, HomeSetup *setup, + PasswordCache *cache, UserRecord **ret_header_home) { int r; @@ -429,7 +429,7 @@ int home_setup( switch (user_record_storage(h)) { case USER_LUKS: - return home_setup_luks(h, flags, NULL, cache, setup, ret_header_home); + return home_setup_luks(h, flags, NULL, setup, cache, ret_header_home); case USER_SUBVOLUME: case USER_DIRECTORY: @@ -437,7 +437,7 @@ int home_setup( break; case USER_FSCRYPT: - r = home_setup_fscrypt(h, cache, setup); + r = home_setup_fscrypt(h, setup, cache); break; case USER_CIFS: @@ -1521,7 +1521,7 @@ static int home_update(UserRecord *h, UserRecord **ret) { if (r < 0) return r; - r = home_setup(h, flags, &cache, &setup, &header_home); + r = home_setup(h, flags, &setup, &cache, &header_home); if (r < 0) return r; @@ -1579,12 +1579,12 @@ static int home_resize(UserRecord *h, UserRecord **ret) { switch (user_record_storage(h)) { case USER_LUKS: - return home_resize_luks(h, flags, &cache, &setup, ret); + return home_resize_luks(h, flags, &setup, &cache, ret); case USER_DIRECTORY: case USER_SUBVOLUME: case USER_FSCRYPT: - return home_resize_directory(h, flags, &cache, &setup, ret); + return home_resize_directory(h, flags, &setup, &cache, ret); default: return log_error_errno(SYNTHETIC_ERRNO(ENOTTY), "Resizing home directories of type '%s' currently not supported.", user_storage_to_string(user_record_storage(h))); @@ -1613,7 +1613,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) { if (r < 0) return r; - r = home_setup(h, flags, &cache, &setup, &header_home); + r = home_setup(h, flags, &setup, &cache, &header_home); if (r < 0) return r; @@ -1683,7 +1683,7 @@ static int home_inspect(UserRecord *h, UserRecord **ret_home) { if (r < 0) return r; - r = home_setup(h, flags, &cache, &setup, &header_home); + r = home_setup(h, flags, &setup, &cache, &header_home); if (r < 0) return r; diff --git a/src/home/homework.h b/src/home/homework.h index fe8cbb4635..076033526c 100644 --- a/src/home/homework.h +++ b/src/home/homework.h @@ -78,7 +78,7 @@ int home_setup_done(HomeSetup *setup); int home_setup_undo_mount(HomeSetup *setup, int level); int home_setup_undo_dm(HomeSetup *setup, int level); -int home_setup(UserRecord *h, HomeSetupFlags flags, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_header_home); +int home_setup(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup, PasswordCache *cache, UserRecord **ret_header_home); int home_refresh(UserRecord *h, HomeSetup *setup, UserRecord *header_home, PasswordCache *cache, struct statfs *ret_statfs, UserRecord **ret_new_home); |