operating system name is wrong in command_version() #450

Closed
opened 2025-12-29 01:25:30 +01:00 by adam · 1 comment
Owner

Originally created by @ghost on GitHub (Dec 2, 2019).

When running dehydrated with the -v parameter, I noticed that the operating system name is broken:

$ ./dehydrated  -v
# INFO: Using main config file /root/dehydrated/config
Dehydrated by Lukas Schauer
https://dehydrated.io

Dehydrated version: 0.6.5
GIT-Revision: unknown

OS: \S
Used software:
 bash: 4.4.19(1)-release
 curl: curl 7.61.1
 awk: GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2)
 sed: sed (GNU sed) 4.5
 mktemp: mktemp (GNU coreutils) 8.30
 grep: grep (GNU grep) 3.1
 diff: diff (GNU diffutils) 3.6
 openssl: OpenSSL 1.1.1 FIPS  11 Sep 2018

The problem appears in the command_version() function, in the following line:

echo "OS: $(cat /etc/issue | grep -v ^$ | head -n1 | _sed 's/\\(r|n|l) .*//g')"

Apparently, it reads the /etc/issue file, which in RHEL/CentOS/Fedora systems looks like this:

\S
Kernel \r on an \m (\l)

Since dehydrated does not expand "\S", it appears as-is.

Maybe, on Linux distros using systemd, it would be better to parse the requred /etc/os-release file?

references:
https://www.freedesktop.org/software/systemd/man/os-release.html
https://unix.stackexchange.com/questions/351557/on-what-linux-distributions-can-i-rely-on-the-presence-of-etc-os-release

Originally created by @ghost on GitHub (Dec 2, 2019). When running dehydrated with the -v parameter, I noticed that the operating system name is broken: ``` $ ./dehydrated -v # INFO: Using main config file /root/dehydrated/config Dehydrated by Lukas Schauer https://dehydrated.io Dehydrated version: 0.6.5 GIT-Revision: unknown OS: \S Used software: bash: 4.4.19(1)-release curl: curl 7.61.1 awk: GNU Awk 4.2.1, API: 2.0 (GNU MPFR 3.1.6-p2, GNU MP 6.1.2) sed: sed (GNU sed) 4.5 mktemp: mktemp (GNU coreutils) 8.30 grep: grep (GNU grep) 3.1 diff: diff (GNU diffutils) 3.6 openssl: OpenSSL 1.1.1 FIPS 11 Sep 2018 ``` The problem appears in the command_version() function, in the following line: ```bash echo "OS: $(cat /etc/issue | grep -v ^$ | head -n1 | _sed 's/\\(r|n|l) .*//g')" ``` Apparently, it reads the /etc/issue file, which in RHEL/CentOS/Fedora systems looks like this: ``` \S Kernel \r on an \m (\l) ``` Since dehydrated does not expand "\S", it appears as-is. Maybe, on Linux distros using systemd, it would be better to parse the requred _/etc/os-release_ file? references: https://www.freedesktop.org/software/systemd/man/os-release.html https://unix.stackexchange.com/questions/351557/on-what-linux-distributions-can-i-rely-on-the-presence-of-etc-os-release
adam closed this issue 2025-12-29 01:25:30 +01:00
Author
Owner

@ghost commented on GitHub (Mar 25, 2020):

no interest, closing.

@ghost commented on GitHub (Mar 25, 2020): no interest, closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#450