File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
gix-worktree/tests/fixtures Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 3
3
set -eu
4
4
5
5
repo=" $1 "
6
- bin=' .cargo/bin'
7
6
8
7
git init -- " $repo "
9
8
cd -- " $repo "
10
9
11
- for dir in .a .b .c .d .e .f .g .h .i .j; do
12
- mkdir -- " $dir "
13
- touch -- " $dir /.keep"
14
- done
15
-
16
10
cat > ls.tmp << 'EOF '
17
11
#!/bin/sh
18
12
printf 'Vulnerable!\n'
@@ -21,13 +15,15 @@ exec /bin/ls "$@"
21
15
EOF
22
16
23
17
upward=' ..'
24
- for dir in .a .b .c .d .e .f .g .h .i .j; do
25
- upward=" ../$upward " # So .a has ../.., then .b has ../../.., and so on.
26
- cp -- ls.tmp " $( printf ' %s' " $dir /$upward /$bin /ls" | tr / @) "
18
+ for subdir in .a .b .c .d .e .f .g .h .i .j; do
19
+ upward=" ..@$upward "
20
+ cp -- ls.tmp " $subdir @$upward @.cargo@bin@ls"
21
+ mkdir -- " $subdir "
22
+ touch -- " $subdir /.keep"
27
23
done
28
24
29
25
rm ls.tmp
30
26
git add .
31
- ex -s -c ' %s/@\.\./\/../g' -c ' x ' .git/index # Replace each "@.." with "/..".
27
+ ex -s -c ' %s/@\.\./\/../g' -c ' %s/@\.cargo@bin@ls/\/.cargo\/bin\/ls/g ' -c ' x ' .git/index
32
28
git commit -m ' Initial commit'
33
29
git show --stat
You can’t perform that action at this time.
0 commit comments