From: Martin Schwenke Date: Mon, 26 Mar 2018 07:32:57 +0000 (+1100) Subject: ctdb-tests: Don't expand octal escapes in unit test output X-Git-Tag: talloc-2.1.13~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce5116cfb3990de8a088012bee9fd9f94bd21c97;p=thirdparty%2Fsamba.git ctdb-tests: Don't expand octal escapes in unit test output The echo command in dash expands octal escapes in strings by default but the echo command in bash doesn't. Since the behaviour is ill-defined, use printf to handle affected strings. However, ensure that these strings aren't used as format strings. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Tue Mar 27 09:06:14 CEST 2018 on sn-devel-144 --- diff --git a/ctdb/tests/scripts/unit.sh b/ctdb/tests/scripts/unit.sh index 7a0296e5f37..8e72803815d 100644 --- a/ctdb/tests/scripts/unit.sh +++ b/ctdb/tests/scripts/unit.sh @@ -75,7 +75,8 @@ cat <"$_outr" + # Avoid echo, which might expand unintentional escapes + printf '%s\n' "$required_output" >"$_outr" _outf=$(mktemp) - echo "$_fout" >"$_outf" + # Avoid echo, which might expand unintentional escapes + printf '%s\n' "$_fout" >"$_outf" cat <