bootctl: do not print slash more than once

When bootctl is called by an unprivileged user, then previously we got
```
Failed to read "/boot/EFI/systemd": Permission denied
Failed to open '/boot//loader/loader.conf': Permission denied
```
Now, with this patch, we get
```
Failed to read "/boot/EFI/systemd": Permission denied
Failed to open '/boot/loader/loader.conf': Permission denied
```
This commit is contained in:
Yu Watanabe
2025-05-31 13:53:04 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 0af9937691
commit 91c60ff528
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -880,7 +880,7 @@ static int install_variables(
if (r == -ENOENT)
return 0;
if (r < 0)
return log_error_errno(r, "Cannot access \"%s/%s\": %m", esp_path, path);
return log_error_errno(r, "Cannot access \"%s/%s\": %m", esp_path, skip_leading_slash(path));
r = find_slot(uuid, path, &slot);
if (r < 0) {