BUG: https://bugzilla.samba.org/show_bug.cgi?id=15360
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
b5a66840e3057cbff85fe6cd231310c4a9cfb34b)
failed=0
+TMPDIR=${PREFIX_ABS}/$(basename "${0}")
+mkdir -p "${TMPDIR}" || exit 1
+cd "${TMPDIR}" || exit 1
+
#
# Cleanup function.
#
{
filename1="$1"
expected_error="$2"
- tmpfile=$PREFIX/smbclient_interactive_prompt_commands
+ tmpfile=${TMPDIR}/smbclient_interactive_prompt_commands
cat >"$tmpfile" <<EOF
get $filename1 got_file
quit
{
filename="$1.$$"
expected_error="$2"
- tmpfile=$PREFIX/smbclient_interactive_prompt_commands
+ tmpfile=${TMPDIR}/smbclient_interactive_prompt_commands
cat >"$tmpfile" <<EOF
put $tmpfile $filename
quit
do_cleanup
+cd "${PREFIX_ABS}" && rm -rf ${TMPDIR}
+
exit "$failed"