diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-12-13 10:04:48 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-12-14 12:18:58 +0100 |
commit | 56b7f112ed7e3e5e6f495e8d01a89c292c9f8847 (patch) | |
tree | 39169f19e32af849efbf58e269fc4ff401bfdb7e /src/locale | |
parent | locale-setup: make failure in stat() critical (diff) | |
download | systemd-56b7f112ed7e3e5e6f495e8d01a89c292c9f8847.tar.xz systemd-56b7f112ed7e3e5e6f495e8d01a89c292c9f8847.zip |
locale-setup: avoid TOCTOU in reading locale.conf
Diffstat (limited to 'src/locale')
-rw-r--r-- | src/locale/localectl.c | 2 | ||||
-rw-r--r-- | src/locale/localed.c | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 966f07d083..fb83881cc7 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -61,7 +61,7 @@ static int print_status_info(StatusInfo *i) { assert(i); if (arg_transport == BUS_TRANSPORT_LOCAL) { - _cleanup_(locale_context_clear) LocaleContext c = { .mtime = USEC_INFINITY }; + _cleanup_(locale_context_clear) LocaleContext c = {}; r = locale_context_load(&c, LOCALE_LOAD_PROC_CMDLINE); if (r < 0) diff --git a/src/locale/localed.c b/src/locale/localed.c index ebce509b30..737cc69079 100644 --- a/src/locale/localed.c +++ b/src/locale/localed.c @@ -764,9 +764,7 @@ static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) { } static int run(int argc, char *argv[]) { - _cleanup_(context_clear) Context context = { - .locale_context.mtime = USEC_INFINITY, - }; + _cleanup_(context_clear) Context context = {}; _cleanup_(sd_event_unrefp) sd_event *event = NULL; _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; int r; |