]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homework: Cleanup home_store_embedded_identity
authorAdrian Vovk <adrianvovk@gmail.com>
Tue, 9 Jan 2024 19:49:53 +0000 (14:49 -0500)
committerAdrian Vovk <adrianvovk@gmail.com>
Thu, 18 Jan 2024 22:54:45 +0000 (17:54 -0500)
This function took an extra argument that it never used. This commit
cleans that up

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

index 6870ae98916857d5bdd7d14eb9c5db5081190e4a..161d7199385fe7d2e1f142d081e2749f4e30f3d8 100644 (file)
@@ -290,7 +290,7 @@ int home_resize_directory(
         if (r < 0)
                 return r;
 
-        r = home_store_embedded_identity(new_home, setup->root_fd, h->uid, embedded_home);
+        r = home_store_embedded_identity(new_home, setup->root_fd, embedded_home);
         if (r < 0)
                 return r;
 
index 57016fb14b0ce171829d7dcb3fec3466ab8841b1..a66ebb6ca5e48b7a61b2ac32034e8f7facd8fa50 100644 (file)
@@ -3445,7 +3445,7 @@ int home_resize_luks(
                 /* → Shrink */
 
                 if (!FLAGS_SET(flags, HOME_SETUP_RESIZE_DONT_SYNC_IDENTITIES)) {
-                        r = home_store_embedded_identity(new_home, setup->root_fd, h->uid, embedded_home);
+                        r = home_store_embedded_identity(new_home, setup->root_fd, embedded_home);
                         if (r < 0)
                                 return r;
                 }
@@ -3533,7 +3533,7 @@ int home_resize_luks(
 
         } else { /* → Grow */
                 if (!FLAGS_SET(flags, HOME_SETUP_RESIZE_DONT_SYNC_IDENTITIES)) {
-                        r = home_store_embedded_identity(new_home, setup->root_fd, h->uid, embedded_home);
+                        r = home_store_embedded_identity(new_home, setup->root_fd, embedded_home);
                         if (r < 0)
                                 return r;
                 }
index 066483e342bfe00e4549116fe053e6ca5b4ebaa2..a003c783cfc6ed6f0bc51a38d482e44668b907f5 100644 (file)
@@ -638,7 +638,7 @@ int home_load_embedded_identity(
          *
          *      · The record we got passed from the host
          *      · The record included in the LUKS header (only if LUKS is used)
-         *      · The record in the home directory itself (~.identity)
+         *      · The record in the home directory itself (~/.identity)
          *
          *  Now we have to reconcile all three, and let the newest one win. */
 
@@ -698,13 +698,12 @@ int home_load_embedded_identity(
         return 0;
 }
 
-int home_store_embedded_identity(UserRecord *h, int root_fd, uid_t uid, UserRecord *old_home) {
+int home_store_embedded_identity(UserRecord *h, int root_fd, UserRecord *old_home) {
         _cleanup_(user_record_unrefp) UserRecord *embedded = NULL;
         int r;
 
         assert(h);
         assert(root_fd >= 0);
-        assert(uid_is_valid(uid));
 
         r = user_record_clone(h, USER_RECORD_EXTRACT_EMBEDDED|USER_RECORD_PERMISSIVE, &embedded);
         if (r < 0)
@@ -848,7 +847,7 @@ int home_refresh(
         if (r < 0)
                 return r;
 
-        r = home_store_embedded_identity(new_home, setup->root_fd, h->uid, embedded_home);
+        r = home_store_embedded_identity(new_home, setup->root_fd, embedded_home);
         if (r < 0)
                 return r;
 
@@ -1068,7 +1067,7 @@ int home_populate(UserRecord *h, int dir_fd) {
         if (r < 0)
                 return r;
 
-        r = home_store_embedded_identity(h, dir_fd, h->uid, NULL);
+        r = home_store_embedded_identity(h, dir_fd, NULL);
         if (r < 0)
                 return r;
 
@@ -1608,7 +1607,7 @@ static int home_update(UserRecord *h, UserRecord **ret) {
         if (r < 0)
                 return r;
 
-        r = home_store_embedded_identity(new_home, setup.root_fd, h->uid, embedded_home);
+        r = home_store_embedded_identity(new_home, setup.root_fd, embedded_home);
         if (r < 0)
                 return r;
 
@@ -1733,7 +1732,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) {
         if (r < 0)
                 return r;
 
-        r = home_store_embedded_identity(new_home, setup.root_fd, h->uid, embedded_home);
+        r = home_store_embedded_identity(new_home, setup.root_fd, embedded_home);
         if (r < 0)
                 return r;
 
index cef3f4eb98b99996136502068e2ef1fe292f87ad..fb2b43edd63fdd4c43677f7be56798a61ff78c42 100644 (file)
@@ -87,7 +87,7 @@ int home_maybe_shift_uid(UserRecord *h, HomeSetupFlags flags, HomeSetup *setup);
 int home_populate(UserRecord *h, int dir_fd);
 
 int home_load_embedded_identity(UserRecord *h, int root_fd, UserRecord *header_home, UserReconcileMode mode, PasswordCache *cache, UserRecord **ret_embedded_home, UserRecord **ret_new_home);
-int home_store_embedded_identity(UserRecord *h, int root_fd, uid_t uid, UserRecord *old_home);
+int home_store_embedded_identity(UserRecord *h, int root_fd, UserRecord *old_home);
 int home_extend_embedded_identity(UserRecord *h, UserRecord *used, HomeSetup *setup);
 
 int user_record_authenticate(UserRecord *h, UserRecord *secret, PasswordCache *cache, bool strict_verify);