From b88d85414facf52baa04e939d19028714ec987f8 Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Wed, 12 Dec 2012 17:28:22 +0000 Subject: src/paxctl-ng.c: do not use '-' when setting null XATTR PAX flags There was a bug in the implementation of XATTR PAX flags where it was assumed that '-' would be ignored in kernel. However, anything other than PpEeMmRrSs is considered invalid and results in a fail. See pax_parse_xattr_pax() in fs/binfmt_elf.c for a pax patched kernel. The pxtpax test was updated as well. X-Gentoo-Bug: 446518 X-Gentoo-Bug-URL: https://bugs.gentoo.org/446518 --- tests/pxtpax/dotest.sh | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'tests') diff --git a/tests/pxtpax/dotest.sh b/tests/pxtpax/dotest.sh index 1003d0a..4e7c371 100755 --- a/tests/pxtpax/dotest.sh +++ b/tests/pxtpax/dotest.sh @@ -8,24 +8,33 @@ PAXCTLNG="../../src/paxctl-ng" ${PAXCTLNG} -cv ${DAEMON} 2>&1 1>/dev/null -echo "xattr process" -for pf in "p" "P"; do - for ef in "e" "E"; do - for mf in "m" "M"; do - for rf in "r" "R"; do - for sf in "s" "S"; do - flags="${pf}${ef}${mf}${rf}${sf}" - echo -n ${flags} " " - ${PAXCTLNG} -"${flags}" ${DAEMON} 2>&1 1>/dev/null +for pf in "p" "P" "-"; do + for ef in "e" "E" "-"; do + for mf in "m" "M" "-"; do + for rf in "r" "R" "-"; do + for sf in "s" "S" "-"; do + + pflags="${pf}${ef}${mf}${rf}${sf}" + echo "SET TO :" ${pflags} + + flags="${pf/-/Pp}${ef/-/Ee}${mf/-/Mm}${rf/-/Rr}${sf/-/Ss}" + ${PAXCTLNG} -"${flags}" ${DAEMON} >/dev/null 2>&1 + + sflags=$(${PAXCTLNG} -v ${DAEMON}) + sflags=$(echo ${sflags} | awk '{print $3}') + echo "GOT :" ${sflags} + ${INITSH} start if [ -f "${PIDFILE}" ] then rflags=$(cat /proc/$(cat ${PIDFILE})/status | grep ^PaX | awk '{ print $2 }') - echo -n ${rflags} + echo -n "RUNNING: "${rflags} ${INITSH} stop else - echo -n "no daemon" + echo -n "RUNNING: no daemon" fi + + echo echo done done -- cgit v1.2.3-65-gdbad