]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: generate proper error if we cannot create mountpoint for homedir
authorLennart Poettering <lennart@poettering.net>
Fri, 23 May 2025 10:15:45 +0000 (12:15 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 27 May 2025 01:10:03 +0000 (10:10 +0900)
Let's make this easier to debug. (When this failed for me due to disk
full it took me a bit to figure out what was going on.)

src/home/homework-mount.c

index 2b340ce54cb84979d0043186f4cd7b27a5d6456b..56b83147bfd686059c544d467ce6337e31f09450 100644 (file)
@@ -140,7 +140,9 @@ int home_move_mount(const char *mount_suffix, const char *target) {
         } else
                 d = HOME_RUNTIME_WORK_DIR;
 
-        (void) mkdir_p(target, 0700);
+        r = mkdir_p(target, 0700);
+        if (r < 0)
+                return log_error_errno(r, "Failed to create directory '%s': %m", target);
 
         r = mount_nofollow_verbose(LOG_ERR, d, target, NULL, MS_BIND, NULL);
         if (r < 0)