summaryrefslogtreecommitdiff
path: root/lib/commonio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/commonio.c')
-rw-r--r--lib/commonio.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/commonio.c b/lib/commonio.c
index 60bcd83..6b6ce7b 100644
--- a/lib/commonio.c
+++ b/lib/commonio.c
@@ -32,7 +32,7 @@
#include <config.h>
-#ident "$Id: commonio.c 3655 2011-12-09 22:13:02Z nekral-guest $"
+#ident "$Id: commonio.c 3727 2012-05-18 19:44:53Z nekral-guest $"
#include "defines.h"
#include <assert.h>
@@ -977,6 +977,12 @@ int commonio_close (struct commonio_db *db)
snprintf (buf, sizeof buf, "%s+", db->filename);
+#ifdef WITH_SELINUX
+ if (set_selinux_file_context (buf) != 0) {
+ errors++;
+ }
+#endif
+
db->fp = fopen_set_perms (buf, "w", &sb);
if (NULL == db->fp) {
goto fail;
@@ -1011,6 +1017,12 @@ int commonio_close (struct commonio_db *db)
goto fail;
}
+#ifdef WITH_SELINUX
+ if (reset_selinux_file_context () != 0) {
+ goto fail;
+ }
+#endif
+
nscd_need_reload = true;
goto success;
fail: