]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Handle empty arg_copy_source in file_is_denylisted()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 4 Oct 2024 08:27:04 +0000 (10:27 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 4 Oct 2024 10:47:01 +0000 (12:47 +0200)
src/partition/repart.c

index 090fe276728299b6cd87888d478f41b9168926b2..95ae0a3158e304a500c919d9a3bc0e0b85c59d53 100644 (file)
@@ -5458,8 +5458,8 @@ static int file_is_denylisted(const char *source, Hashmap *denylist) {
         if (PTR_TO_INT(hashmap_get(denylist, &st)) == DENY_INODE)
                 return 1;
 
-        if (stat(arg_copy_source, &rst) < 0)
-                return log_error_errno(errno, "Failed to stat '%s': %m", arg_copy_source);
+        if (stat(empty_to_root(arg_copy_source), &rst) < 0)
+                return log_error_errno(errno, "Failed to stat '%s': %m", empty_to_root(arg_copy_source));
 
         pfd = chase_and_open_parent(source, arg_copy_source, CHASE_PREFIX_ROOT, /*ret_filename=*/ NULL);
         if (pfd < 0)