From badaa27d5febffd453f89d2f1a3bd3f5338bfef0 Mon Sep 17 00:00:00 2001 From: Max Rees Date: Fri, 13 Sep 2019 18:46:39 -0500 Subject: system/paxmark: move to legacy/ --- legacy/paxmark/APKBUILD | 23 +++++++++++++++++++++++ legacy/paxmark/paxmark | 33 +++++++++++++++++++++++++++++++++ system/paxmark/APKBUILD | 23 ----------------------- system/paxmark/paxmark | 33 --------------------------------- 4 files changed, 56 insertions(+), 56 deletions(-) create mode 100644 legacy/paxmark/APKBUILD create mode 100644 legacy/paxmark/paxmark delete mode 100644 system/paxmark/APKBUILD delete mode 100644 system/paxmark/paxmark diff --git a/legacy/paxmark/APKBUILD b/legacy/paxmark/APKBUILD new file mode 100644 index 000000000..3c9c69400 --- /dev/null +++ b/legacy/paxmark/APKBUILD @@ -0,0 +1,23 @@ +# Contributor: Timo Teräs +# Maintainer: A. Wilcox +pkgname=paxmark +pkgver=0.11 +pkgrel=1 +pkgdesc="Manage PaX marking of executables" +url="https://alpinelinux.org" +arch="noarch" +options="!check" +license="GPL-2.0-only" +depends="attr bash" +makedepends="" +install="" +subpackages="" +source="paxmark" + +package() { + mkdir -p "$pkgdir"/usr/sbin + install -m755 "$srcdir"/paxmark "$pkgdir"/usr/sbin + ln -s paxmark "$pkgdir"/usr/sbin/paxmark.sh +} + +sha512sums="ed904790bfa6c86e216e2c8c1ed8fb1f997b7d1a55f997459655e402d8eec6447095709e38472cf909ea4d03e623e3e0eeddc0da57378901fe9d18d8c14b68d8 paxmark" diff --git a/legacy/paxmark/paxmark b/legacy/paxmark/paxmark new file mode 100644 index 000000000..87a84f4f7 --- /dev/null +++ b/legacy/paxmark/paxmark @@ -0,0 +1,33 @@ +#!/bin/bash + +ret=0 +flags="${1//[!zPpEeMmRrSs]}" +[ -n "${flags}" ] || exit 0 +shift + +# Create XATTR_PAX marking using attr +xval="" +[ "${flags//[!P]}" ] && xval="${xval}P" +[ "${flags//[!p]}" -a -z "${flags//[!P]}" ] && xval="${xval}p" +[ "${flags//[!E]}" ] && xval="${xval}E" +[ "${flags//[!e]}" -a -z "${flags//[!E]}" ] && xval="${xval}e" +[ -z "${flags//[!zEe]}" ] && xval="${xval}e" +[ "${flags//[!M]}" ] && xval="${xval}M" +[ "${flags//[!m]}" -a -z "${flags//[!M]}" ] && xval="${xval}m" +[ "${flags//[!R]}" ] && xval="${xval}R" +[ "${flags//[!r]}" -a -z "${flags//[!R]}" ] && xval="${xval}r" +[ "${flags//[!S]}" ] && xval="${xval}S" +[ "${flags//[!s]}" -a -z "${flags//[!S]}" ] && xval="${xval}s" + +for f in "$@"; do + if [ -n "FAKEROOTKEY" ]; then + # fakeroot does not set xattr's on disk. + # explicitly do that, because the marked binary might + # be executed next during install. + LD_PRELOAD="" FAKEROOTKEY="" attr -q -s pax.flags -V "${xval}" "${f}" >/dev/null || ret=1 + fi + attr -q -s pax.flags -V "${xval}" "${f}" >/dev/null || ret=1 +done + +exit $ret + diff --git a/system/paxmark/APKBUILD b/system/paxmark/APKBUILD deleted file mode 100644 index 3c9c69400..000000000 --- a/system/paxmark/APKBUILD +++ /dev/null @@ -1,23 +0,0 @@ -# Contributor: Timo Teräs -# Maintainer: A. Wilcox -pkgname=paxmark -pkgver=0.11 -pkgrel=1 -pkgdesc="Manage PaX marking of executables" -url="https://alpinelinux.org" -arch="noarch" -options="!check" -license="GPL-2.0-only" -depends="attr bash" -makedepends="" -install="" -subpackages="" -source="paxmark" - -package() { - mkdir -p "$pkgdir"/usr/sbin - install -m755 "$srcdir"/paxmark "$pkgdir"/usr/sbin - ln -s paxmark "$pkgdir"/usr/sbin/paxmark.sh -} - -sha512sums="ed904790bfa6c86e216e2c8c1ed8fb1f997b7d1a55f997459655e402d8eec6447095709e38472cf909ea4d03e623e3e0eeddc0da57378901fe9d18d8c14b68d8 paxmark" diff --git a/system/paxmark/paxmark b/system/paxmark/paxmark deleted file mode 100644 index 87a84f4f7..000000000 --- a/system/paxmark/paxmark +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -ret=0 -flags="${1//[!zPpEeMmRrSs]}" -[ -n "${flags}" ] || exit 0 -shift - -# Create XATTR_PAX marking using attr -xval="" -[ "${flags//[!P]}" ] && xval="${xval}P" -[ "${flags//[!p]}" -a -z "${flags//[!P]}" ] && xval="${xval}p" -[ "${flags//[!E]}" ] && xval="${xval}E" -[ "${flags//[!e]}" -a -z "${flags//[!E]}" ] && xval="${xval}e" -[ -z "${flags//[!zEe]}" ] && xval="${xval}e" -[ "${flags//[!M]}" ] && xval="${xval}M" -[ "${flags//[!m]}" -a -z "${flags//[!M]}" ] && xval="${xval}m" -[ "${flags//[!R]}" ] && xval="${xval}R" -[ "${flags//[!r]}" -a -z "${flags//[!R]}" ] && xval="${xval}r" -[ "${flags//[!S]}" ] && xval="${xval}S" -[ "${flags//[!s]}" -a -z "${flags//[!S]}" ] && xval="${xval}s" - -for f in "$@"; do - if [ -n "FAKEROOTKEY" ]; then - # fakeroot does not set xattr's on disk. - # explicitly do that, because the marked binary might - # be executed next during install. - LD_PRELOAD="" FAKEROOTKEY="" attr -q -s pax.flags -V "${xval}" "${f}" >/dev/null || ret=1 - fi - attr -q -s pax.flags -V "${xval}" "${f}" >/dev/null || ret=1 -done - -exit $ret - -- cgit v1.2.3-70-g09d2