Gentoo Archives: gentoo-commits

From: "Chris PeBenito (pebenito)" <pebenito@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-projects commit in hardened/policycoreutils-extra/scripts: rlpkg
Date: Wed, 30 Jun 2010 00:38:36
Message-Id: 20100630003833.9A9922C621@corvid.gentoo.org
1 pebenito 10/06/30 00:38:33
2
3 Modified: rlpkg
4 Log:
5 policycoreutils-extra: update rlpkg to use scanelf -l and -p options for scanning locations, rather than hardcoding directories.
6
7 Revision Changes Path
8 1.12 hardened/policycoreutils-extra/scripts/rlpkg
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg?rev=1.12&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg?rev=1.12&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg?r1=1.11&r2=1.12
13
14 Index: rlpkg
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg,v
17 retrieving revision 1.11
18 retrieving revision 1.12
19 diff -u -r1.11 -r1.12
20 --- rlpkg 2 Aug 2009 01:20:32 -0000 1.11
21 +++ rlpkg 30 Jun 2010 00:38:33 -0000 1.12
22 @@ -1,7 +1,7 @@
23 #!/usr/bin/python
24 #
25 -# Copyright(c) 2006, Chris PeBenito <pebenito@g.o>
26 -# Copyright(c) 2006, Gentoo Foundation
27 +# Copyright(c) 2006-2010, Chris PeBenito <pebenito@g.o>
28 +# Copyright(c) 2006-2010, Gentoo Foundation
29 #
30 # Portage query code derived from gentoolkit:
31 # Copyright(c) 2004, Gentoo Foundation
32 @@ -9,7 +9,7 @@
33 #
34 # Licensed under the GNU General Public License, v2
35 #
36 -# $Header: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg,v 1.11 2009/08/02 01:20:32 pebenito Exp $
37 +# $Header: /var/cvsroot/gentoo-projects/hardened/policycoreutils-extra/scripts/rlpkg,v 1.12 2010/06/30 00:38:33 pebenito Exp $
38
39 import os,sys,string,getopt,selinux,portage,subprocess
40
41 @@ -20,11 +20,11 @@
42 xattrfs=["btrfs","ext2","ext3","ext4","jfs","xfs"]
43 settings=portage.config(clone=portage.settings)
44
45 -textrel_shlib_paths=["/lib","/usr/lib","/emul","/opt"]
46 +textrel_shlib=SCANELF+["-l"]
47 textrel_type="textrel_shlib_t"
48 textrel_ok_relabelfrom=["lib_t","shlib_t"]
49
50 -textrel_bin_paths=["/bin","/sbin","/usr/bin","/usr/sbin"]
51 +textrel_bin=SCANELF+["-p"]
52
53 class Package:
54 """Package descriptor. Contains convenience functions for querying the
55 @@ -147,7 +147,7 @@
56 def relabel_textrel_shlib(verbose):
57 print "Scanning for shared libraries with text relocations..."
58
59 - tl = subprocess.Popen(SCANELF+textrel_shlib_paths, stdout=subprocess.PIPE, close_fds=True, bufsize=1)
60 + tl = subprocess.Popen(textrel_shlib, stdout=subprocess.PIPE, close_fds=True, bufsize=1)
61 tl.wait()
62
63 notok = 0
64 @@ -192,7 +192,7 @@
65
66 print "Scanning for PIE binaries with text relocations..."
67
68 - tb = subprocess.Popen(SCANELF+textrel_bin_paths, stdout=subprocess.PIPE, close_fds=True, bufsize=1)
69 + tb = subprocess.Popen(textrel_bin, stdout=subprocess.PIPE, close_fds=True, bufsize=1)
70 tb.wait()
71
72 textrel_bins = 0