3 test_description
='Ensure that git does not access $HOME'
6 test -n "$(which strace 2>/dev/null)" || {
7 skip_all
='Skipping access validation tests: strace not found'
12 strace true
2>/dev
/null
|| {
13 skip_all
='Skipping access validation tests: strace not functional'
18 test_no_home_access
() {
19 non_existent_path
="/path/to/some/place/that/does/not/possibly/exist"
20 while test -d "$non_existent_path"; do
21 non_existent_path
="$non_existent_path/$(date +%N)"
24 -E HOME
="$non_existent_path" \
25 -E CGIT_CONFIG
="$PWD/cgitrc" \
26 -E QUERY_STRING
="url=$1" \
27 -e access
-f -o strace.out cgit
&&
28 test_must_fail
grep "$non_existent_path" strace.out
31 test_no_home_access_success
() {
32 test_expect_success
"do not access \$HOME: $1" "
33 test_no_home_access '$1'
37 test_no_home_access_success
38 test_no_home_access_success foo
39 test_no_home_access_success foo
/refs
40 test_no_home_access_success foo
/log
41 test_no_home_access_success foo
/tree
42 test_no_home_access_success foo
/tree
/file-1
43 test_no_home_access_success foo
/commit
44 test_no_home_access_success foo
/diff
45 test_no_home_access_success foo
/patch
46 test_no_home_access_success foo
/snapshot
/master.
tar.gz