summaryrefslogtreecommitdiff
path: root/tests/bad-filenames
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bad-filenames')
-rw-r--r--tests/bad-filenames11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/bad-filenames b/tests/bad-filenames
index 5b4f205..121cfda 100644
--- a/tests/bad-filenames
+++ b/tests/bad-filenames
@@ -42,6 +42,17 @@ No file to patch. Skipping patch.
status: 1
EOF
+for dir in "$TMPDIR" "$TMP" "$TEMP" "/tmp"; do
+ if test -n "$dir"; then
+ filename=$dir/patch-$$-$RANDOM
+ break
+ fi
+done
+
+check 'emit_patch $filename | (cd / && patch -f -p0 --dry-run) || echo status: $?' <<EOF
+patching file $filename
+EOF
+
check 'emit_patch a/../z | patch -f -p0 --dry-run || echo status: $?' <<EOF
Ignoring potentially dangerous file name a/../z
can't find file to patch at input line 3