/[gentoo-x86]/eclass/pax-utils.eclass
Gentoo

Diff of /eclass/pax-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.6 Revision 1.7
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/pax-utils.eclass,v 1.6 2007/04/24 18:27:11 kevquinn Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/pax-utils.eclass,v 1.7 2007/05/07 09:24:16 kevquinn Exp $
4 4
5# Author: 5# Author:
6# Kevin F. Quinn <kevquinn@gentoo.org> 6# Kevin F. Quinn <kevquinn@gentoo.org>
7# 7#
8# This eclass provides support for manipulating PaX markings on ELF 8# This eclass provides support for manipulating PaX markings on ELF
86 # the caller prefixes with - 86 # the caller prefixes with -
87 flags=${1//-} 87 flags=${1//-}
88 shift 88 shift
89 # Try chpax, for (deprecated) EI legacy marking. 89 # Try chpax, for (deprecated) EI legacy marking.
90 if type -p chpax > /dev/null && hasq EI ${PAX_MARKINGS}; then 90 if type -p chpax > /dev/null && hasq EI ${PAX_MARKINGS}; then
91 einfo "Legacy EI PaX marking -${flags}" 91 elog "Legacy EI PaX marking -${flags}"
92 _pax_list_files elog "$@" 92 _pax_list_files elog "$@"
93 for f in "$@"; do 93 for f in "$@"; do
94 chpax -${flags} "${f}" && continue 94 chpax -${flags} "${f}" && continue
95 fail=1 95 fail=1
96 failures="${failures} ${f}" 96 failures="${failures} ${f}"
98 fi 98 fi
99 # Try paxctl, then scanelf - paxctl takes precedence 99 # Try paxctl, then scanelf - paxctl takes precedence
100 # over scanelf. 100 # over scanelf.
101 if type -p paxctl > /dev/null && hasq PT ${PAX_MARKINGS}; then 101 if type -p paxctl > /dev/null && hasq PT ${PAX_MARKINGS}; then
102 # Try paxctl, the upstream supported tool. 102 # Try paxctl, the upstream supported tool.
103 einfo "PT PaX marking -${flags}" 103 elog "PT PaX marking -${flags}"
104 _pax_list_files elog "$@" 104 _pax_list_files elog "$@"
105 for f in "$@"; do 105 for f in "$@"; do
106 # First, try modifying the existing PAX_FLAGS header 106 # First, try modifying the existing PAX_FLAGS header
107 paxctl -q${flags} "${f}" && continue 107 paxctl -q${flags} "${f}" && continue
108 # Second, try stealing the (unused under PaX) PT_GNU_STACK header 108 # Second, try stealing the (unused under PaX) PT_GNU_STACK header
127 done 127 done
128 elif type -p scanelf > /dev/null && [[ ${PAX_MARKINGS} != "none" ]]; then 128 elif type -p scanelf > /dev/null && [[ ${PAX_MARKINGS} != "none" ]]; then
129 # Try scanelf, the Gentoo swiss-army knife ELF utility 129 # Try scanelf, the Gentoo swiss-army knife ELF utility
130 # Currently this sets EI and PT if it can, no option to 130 # Currently this sets EI and PT if it can, no option to
131 # control what it does. 131 # control what it does.
132 einfo "Fallback PaX marking -${flags}" 132 elog "Fallback PaX marking -${flags}"
133 _pax_list_files elog "$@" 133 _pax_list_files elog "$@"
134 scanelf -Xxz ${flags} "$@" 134 scanelf -Xxz ${flags} "$@"
135 elif [[ ${PAX_MARKINGS} != "none" ]]; then 135 elif [[ ${PAX_MARKINGS} != "none" ]]; then
136 # Out of options! 136 # Out of options!
137 failures="$*" 137 failures="$*"

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.20