From: Daan De Meyer Date: Fri, 4 Oct 2024 08:27:04 +0000 (+0200) Subject: repart: Handle empty arg_copy_source in file_is_denylisted() X-Git-Tag: v257-rc1~325 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cd56ec9515a7ffc4edbd7d10ab7d001129abf57;p=thirdparty%2Fsystemd.git repart: Handle empty arg_copy_source in file_is_denylisted() --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 090fe276728..95ae0a3158e 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -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)