mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-04 16:25:10 +00:00
tests: fix profile name when wrapper is specified
When settest was called with two parameters, one for the test name and
the other for the test wrapper/binary, the profile created with
genprofile would show the test name, causing an error if the file
didn't exist.
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
(cherry picked from commit b4adff2ce0
)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
committed by
John Johansen
parent
e9858c0c43
commit
4e46df38cf
@@ -456,7 +456,7 @@ fi
|
|||||||
|
|
||||||
while /bin/true
|
while /bin/true
|
||||||
do
|
do
|
||||||
imagename=$test
|
imagename=$testbin
|
||||||
|
|
||||||
# image/subhat allows overriding of the default
|
# image/subhat allows overriding of the default
|
||||||
# imagename which is based on the testname
|
# imagename which is based on the testname
|
||||||
@@ -632,6 +632,11 @@ settest()
|
|||||||
fatalerror "settest, illegal usage"
|
fatalerror "settest, illegal usage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# store testbin name from testexec so that testexec represents
|
||||||
|
# what will be executed - allowing for a change of username
|
||||||
|
# with sudo -u
|
||||||
|
testbin=$testexec
|
||||||
|
|
||||||
if [ ! -z "$username" ]
|
if [ ! -z "$username" ]
|
||||||
then
|
then
|
||||||
testexec="sudo -u $username $testexec"
|
testexec="sudo -u $username $testexec"
|
||||||
|
Reference in New Issue
Block a user