Bug 2192234 - Symlinks for letsencrypt/certbot are weird
Summary: Symlinks for letsencrypt/certbot are weird
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: certbot
Version: 37
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nick Bebout
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-30 18:31 UTC by Chris Adams
Modified: 2023-07-15 16:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chris Adams 2023-04-30 18:31:07 UTC
The symlinks for /usr/bin/letsencrypt and /usr/bin/certbot are created with the -r option to ln, which creates links relative to the buildroot, not the install root, so they look like:

lrwxrwxrwx    1 root     root                       35 Apr 30 13:10 /usr/bin/certbot -> ../../../../../../usr/bin/certbot-3
lrwxrwxrwx    1 root     root                       33 Apr 30 13:10 /usr/bin/letsencrypt -> ../../../../../../usr/bin/certbot

There's no need for this (and it can be wrong when an RPM is manually extracted to a temp directory for examination for example). In fact, they don't even need a path (since they're linking to something in the same directory).  Just doing:

ln -s certbot %{buildroot}%{_bindir}/%{oldpkg}
ln -s certbot-3 %{buildroot}%{_bindir}/certbot

would work fine.

Reproducible: Always

Comment 1 Mattias Ellert 2023-07-07 17:38:50 UTC
In addition, the symlinks in /usr/share/doc/certbot are broken, pointing to non-existing files:

[root@fedora ~]# ls -l /usr/share/doc/certbot
totalt 4
lrwxrwxrwx. 1 root root  20  9 maj 21.45 CHANGELOG.md -> certbot/CHANGELOG.md
-rw-r--r--. 1 root root 524 22 maj 02.00 README.fedora
lrwxrwxrwx. 1 root root  18  9 maj 21.45 README.rst -> certbot/README.rst

As are the one in /usr/share/doc/python3-certbot and /usr/share/doc/python3-acme:

[root@fedora ~]# ls -l /usr/share/doc/python3-certbot
totalt 0
lrwxrwxrwx. 1 root root 20  9 maj 21.45 CHANGELOG.md -> certbot/CHANGELOG.md
lrwxrwxrwx. 1 root root 18  9 maj 21.45 README.rst -> certbot/README.rst

[root@fedora ~]# ls -l /usr/share/doc/python3-acme
totalt 0
lrwxrwxrwx. 1 root root 20  9 maj 21.45 CHANGELOG.md -> certbot/CHANGELOG.md
lrwxrwxrwx. 1 root root 18  9 maj 21.45 README.rst -> certbot/README.rst

I suspect the intention was that /usr/share/doc/certbot/CHANGELOG.md and /usr/share/doc/certbot/README.rst should have been the regular files, i.e. not symlinks, and that the ones in the python package should point to those, e.g. the ../ is missing:

lrwxrwxrwx. 1 root root 20  9 maj 21.45 CHANGELOG.md -> ../certbot/CHANGELOG.md
lrwxrwxrwx. 1 root root 18  9 maj 21.45 README.rst -> ../certbot/README.rst

Comment 2 Mattias Ellert 2023-07-15 16:42:19 UTC
Pull request:
https://src.fedoraproject.org/rpms/certbot/pull-request/12


Note You need to log in before you can comment on or make changes to this bug.