mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
Merge pull request #13996 from poettering/utc-fix
accept UTC timezone explicitly, even if timezone data is missing
This commit is contained in:
commit
4da0b33511
@ -1258,6 +1258,7 @@ int get_timezones(char ***ret) {
|
||||
}
|
||||
|
||||
strv_sort(zones);
|
||||
strv_uniq(zones);
|
||||
|
||||
} else if (errno != ENOENT)
|
||||
return -errno;
|
||||
@ -1277,6 +1278,10 @@ bool timezone_is_valid(const char *name, int log_level) {
|
||||
if (isempty(name))
|
||||
return false;
|
||||
|
||||
/* Always accept "UTC" as valid timezone, since it's the fallback, even if user has no timezones installed. */
|
||||
if (streq(name, "UTC"))
|
||||
return true;
|
||||
|
||||
if (name[0] == '/')
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user