1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 07:51:21 +03:00

homework: move check for CIFS service field initialization to home_setup_cifs()

We need this field not only during activation but any kind of setup,
hence let's move it into the setup code.
This commit is contained in:
Lennart Poettering 2021-10-21 18:47:24 +02:00
parent 812e587696
commit 5971c318d4

View 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 */