-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/mount.h>
#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);
assert(ret_home);
assert_se(ipo = user_record_image_path(h));
- ip = strdupa(ipo); /* copy out, since reconciliation might cause changing of the field */
+ ip = strdupa_safe(ipo); /* copy out, since reconciliation might cause changing of the field */
assert_se(hdo = user_record_home_directory(h));
- hd = strdupa(hdo);
+ 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;
break;
default:
- assert_not_reached("unexpected storage");
+ assert_not_reached();
}
temporary = TAKE_PTR(d); /* Needs to be destroyed now */
if (r < 0)
return r;
- r = user_record_clone(h, USER_RECORD_LOAD_MASK_SECRET, &new_home);
+ r = user_record_clone(h, USER_RECORD_LOAD_MASK_SECRET|USER_RECORD_PERMISSIVE, &new_home);
if (r < 0)
return log_error_errno(r, "Failed to clone record: %m");
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;