The Samba-Bugzilla – Bug 13085
Prevent escape sequence evaluation in test_give_owner.sh
Last modified: 2017-10-13 12:45:50 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"'