From a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 14 Feb 2013 12:26:13 +0100 Subject: honor SELinux labels, when creating and writing config files Also split out some fileio functions to fileio.c and provide a SELinux aware pendant in fileio-label.c see https://bugzilla.redhat.com/show_bug.cgi?id=881577 --- src/timedate/timedated.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/timedate/timedated.c') diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c index b8c6b36858..80c24eb62b 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -35,6 +35,8 @@ #include "hwclock.h" #include "conf-files.h" #include "path-util.h" +#include "fileio-label.h" +#include "label.h" #define NULL_ADJTIME_UTC "0.0 0 0\n0\nUTC\n" #define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n" @@ -269,8 +271,8 @@ static int write_data_local_rtc(void) { return 0; } } - - r = write_one_line_file_atomic("/etc/adjtime", w); + label_init("/etc"); + r = write_one_line_file_atomic_label("/etc/adjtime", w); free(w); return r; -- cgit v1.2.3-54-g00ecf