Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#75977 - [archlinux-keyring] Double slash in file path

Attached to Project: Arch Linux
Opened by Richard Neumann (rne) - Thursday, 22 September 2022, 22:21 GMT
Last edited by Toolybird (Toolybird) - Friday, 23 September 2022, 06:37 GMT
Task Type General Gripe
Category Packages: Core
Status Assigned
Assigned To Pierre Schmitz (Pierre)
Christian Hesse (eworm)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No


In /usr/lib/systemd/system/archlinux-keyring-wkd-sync.service the path to the executable contains a double slash in the ExecStart= file path.
This is due to the fact that in the *.in file, the placeholder and the binary name are separated via a slash as well as in the Makefile the default install directory ends with a slash.
One of them should be removed

Additional info:
* 20220828-1

Steps to reproduce:
grep ExecStart /usr/lib/systemd/system/archlinux-keyring-wkd-sync.service

I would have made a pull request to the repo on gitlab on this trivial issue, but normal users are shut out from doing so.
This task depends upon

Comment by Christian Hesse (eworm) - Friday, 23 September 2022, 07:02 GMT
Want to upload a patch here? I will generate a merge request then.
Comment by Richard Neumann (rne) - Friday, 23 September 2022, 07:36 GMT
diff --git a/Makefile b/Makefile
index 7bbbb75..6ea53db 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ SHELL = /bin/bash
PREFIX ?= /usr/local
BUILD_DIR ?= build
KEYRING_TARGET_DIR ?= $(PREFIX)/share/pacman/keyrings/
SYSTEMD_SYSTEM_UNIT_DIR ?= $(shell pkgconf --variable systemd_system_unit_dir systemd)
Comment by Siegfried Metz (NiceGuy) - Friday, 23 September 2022, 10:55 GMT
Dropped by and just wanted to add: with the little patch above both instances with double slashes are fixed in the archlinux-keyring-wkd-sync.service unit: ConditionFileIsExecutable and ExecStart.

As I mentioned in the forum [1], I still wonder why systemd ignores the double slashes without any sort of error message. ls utility also ignores more slashes for a given path, the only expected "not found" error is if a full path is given to the script, i.e.: ./usr/bin//archlinux-keyring-wkd-sync (tested with different shells).

May anyone enlighten me or point me to any material explaining what's going on. Sorry if this is slightly off-topic.

Comment by Richard Neumann (rne) - Friday, 23 September 2022, 11:01 GMT
That's because paths are implicitly canonicalized. I.e. multiple slashes in a row are being reduced to one.
This is also the reason why I tagged "general gripe" rather than "bug", as this is strictly speaking not a bug, but just an imperfection.
Comment by Siegfried Metz (NiceGuy) - Friday, 23 September 2022, 11:17 GMT
Ah, I see. Thanks for taking the time and your clarification.