summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch')
-rw-r--r--sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch b/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch
new file mode 100644
index 0000000..5a95c0f
--- /dev/null
+++ b/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch
@@ -0,0 +1,32 @@
+http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-March/009205.html
+
+https://bugs.gentoo.org/406819
+
+--- shadow-4.1.5/lib/commonio.c
++++ shadow-4.1.5/lib/commonio.c
+@@ -977,6 +977,12 @@ int commonio_close (struct commonio_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 *
+ goto fail;
+ }
+
++#ifdef WITH_SELINUX
++ if (reset_selinux_file_context () != 0) {
++ goto fail;
++ }
++#endif
++
+ nscd_need_reload = true;
+ goto success;
+ fail: