From 4b3b5bc71b791a67d991389d8f59ab891b051b86 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 30 Apr 2019 19:25:29 +0200 Subject: tree-wide: port various places over to use chmod_and_chown() Doing this properly is hard, hence let's unify the code. --- src/random-seed/random-seed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/random-seed') diff --git a/src/random-seed/random-seed.c b/src/random-seed/random-seed.c index 71c2dba431..510a2715f2 100644 --- a/src/random-seed/random-seed.c +++ b/src/random-seed/random-seed.c @@ -10,6 +10,7 @@ #include "alloc-util.h" #include "fd-util.h" +#include "fs-util.h" #include "io-util.h" #include "log.h" #include "main-func.h" @@ -156,8 +157,7 @@ static int run(int argc, char *argv[]) { /* This is just a safety measure. Given that we are root and * most likely created the file ourselves the mode and owner * should be correct anyway. */ - (void) fchmod(seed_fd, 0600); - (void) fchown(seed_fd, 0, 0); + (void) fchmod_and_chown(seed_fd, 0600, 0, 0); k = loop_read(random_fd, buf, buf_size, false); if (k < 0) -- cgit v1.2.1