]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: rename home_prepare*() → home_setup*()
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Oct 2021 20:24:24 +0000 (22:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 16 Oct 2021 12:47:57 +0000 (14:47 +0200)
These set of functions are constructors for an object called HomeSetup,
which has a destructor home_setup_undo(), hence to be reasonably
symmetric, let's call it home_setup*() too, instead of using a new verb
"prepare" for its name.

No actual code changes, just some renaming.

src/home/homework-cifs.c
src/home/homework-cifs.h
src/home/homework-directory.c
src/home/homework-directory.h
src/home/homework-fscrypt.c
src/home/homework-fscrypt.h
src/home/homework-luks.c
src/home/homework-luks.h
src/home/homework.c
src/home/homework.h

index f1dfde50d098c77d423c9937c03260c8fe2eacb9..3ae478462c71b23e05b403684064bc88073121a1 100644 (file)
@@ -12,7 +12,7 @@
 #include "strv.h"
 #include "tmpfile-util.h"
 
-int home_prepare_cifs(
+int home_setup_cifs(
                 UserRecord *h,
                 bool already_activated,
                 HomeSetup *setup) {
@@ -117,7 +117,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_prepare_cifs(h, false, &setup);
+        r = home_setup_cifs(h, false, &setup);
         if (r < 0)
                 return r;
 
@@ -160,7 +160,7 @@ int home_create_cifs(UserRecord *h, UserRecord **ret_home) {
                 return log_error_errno(errno, "Unable to detect whether /sbin/mount.cifs exists: %m");
         }
 
-        r = home_prepare_cifs(h, false, &setup);
+        r = home_setup_cifs(h, false, &setup);
         if (r < 0)
                 return r;
 
index da2e50a795a30dff063350ba8d571f08a11aafb4..6bba2c951a9937c82ee67055c37b38b3f44a03bc 100644 (file)
@@ -4,7 +4,7 @@
 #include "homework.h"
 #include "user-record.h"
 
-int home_prepare_cifs(UserRecord *h, bool already_activated, HomeSetup *setup);
+int home_setup_cifs(UserRecord *h, bool already_activated, HomeSetup *setup);
 
 int home_activate_cifs(UserRecord *h, PasswordCache *cache, UserRecord **ret_home);
 
index ed043491ad382b2b76c26874c9f89c2b9b581289..5865f325ff382f4246c74c1ee9ff0a54f1a24c90 100644 (file)
@@ -13,7 +13,7 @@
 #include "tmpfile-util.h"
 #include "umask-util.h"
 
-int home_prepare_directory(UserRecord *h, bool already_activated, HomeSetup *setup) {
+int home_setup_directory(UserRecord *h, bool already_activated, HomeSetup *setup) {
         assert(h);
         assert(setup);
 
@@ -44,7 +44,7 @@ int home_activate_directory(
         assert_se(hdo = user_record_home_directory(h));
         hd = strdupa_safe(hdo);
 
-        r = home_prepare(h, false, cache, &setup, &header_home);
+        r = home_setup(h, false, cache, &setup, &header_home);
         if (r < 0)
                 return r;
 
@@ -205,7 +205,7 @@ int home_resize_directory(
         assert(ret_home);
         assert(IN_SET(user_record_storage(h), USER_DIRECTORY, USER_SUBVOLUME, USER_FSCRYPT));
 
-        r = home_prepare(h, already_activated, cache, setup, NULL);
+        r = home_setup(h, already_activated, cache, setup, NULL);
         if (r < 0)
                 return r;
 
index 27d640f380398e2a8599497e51b87c9105005fac..9f7e1470e275a07356a6b2d2360b55f493165a3e 100644 (file)
@@ -4,7 +4,7 @@
 #include "homework.h"
 #include "user-record.h"
 
-int home_prepare_directory(UserRecord *h, bool already_activated, HomeSetup *setup);
+int home_setup_directory(UserRecord *h, bool already_activated, HomeSetup *setup);
 int home_activate_directory(UserRecord *h, PasswordCache *cache, UserRecord **ret_home);
 int home_create_directory_or_subvolume(UserRecord *h, UserRecord **ret_home);
 int home_resize_directory(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_home);
index 86dde4b78b0b730765a7b97fb6a27c3184d8aa01..002b0b49b7ba383ba50869db5e7ec24fba9214a6 100644 (file)
@@ -278,7 +278,7 @@ static int fscrypt_setup(
         return log_error_errno(SYNTHETIC_ERRNO(ENOKEY), "Failed to set up home directory with provided passwords.");
 }
 
-int home_prepare_fscrypt(
+int home_setup_fscrypt(
                 UserRecord *h,
                 bool already_activated,
                 PasswordCache *cache,
index 50b03993e03d0c75f4cc0fc1d68123578b2201d0..becf4650a43d66f2747cb9f29f4217b885e57053 100644 (file)
@@ -4,7 +4,7 @@
 #include "homework.h"
 #include "user-record.h"
 
-int home_prepare_fscrypt(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup);
+int home_setup_fscrypt(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup);
 int home_create_fscrypt(UserRecord *h, char **effective_passwords, UserRecord **ret_home);
 
 int home_passwd_fscrypt(UserRecord *h, HomeSetup *setup, PasswordCache *cache, char **effective_passwords);
index 90a49559f182f995aa16c2726a4210b7ac10aba4..afee37490e536d77553c07a4f716bcc8b386da76 100644 (file)
@@ -1098,7 +1098,7 @@ static int lock_image_fd(int image_fd, const char *ip) {
         return 0;
 }
 
-int home_prepare_luks(
+int home_setup_luks(
                 UserRecord *h,
                 bool already_activated,
                 const char *force_image_path,
@@ -1385,7 +1385,7 @@ int home_activate_luks(
         if (r > 0)
                 return log_error_errno(SYNTHETIC_ERRNO(EEXIST), "Device mapper device %s already exists, refusing.", setup.dm_node);
 
-        r = home_prepare_luks(
+        r = home_setup_luks(
                         h,
                         false,
                         NULL,
@@ -2797,7 +2797,7 @@ int home_resize_luks(
                 new_image_size = new_image_size_rounded;
         }
 
-        r = home_prepare_luks(h, already_activated, whole_disk, cache, setup, &header_home);
+        r = home_setup_luks(h, already_activated, whole_disk, cache, setup, &header_home);
         if (r < 0)
                 return r;
 
index eac8f0761beba0e575b3a8e9c87e5db53f297a8f..770aa552e0a1e9230ed53424fe2656e091832c7c 100644 (file)
@@ -5,7 +5,7 @@
 #include "homework.h"
 #include "user-record.h"
 
-int home_prepare_luks(UserRecord *h, bool already_activated, const char *force_image_path, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_luks_home);
+int home_setup_luks(UserRecord *h, bool already_activated, const char *force_image_path, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_luks_home);
 
 int home_activate_luks(UserRecord *h, PasswordCache *cache, UserRecord **ret_home);
 int home_deactivate_luks(UserRecord *h);
index 48ff77213b44a41a6013dd62470de5ae5069d17b..394b5c58baf1cd4e74eae93f5f16589c31ed6149 100644 (file)
@@ -368,7 +368,7 @@ int home_setup_undo(HomeSetup *setup) {
         return r;
 }
 
-int home_prepare(
+int home_setup(
                 UserRecord *h,
                 bool already_activated,
                 PasswordCache *cache,
@@ -393,19 +393,19 @@ int home_prepare(
         switch (user_record_storage(h)) {
 
         case USER_LUKS:
-                return home_prepare_luks(h, already_activated, NULL, cache, setup, ret_header_home);
+                return home_setup_luks(h, already_activated, NULL, cache, setup, ret_header_home);
 
         case USER_SUBVOLUME:
         case USER_DIRECTORY:
-                r = home_prepare_directory(h, already_activated, setup);
+                r = home_setup_directory(h, already_activated, setup);
                 break;
 
         case USER_FSCRYPT:
-                r = home_prepare_fscrypt(h, already_activated, cache, setup);
+                r = home_setup_fscrypt(h, already_activated, cache, setup);
                 break;
 
         case USER_CIFS:
-                r = home_prepare_cifs(h, already_activated, setup);
+                r = home_setup_cifs(h, already_activated, setup);
                 break;
 
         default:
@@ -1445,7 +1445,7 @@ static int home_update(UserRecord *h, UserRecord **ret) {
 
         already_activated = r > 0;
 
-        r = home_prepare(h, already_activated, &cache, &setup, &header_home);
+        r = home_setup(h, already_activated, &cache, &setup, &header_home);
         if (r < 0)
                 return r;
 
@@ -1541,7 +1541,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) {
 
         already_activated = r > 0;
 
-        r = home_prepare(h, already_activated, &cache, &setup, &header_home);
+        r = home_setup(h, already_activated, &cache, &setup, &header_home);
         if (r < 0)
                 return r;
 
@@ -1613,7 +1613,7 @@ static int home_inspect(UserRecord *h, UserRecord **ret_home) {
 
         already_activated = r > 0;
 
-        r = home_prepare(h, already_activated, &cache, &setup, &header_home);
+        r = home_setup(h, already_activated, &cache, &setup, &header_home);
         if (r < 0)
                 return r;
 
index f20a23a918788ee9139059aaff954b1423ec2ca6..b16f4a9086c9187e4b70850f8b276493a71d23d8 100644 (file)
@@ -56,7 +56,7 @@ void password_cache_free(PasswordCache *cache);
 
 int home_setup_undo(HomeSetup *setup);
 
-int home_prepare(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_header_home);
+int home_setup(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_header_home);
 
 int home_refresh(UserRecord *h, HomeSetup *setup, UserRecord *header_home, PasswordCache *cache, struct statfs *ret_statfs, UserRecord **ret_new_home);