update duplicateargs to copy args properly (#617)
* update duplicateargs to copy args properly * add bash test for scp printf specifiers * retrigger appveyor
This commit is contained in:
parent
0e5150318b
commit
6dbc6f637f
2
misc.c
2
misc.c
|
@ -1149,7 +1149,7 @@ duplicateargs(arglist *dest, arglist *source)
|
|||
|
||||
if (source->list != NULL) {
|
||||
for (int i = 0; i < source->num; i++) {
|
||||
addargs(dest, source->list[i]);
|
||||
addargs(dest, "%s", source->list[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,6 +105,16 @@ for mode in scp sftp ; do
|
|||
$SCP "${scpopts[@]}" *metachar* ${DIR2} 2>&1 2>/dev/null; \
|
||||
[ ! -f metachartest ] ) || fail "shell metacharacters"
|
||||
|
||||
if test $mode = scp ; then
|
||||
verbose "$tag: input args & printf check"
|
||||
scpclean
|
||||
cp ${DATA} ${COPY}
|
||||
$SCP "${scpopts[@]}" -vvv -o '"%h %p"' ${COPY} somehost:${DIR} 2>&1 | tee scp_printf_test.txt
|
||||
# relies on debug log statement, specifically from "debug3: spawning..."
|
||||
[[ " $( cat "scp_printf_test.txt" ) " =~ "%h %p" ]] || fail "input args & printf check failed"
|
||||
rm -f scp_printf_test.txt
|
||||
fi
|
||||
|
||||
if [ ! -z "$SUDO" ]; then
|
||||
verbose "$tag: skipped file after scp -p with failed chown+utimes"
|
||||
scpclean
|
||||
|
|
Loading…
Reference in New Issue