From a07de3f095094e07a82ba9b71480e2efae60fa00 Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Thu, 27 Aug 2020 14:43:09 -0700 Subject: [PATCH] regression tests/prologue: adjust sed to not use ~ as regex separators prologue.inc:settest() in same cases invokes a sed command that uses '~' as a pattern separator, on things that can contain filesystem paths. However, in the debian/ubuntu world, '~' can be used in version strings, particularly for pre-release versions, and when this happens and the version is embedded in the path, the sed command breaks because of the extraneous separator. Fix this by using '#' as a separator, which has the benefit of being considered a comment if accidentally interpreted by a shell. Signed-off-by: Steve Beattie Acked-by: Christian Boltz MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/599 (cherry picked from commit efc6590409846114f729618a5ff011ab0f836342) Signed-off-by: John Johansen --- tests/regression/apparmor/prologue.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression/apparmor/prologue.inc b/tests/regression/apparmor/prologue.inc index bcd2a54c8..76f0d8da8 100755 --- a/tests/regression/apparmor/prologue.inc +++ b/tests/regression/apparmor/prologue.inc @@ -578,7 +578,7 @@ settest() elif [ $# -eq 2 ] then test=$bin/$1 - testexec=`echo $2 | sed "s~{}~$test~"` + testexec=`echo $2 | sed "s#{}#$test#"` else fatalerror "settest, illegal usage" fi