| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 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.12 2011/07/02 17:03:51 blueness Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/pax-utils.eclass,v 1.13 2011/07/03 21:17:10 blueness Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: pax-utils.eclass |
5 | # @ECLASS: pax-utils.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Maintained by |
7 | # Maintained by |
| 8 | # The Gentoo Linux Hardened Team <hardened@gentoo.org> |
8 | # The Gentoo Linux Hardened Team <hardened@gentoo.org> |
| … | |
… | |
| 22 | # contain either "PT" or "none". If PAX_MARKINGS is set to "PT", and the |
22 | # contain either "PT" or "none". If PAX_MARKINGS is set to "PT", and the |
| 23 | # necessary utility is installed, the PT_PAX_FLAGS markings will be made. If |
23 | # necessary utility is installed, the PT_PAX_FLAGS markings will be made. If |
| 24 | # PAX_MARKINGS is set to "none", no markings will be made. |
24 | # PAX_MARKINGS is set to "none", no markings will be made. |
| 25 | |
25 | |
| 26 | inherit eutils |
26 | inherit eutils |
| 27 | |
|
|
| 28 | IUSE="hardened" |
|
|
| 29 | |
|
|
| 30 | DEPEND="hardened? ( app-misc/pax-utils |
|
|
| 31 | sys-apps/paxctl )" |
|
|
| 32 | |
27 | |
| 33 | # Default to PT markings. |
28 | # Default to PT markings. |
| 34 | PAX_MARKINGS=${PAX_MARKINGS:="PT"} |
29 | PAX_MARKINGS=${PAX_MARKINGS:="PT"} |
| 35 | |
30 | |
| 36 | # @FUNCTION: pax-mark |
31 | # @FUNCTION: pax-mark |
| … | |
… | |
| 54 | # |
49 | # |
| 55 | # Please confirm any relaxation of restrictions with the Gentoo Hardened team. |
50 | # Please confirm any relaxation of restrictions with the Gentoo Hardened team. |
| 56 | # Either ask on the gentoo-hardened mailing list, or CC/assign hardened@g.o on |
51 | # Either ask on the gentoo-hardened mailing list, or CC/assign hardened@g.o on |
| 57 | # the bug report. |
52 | # the bug report. |
| 58 | pax-mark() { |
53 | pax-mark() { |
| 59 | # It doesn't make sense to pax-mark on non-hardened systems |
|
|
| 60 | # so we'll just do nothing. |
|
|
| 61 | use hardened || return 0; |
|
|
| 62 | |
|
|
| 63 | local f flags fail=0 failures="" zero_load_alignment |
54 | local f flags fail=0 failures="" zero_load_alignment |
| 64 | # Ignore '-' characters - in particular so that it doesn't matter if |
55 | # Ignore '-' characters - in particular so that it doesn't matter if |
| 65 | # the caller prefixes with - |
56 | # the caller prefixes with - |
| 66 | flags=${1//-} |
57 | flags=${1//-} |
| 67 | shift |
58 | shift |