1
1
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:
Anita Zhang 2019-11-11 17:47:43 -08:00 committed by GitHub
commit 4da0b33511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;