From: Lennart Poettering Date: Thu, 21 Oct 2021 16:47:24 +0000 (+0200) Subject: homework: move check for CIFS service field initialization to home_setup_cifs() X-Git-Tag: v250-rc1~396^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5971c318d43e83698e691cf6bbfc3b8f7771a502;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/home/homework-cifs.c b/src/home/homework-cifs.c index 399df37b419..f0a1d51b8f3 100644 --- a/src/home/homework-cifs.c +++ b/src/home/homework-cifs.c @@ -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 */