1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-21 14:50:12 +03:00

6 Commits

Author SHA1 Message Date
Lennart Poettering
85401466ea hostnamed: when parsing day/month of firmware date, force decimal parsing
safe_atou() by default determines the base from the prefix 0x, 0b, 0o
and for compat with just 0 for octal. This is not what we want here,
since the date components are padded with zeroes yet still decimal.
Hence force decimal parsing (and while we are at it, prohibit a couple
of unexpected decorations).

WIthout this we'd fail to parse any the 8th and 9th day of each months, as
well aus aug and september of every year, because these look like octal
numbers but cannot actually parsed as such.

Let's change the testcase to check for a date that exposes this
bheaviour.

(cherry picked from commit 7dad6de158cbc280988efa9e52e6d2b9c840ea9f)
2023-07-07 19:30:52 +01:00
Lennart Poettering
75e96639a6 hostnamed: don't read DMI data within a container
If we run in a container we should show info about the container, not
the host.

(cherry picked from commit e7932afe1bb91412c8ff26dba46513605199196e)
2023-07-07 19:30:52 +01:00
Zbigniew Jędrzejewski-Szmek
7a17e41dcf test: drop whitespace after shell redirection operators
(The one case that is left unchanged is '< <(subcommand)'.)

This way, the style with no gap was already dominant. This way, the reader
immediately knows that ' < ' is a comparison operator and ' << ' is a shift.

In a few cases, replace custom EOF replacement by just EOF. There is no point
in using someting like "_EOL" unless "EOF" appears in the text.
2023-02-06 09:19:04 +01:00
Jelle van der Waa
ad8858c1f7 hostnamed: expose FirmwareDate as timestamp in dbus
Offer the firmware date as an epoch instead of the literal DMI string.

Closes #25679
2023-01-19 21:57:06 +01:00
Yu Watanabe
1283eea8f4 test: add test case for chassis type 2022-08-22 19:26:31 +09:00
Yu Watanabe
39f4546199 test: import hostnamed tests from debian/ubuntu test suite 2022-06-14 20:56:18 +09:00