1 |
vapier 12/04/21 17:20:11 |
2 |
|
3 |
Added: shadow-4.1.5-selinux-groupadd.patch |
4 |
shadow-4.1.5-grremove.patch |
5 |
Log: |
6 |
Fix crash when calling userdel #405409 by Yuri Mamaev. Add patch for groupadd on selinux #406819 by Amadeusz Sławiński. Depend on libsemanage when USE=selinux #408173 by Markus Knetschke. |
7 |
|
8 |
(Portage version: 2.2.0_alpha100/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.5-selinux-groupadd.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: shadow-4.1.5-selinux-groupadd.patch |
17 |
=================================================================== |
18 |
http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-March/009205.html |
19 |
|
20 |
https://bugs.gentoo.org/406819 |
21 |
|
22 |
--- shadow-4.1.5/lib/commonio.c |
23 |
+++ shadow-4.1.5/lib/commonio.c |
24 |
@@ -977,6 +977,12 @@ int commonio_close (struct commonio_db * |
25 |
|
26 |
snprintf (buf, sizeof buf, "%s+", db->filename); |
27 |
|
28 |
+#ifdef WITH_SELINUX |
29 |
+ if (set_selinux_file_context (buf) != 0) { |
30 |
+ errors++; |
31 |
+ } |
32 |
+#endif |
33 |
+ |
34 |
db->fp = fopen_set_perms (buf, "w", &sb); |
35 |
if (NULL == db->fp) { |
36 |
goto fail; |
37 |
@@ -1011,6 +1017,12 @@ int commonio_close (struct commonio_db * |
38 |
goto fail; |
39 |
} |
40 |
|
41 |
+#ifdef WITH_SELINUX |
42 |
+ if (reset_selinux_file_context () != 0) { |
43 |
+ goto fail; |
44 |
+ } |
45 |
+#endif |
46 |
+ |
47 |
nscd_need_reload = true; |
48 |
goto success; |
49 |
fail: |
50 |
|
51 |
|
52 |
|
53 |
1.1 sys-apps/shadow/files/shadow-4.1.5-grremove.patch |
54 |
|
55 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.5-grremove.patch?rev=1.1&view=markup |
56 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.5-grremove.patch?rev=1.1&content-type=text/plain |
57 |
|
58 |
Index: shadow-4.1.5-grremove.patch |
59 |
=================================================================== |
60 |
https://bugs.gentoo.org/405409 |
61 |
|
62 |
http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-February/009159.html |
63 |
http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2012-March/009196.html |
64 |
|
65 |
--- shadow-4.1.5/src/userdel.c |
66 |
+++ shadow-4.1.5/src/userdel.c |
67 |
@@ -333,22 +333,22 @@ static void remove_usergroup (void) |
68 |
* We can remove this group, it is not the primary |
69 |
* group of any remaining user. |
70 |
*/ |
71 |
- if (gr_remove (grp->gr_name) == 0) { |
72 |
+ if (gr_remove (user_name) == 0) { |
73 |
fprintf (stderr, |
74 |
_("%s: cannot remove entry '%s' from %s\n"), |
75 |
- Prog, grp->gr_name, gr_dbname ()); |
76 |
+ Prog, user_name, gr_dbname ()); |
77 |
fail_exit (E_GRP_UPDATE); |
78 |
} |
79 |
|
80 |
#ifdef WITH_AUDIT |
81 |
audit_logger (AUDIT_DEL_GROUP, Prog, |
82 |
"deleting group", |
83 |
- grp->gr_name, AUDIT_NO_ID, |
84 |
+ user_name, AUDIT_NO_ID, |
85 |
SHADOW_AUDIT_SUCCESS); |
86 |
#endif /* WITH_AUDIT */ |
87 |
SYSLOG ((LOG_INFO, |
88 |
"removed group '%s' owned by '%s'\n", |
89 |
- grp->gr_name, user_name)); |
90 |
+ user_name, user_name)); |
91 |
|
92 |
#ifdef SHADOWGRP |
93 |
if (sgr_locate (user_name) != NULL) { |
94 |
@@ -361,12 +361,12 @@ static void remove_usergroup (void) |
95 |
#ifdef WITH_AUDIT |
96 |
audit_logger (AUDIT_DEL_GROUP, Prog, |
97 |
"deleting shadow group", |
98 |
- grp->gr_name, AUDIT_NO_ID, |
99 |
+ user_name, AUDIT_NO_ID, |
100 |
SHADOW_AUDIT_SUCCESS); |
101 |
#endif /* WITH_AUDIT */ |
102 |
SYSLOG ((LOG_INFO, |
103 |
"removed shadow group '%s' owned by '%s'\n", |
104 |
- grp->gr_name, user_name)); |
105 |
+ user_name, user_name)); |
106 |
|
107 |
} |
108 |
#endif /* SHADOWGRP */ |