]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homework: move check for CIFS service field initialization to home_setup_cifs()
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Oct 2021 16:47:24 +0000 (18:47 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Oct 2021 20:37:56 +0000 (22:37 +0200)
We need this field not only during activation but any kind of setup,
hence let's move it into the setup code.

src/home/homework-cifs.c

index 399df37b4194d62dec4375ea02717c35a3622cde..f0a1d51b8f3ad04b9929fdfb8e67f579aef7d2da 100644 (file)
@@ -35,6 +35,9 @@ int home_setup_cifs(
                 return 0;
         }
 
+        if (!h->cifs_service)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "User record lacks CIFS service, refusing.");
+
         r = home_unshare_and_mkdir();
         if (r < 0)
                 return r;
@@ -118,9 +121,6 @@ int home_activate_cifs(
         assert(setup);
         assert(ret_home);
 
-        if (!h->cifs_service)
-                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "User record lacks CIFS service, refusing.");
-
         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 */