summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/files/names/files-tar-traps/build-spec/pre-build
diff options
context:
space:
mode:
Diffstat (limited to 't/recipes/checks/files/names/files-tar-traps/build-spec/pre-build')
-rwxr-xr-xt/recipes/checks/files/names/files-tar-traps/build-spec/pre-build28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/recipes/checks/files/names/files-tar-traps/build-spec/pre-build b/t/recipes/checks/files/names/files-tar-traps/build-spec/pre-build
new file mode 100755
index 0000000..bbc0e83
--- /dev/null
+++ b/t/recipes/checks/files/names/files-tar-traps/build-spec/pre-build
@@ -0,0 +1,28 @@
+#!/bin/sh
+dir="$1/strangename"
+mkdir -p "$dir"
+
+# All file names are quoted twice, once for the shell and once for tar
+# (-T)
+
+# File named <quote><backslash><space>
+echo "foo" > "$dir/'\\ "
+# File named <backslash>
+echo "bar" > "$dir/\\"
+# File named <backslash><backslash>
+# - causes md5sums-lists-nonexistent-file
+echo "bar" > "$dir/\\\\"
+
+# File named a<backslash><backslash>b
+# - causes md5sums-lists-nonexistent-file
+echo "bar" > "$dir/a\\\\b"
+
+# Symlink to file named a<backslash><backslash>b
+ln -s 'a\\b' "$dir/link-to-weird-file1"
+
+# Because the above is not insane enough...
+# If Lintian gets this wrong, it will become an
+# "unsafe-symlink".
+mkdir -p "$dir/\\.\\./\\.\\."
+echo "golf" > "$dir/\\.\\./\\.\\./\\.\\."
+ln -s '\.\./\.\./\.\.' "$dir/some-file"