]> 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)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 28 May 2025 11:50:50 +0000 (12:50 +0100)
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.)

(cherry picked from commit 5b759bf5fd3a915a5b4756590caff7faf43a9693)

src/home/homework-mount.c

index 0907a96e473230f22af294781785f11e41c5ce1d..f1738c8967aeccf74ea6e583aaa1c6ca402964a0 100644 (file)
@@ -143,7 +143,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)