public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/elfix:master commit in: scripts/, misc/test-revdep-pax/
@ 2011-12-29  0:46 Anthony G. Basile
  0 siblings, 0 replies; only message in thread
From: Anthony G. Basile @ 2011-12-29  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     8ac71d82369c2569e1a2a973bd9c7cc44456ee92
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 29 00:46:48 2011 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu Dec 29 00:46:48 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=8ac71d82

scripts/revdep-pax: do complex markings

---
 misc/test-revdep-pax/testrevdeppax.sh |    8 +++++++-
 scripts/revdep-pax                    |   24 ++++++++++++++++++------
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/misc/test-revdep-pax/testrevdeppax.sh b/misc/test-revdep-pax/testrevdeppax.sh
index d841fae..8bd3156 100755
--- a/misc/test-revdep-pax/testrevdeppax.sh
+++ b/misc/test-revdep-pax/testrevdeppax.sh
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 PAXCTLNG="/usr/sbin/paxctl-ng"
+PAXCTL="/sbin/paxctl"
 BINARY="/usr/bin/testrevdeppax"
 LIBRARY="/usr/lib/libmyrevdeppax.so.0.0.0"
 REVDEPPAX="/usr/sbin/revdep-pax"
@@ -19,15 +20,20 @@ for i in "R" "r" "Rr"
 do
 	for j in "R" "r" "Rr"
 	do
+		echo "============================================================================"
 		$PAXCTLNG -z $BINARY
 		$PAXCTLNG -$i $BINARY
 		$PAXCTLNG -z $LIBRARY
-		$PAXCTLNG -$j $LIBRARY
+		$PAXCTLNG -m$j $LIBRARY
 		p=$i; [[ "$p" == "Rr" ]] && p="-"
 		echo "Binary  -> $p"
 		p=$j; [[ "$p" == "Rr" ]] && p="-"
 		echo "Library -> $p"
 		$REVDEPPAX -m -y -l $LIBRARY
 		echo
+		$PAXCTLNG -v $BINARY
+		$PAXCTLNG -v $LIBRARY
+		$PAXCTL -v $BINARY 2>/dev/null
+		$PAXCTL -v $LIBRARY 2>/dev/null
 	done
 done

diff --git a/scripts/revdep-pax b/scripts/revdep-pax
index b0d8bcc..76add9c 100755
--- a/scripts/revdep-pax
+++ b/scripts/revdep-pax
@@ -211,23 +211,35 @@ def migrate_flags(importer, exporter_str_flags, exporter_bin_flags):
 	#	Force Off       Force On        Force Off + Warn
 	#	Force Off       Nothing         Force Off
 
+	#See /usr/include/elf.h for these values
+	pf_flags = {
+		'P':1<<4, 'p':1<<5,
+		'S':1<<6, 's':1<<7,
+		'M':1<<8, 'm':1<<9,
+		'X':1<<10, 'x':1<<11,
+		'E':1<<12, 'e':1<<13,
+		'R':1<<14, 'r':1<<15
+	}
+
 	( importer_str_flags, importer_bin_flags ) = pax.getflags(importer)
 
 	result_bin_flags = exporter_bin_flags
 
 	for i in range(len(importer_str_flags)):
 		if importer_str_flags[i].isupper() and exporter_str_flags[i].islower():
-			print '\t\tWarning: %s has %s, trying to set to %s' % (
+			result_bin_flags = result_bin_flags ^ pf_flags[exporter_str_flags[i]]
+			result_bin_flags = result_bin_flags | pf_flags[importer_str_flags[i]]
+			print '\t\tWarning: %s has %s, refusing to set to %s' % (
 				importer, importer_str_flags[i], exporter_str_flags[i] ),
 		if importer_str_flags[i].isupper() and exporter_str_flags[i] == '-':
-			print '\t\tWarning: %s has %s, trying to set to %s' % (
-				importer, importer_str_flags[i], exporter_str_flags[i] ),
+			result_bin_flags = result_bin_flags | pf_flags[importer_str_flags[i]]
 		if importer_str_flags[i].islower() and exporter_str_flags[i].isupper():
-			print '\t\tWarning: %s has %s, trying to set to %s' % (
+			result_bin_flags = result_bin_flags ^ pf_flags[exporter_str_flags[i]]
+			result_bin_flags = result_bin_flags | pf_flags[importer_str_flags[i]]
+			print '\t\tWarning: %s has %s, refusing to set to %s' % (
 				importer, importer_str_flags[i], exporter_str_flags[i] ),
 		if importer_str_flags[i].islower() and exporter_str_flags[i] == '-':
-			print '\t\tWarning: %s has %s, trying to set to %s' % (
-				importer, importer_str_flags[i], exporter_str_flags[i] ),
+			result_bin_flags = result_bin_flags | pf_flags[importer_str_flags[i]]
 
 	pax.setflags(importer, result_bin_flags)
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-12-29  0:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29  0:46 [gentoo-commits] proj/elfix:master commit in: scripts/, misc/test-revdep-pax/ Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox