summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-02-14 12:26:13 +0100
committerHarald Hoyer <harald@redhat.com>2013-02-14 16:19:38 +0100
commita5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 (patch)
treeb3cc19cede403ac324f56c54ca89db0feef2a72d /src/locale
parentedc211f314f257921eb3599b5dca8d51984b9328 (diff)
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
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localed.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/locale/localed.c b/src/locale/localed.c
index fedcdfb373..4f85b8b583 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -32,6 +32,9 @@
#include "polkit.h"
#include "def.h"
#include "env-util.h"
+#include "fileio.h"
+#include "fileio-label.h"
+#include "label.h"
#define INTERFACE \
" <interface name=\"org.freedesktop.locale1\">\n" \
@@ -390,7 +393,7 @@ static int write_data_locale(void) {
return 0;
}
- r = write_env_file("/etc/locale.conf", l);
+ r = write_env_file_label("/etc/locale.conf", l);
strv_free(l);
return r;
@@ -546,7 +549,7 @@ static int write_data_vconsole(void) {
return 0;
}
- r = write_env_file("/etc/vconsole.conf", l);
+ r = write_env_file_label("/etc/vconsole.conf", l);
strv_free(l);
return r;
@@ -1364,7 +1367,7 @@ int main(int argc, char *argv[]) {
log_set_target(LOG_TARGET_AUTO);
log_parse_environment();
log_open();
-
+ label_init("/etc");
umask(0022);
if (argc == 2 && streq(argv[1], "--introspect")) {