/[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.4 Revision 1.5
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.4 2006/12/02 11:33:04 kevquinn Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/pax-utils.eclass,v 1.5 2006/12/02 12:24:50 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
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 einfo "Legacy EI PaX marking -${flags}"
92 _pax_list_files echo "$@" 92 _pax_list_files elog "$@"
93 for f in "$@"; do 93 for f in "$@"; do
94 /sbin/chpax -${flags} "${f}" && continue 94 chpax -${flags} "${f}" && continue
95 fail=1 95 fail=1
96 failures="${failures} ${f}" 96 failures="${failures} ${f}"
97 done 97 done
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 einfo "PT PaX marking -${flags}"
104 _pax_list_files echo "$@" 104 _pax_list_files elog "$@"
105 for f in "$@"; do 105 for f in "$@"; do
106 /sbin/paxctl -q${flags} "${f}" && continue 106 paxctl -q${flags} "${f}" && continue
107 /sbin/paxctl -qc${flags} "${f}" && continue 107 paxctl -qc${flags} "${f}" && continue
108 /sbin/paxctl -qC${flags} "${f}" && continue 108 paxctl -qC${flags} "${f}" && continue
109 fail=1 109 fail=1
110 failures="${failures} ${f}" 110 failures="${failures} ${f}"
111 done 111 done
112 elif type -p scanelf > /dev/null && [[ -n ${PAX_MARKINGS} ]]; then 112 elif type -p scanelf > /dev/null && [[ ${PAX_MARKINGS} != "none" ]]; then
113 # Try scanelf, Gentoo's swiss-army knife ELF utility 113 # Try scanelf, Gentoo's swiss-army knife ELF utility
114 # Currently this sets EI and PT if it can, no option to 114 # Currently this sets EI and PT if it can, no option to
115 # control what it does. 115 # control what it does.
116 einfo "Fallback PaX marking -${flags}" 116 einfo "Fallback PaX marking -${flags}"
117 _pax_list_files echo "$@" 117 _pax_list_files elog "$@"
118 /usr/bin/scanelf -Xxz ${flags} "$@" 118 scanelf -Xxz ${flags} "$@"
119 else 119 elif [[ ${PAX_MARKINGS} != "none" ]]; then
120 # Out of options! 120 # Out of options!
121 failures="$*" 121 failures="$*"
122 fail=1 122 fail=1
123 fi 123 fi
124 if [[ ${fail} == 1 ]]; then 124 if [[ ${fail} == 1 ]]; then

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20