summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-12-13 18:04:48 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-12-14 20:18:58 +0900
commit56b7f112ed7e3e5e6f495e8d01a89c292c9f8847 (patch)
tree39169f19e32af849efbf58e269fc4ff401bfdb7e /src/locale
parent00afa6a38fbd05f79ffc1b1365ad68f63e7ac335 (diff)
downloadsystemd-56b7f112ed7e3e5e6f495e8d01a89c292c9f8847.tar.gz
locale-setup: avoid TOCTOU in reading locale.conf
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localectl.c2
-rw-r--r--src/locale/localed.c4
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;