Gentoo Archives: gentoo-commits

From: "JosA MarAa Alonso (nimiux)" <nimiux@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/proj/es/hardened/selinux: hb-using-configuring.xml
Date: Wed, 02 Jan 2013 18:28:18
Message-Id: 20130102182808.59AB92171D@flycatcher.gentoo.org
1 nimiux 13/01/02 18:28:08
2
3 Modified: hb-using-configuring.xml
4 Log:
5 Update init script so it can be used in the sysinit phase
6
7 Revision Changes Path
8 1.6 xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml?rev=1.6&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml?rev=1.6&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml?r1=1.5&r2=1.6
13
14 Index: hb-using-configuring.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml,v
17 retrieving revision 1.5
18 retrieving revision 1.6
19 diff -u -r1.5 -r1.6
20 --- hb-using-configuring.xml 15 Aug 2012 17:06:22 -0000 1.5
21 +++ hb-using-configuring.xml 2 Jan 2013 18:28:08 -0000 1.6
22 @@ -4,11 +4,12 @@
23 <!-- The content of this document is licensed under the CC-BY-SA license -->
24 <!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
25
26 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml,v 1.5 2012/08/15 17:06:22 nimiux Exp $ -->
27 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml,v 1.6 2013/01/02 18:28:08 nimiux Exp $ -->
28
29 <sections>
30 -<version>3</version>
31 -<date>2012-08-14</date>
32 +
33 +<version>4</version>
34 +<date>2012-12-29</date>
35
36 <section>
37 <title>Administrando usuarios</title>
38 @@ -1088,29 +1089,37 @@
39 #!/sbin/runscript
40 # Copyright 1999-2012 Gentoo Foundation
41 # Distributed under the terms of the GNU General Public License v2
42 -# $Header: /var/cvsroot/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml,v 1.5 2012/08/15 17:06:22 nimiux Exp $
43 +# $Header: /var/cvsroot/gentoo/xml/htdocs/proj/es/hardened/selinux/hb-using-configuring.xml,v 1.6 2013/01/02 18:28:08 nimiux Exp $
44
45 description="Switch into SELinux enforcing mode"
46
47 depend() {
48 - need localmount
49 + need sysfs
50 }
51
52 start() {
53 - ebegin "Restoring file contexts in /dev"
54 - restorecon -R /dev
55 - eend 0
56 -
57 - if get_bootparam "nosetenforce" ; then
58 - ewarn "Skipping switching to enforcing mode as requested by kernel cmdline"
59 - else
60 - . /etc/selinux/config
61 -
62 - if [ "${SELINUX}" = "enforcing" ];
63 - then
64 - ebegin "Switching to enforcing mode"
65 - setenforce 1
66 - eend $?
67 + if get_bootparam "norestorecon" ; then
68 + ewarn "Skipping restoring file contexts in /dev as requested"
69 + else
70 + ebegin "Restoring file contexts in /dev"
71 + restorecon -R /dev
72 + eend 0
73 + fi
74 +
75 +
76 + if get_bootparam "nosetenforce" ; then
77 + ewarn "Skipping switching to enforcing mode as requested by kernel cmdline"
78 + else
79 + . /etc/selinux/config
80 + CURRENTMODE=$(cat /sys/fs/selinux/enforce)
81 +
82 + if [ "${SELINUX}" = "enforcing" ] &amp;&amp; [ "${CURRENTMODE}" = "0" ];
83 + then
84 + ebegin "Switching to enforcing mode"
85 + echo 1 &gt; /sys/fs/selinux/enforce
86 + eend $?
87 + else
88 + ewarn "Not switching to enforcing mode, or enforcing mode already enabled"
89 fi
90 fi
91 }