From: David Tardon Date: Mon, 8 Dec 2025 13:28:54 +0000 (+0100) Subject: find-esp: consistently quote paths in log messages X-Git-Tag: v259-rc3~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7cfd4f3f5162ef7762815815ecc96f175cfe1df2;p=thirdparty%2Fsystemd.git find-esp: consistently quote paths in log messages --- diff --git a/src/shared/find-esp.c b/src/shared/find-esp.c index f029d7ea922..ca8d99922de 100644 --- a/src/shared/find-esp.c +++ b/src/shared/find-esp.c @@ -283,7 +283,7 @@ static int verify_fsroot_dir( r = path_extract_filename(path, &f); if (r < 0 && r != -EADDRNOTAVAIL) - return log_error_errno(r, "Failed to extract filename of %s: %m", path); + return log_error_errno(r, "Failed to extract filename of \"%s\": %m", path); if (statx(dir_fd, strempty(f), AT_SYMLINK_NOFOLLOW|(isempty(f) ? AT_EMPTY_PATH : 0), @@ -376,13 +376,13 @@ static int verify_esp( r = path_extract_filename(p, &f); if (r < 0 && r != -EADDRNOTAVAIL) - return log_error_errno(r, "Failed to extract filename of %s: %m", p); + return log_error_errno(r, "Failed to extract filename of \"%s\": %m", p); /* Trigger any automounts so that xstatfsat() operates on the mount instead of the mountpoint * directory. */ r = trigger_automount_at(pfd, f); if (r < 0) - return log_error_errno(r, "Failed to trigger automount at %s: %m", p); + return log_error_errno(r, "Failed to trigger automount at \"%s\": %m", p); r = xstatfsat(pfd, strempty(f), &sfs); if (r < 0) @@ -482,12 +482,12 @@ int find_esp_and_warn_at( if (!path_is_valid(path) || !path_is_absolute(path)) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "$SYSTEMD_ESP_PATH does not refer to an absolute path, refusing to use it: %s", + "$SYSTEMD_ESP_PATH does not refer to an absolute path, refusing to use it: \"%s\"", path); r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd); if (r < 0) - return log_error_errno(r, "Failed to resolve path %s: %m", path); + return log_error_errno(r, "Failed to resolve path \"%s\": %m", path); /* Note: when the user explicitly configured things with an env var we won't validate the * path beyond checking it refers to a directory. After all we want this to be useful for @@ -834,12 +834,12 @@ int find_xbootldr_and_warn_at( if (!path_is_valid(path) || !path_is_absolute(path)) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "$SYSTEMD_XBOOTLDR_PATH does not refer to an absolute path, refusing to use it: %s", + "$SYSTEMD_XBOOTLDR_PATH does not refer to an absolute path, refusing to use it: \"%s\"", path); r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd); if (r < 0) - return log_error_errno(r, "Failed to resolve path %s: %m", p); + return log_error_errno(r, "Failed to resolve path \"%s\": %m", p); if (fstat(fd, &st) < 0) return log_error_errno(errno, "Failed to stat '%s': %m", p);