The Samba-Bugzilla – Bug 13085
Prevent escape sequence evaluation in test_give_owner.sh
Last modified: 2018-07-07 13:01:30 UTC
/bin/sh on sn-devel-144 is dash which has a XSI compliant echo builtin. That means echo will always interpret escape sequences in strings, eg
$ /bin/sh -c 'echo -n "\a" | hexdump -C'
00000000 07 |.|
There's no way to prevent the echo command from doing this.
In the script test_give_owner.sh echo was used to print an ACE which will contain a DOMAIN\USER substring. If the first character of USER is a valid escape sequence, the resulting string was interpreted as an escape sequence:
$ /bin/sh -c 'echo "FILESERVER\asn"'
The only portable way to print a string without interpreting embedded escape sequences seems to be using printf:
$ /bin/sh -c 'printf "%s\n" "FILESERVER\asn"'
Fixed in 7abf0acef48cb585fa8e5666fd4c27692b9c8ae3.