# Bug when doing make test using root user

2 messages from 2015-06-12 to 2015-06-12. Participants: Jean-Yves LENHOF, Paul Tan.
Thread: https://gitlist.dev/t/39610

## Jean-Yves LENHOF, 2015-06-12 09:43

Subject: Bug when doing make test using root user
Message-ID: <28c940a4a806c8da130403068cf4c0ef@lenhof.eu.org>
URL: https://gitlist.dev/e/28c940a4a806c8da130403068cf4c0ef%40lenhof.eu.org

```
Hi,

I tried to compile git 2.4.3 using root on a server. It failed on test 
41 of t0302-credential-store.sh
In fact even if we remove read access on a directory, root still can 
acces this directory.
Using a not privilegied user make the test work.
Perhaps the test should be adapted to this corner case.
Trace below.

Have fun,

JYL

*** t0302-credential-store.sh ***
ok 1 - helper (store) has no existing data
ok 2 - helper (store) stores password
ok 3 - helper (store) can retrieve password
ok 4 - helper (store) requires matching protocol
ok 5 - helper (store) requires matching host
ok 6 - helper (store) requires matching username
ok 7 - helper (store) requires matching path
ok 8 - helper (store) can forget host
ok 9 - helper (store) can store multiple users
ok 10 - helper (store) can forget user
ok 11 - helper (store) remembers other user
ok 12 - when xdg file does not exist, xdg file not created
ok 13 - setup xdg file
ok 14 - helper (store) has no existing data
ok 15 - helper (store) stores password
ok 16 - helper (store) can retrieve password
ok 17 - helper (store) requires matching protocol
ok 18 - helper (store) requires matching host
ok 19 - helper (store) requires matching username
ok 20 - helper (store) requires matching path
ok 21 - helper (store) can forget host
ok 22 - helper (store) can store multiple users
ok 23 - helper (store) can forget user
ok 24 - helper (store) remembers other user
ok 25 - when xdg file exists, home file not created
ok 26 - setup custom xdg file
ok 27 - helper (store) has no existing data
ok 28 - helper (store) stores password
ok 29 - helper (store) can retrieve password
ok 30 - helper (store) requires matching protocol
ok 31 - helper (store) requires matching host
ok 32 - helper (store) requires matching username
ok 33 - helper (store) requires matching path
ok 34 - helper (store) can forget host
ok 35 - helper (store) can store multiple users
ok 36 - helper (store) can forget user
ok 37 - helper (store) remembers other user
ok 38 - if custom xdg file exists, home and xdg files not created
ok 39 - get: use home file if both home and xdg files have matches
ok 40 - get: use xdg file if home file has no matches
not ok 41 - get: use xdg file if home file is unreadable
#
#               echo "https://home-user:home-pass@example.com" 
 >"$HOME/.git-credentials" &&
#               chmod -r "$HOME/.git-credentials" &&
#               mkdir -p "$HOME/.config/git" &&
#               echo "https://xdg-user:xdg-pass@example.com" 
 >"$HOME/.config/git/credentials" &&
#               check fill store <<-\EOF
#               protocol=https
#               host=example.com
#               --
#               protocol=https
#               host=example.com
#               username=xdg-user
#               password=xdg-pass
#               --
#               EOF
#
ok 42 - store: if both xdg and home files exist, only store in home file
ok 43 - erase: erase matching credentials from both xdg and home files
# failed 1 among 43 test(s)
1..43
make[2]: *** [t0302-credential-store.sh] Error 1
make[2]: Leaving directory `/root/git-2.4.3/t'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/root/git-2.4.3/t'
make: *** [test] Error 2

```

## Paul Tan, 2015-06-12 13:17

Subject: Re: Bug when doing make test using root user
Message-ID: <CACRoPnSeVWpj0-=Ei39UsKfe7m7UwkRFChkb7KAGoZRoZs23rw@mail.gmail.com>
URL: https://gitlist.dev/e/CACRoPnSeVWpj0-%3DEi39UsKfe7m7UwkRFChkb7KAGoZRoZs23rw%40mail.gmail.com
In-Reply-To: <28c940a4a806c8da130403068cf4c0ef@lenhof.eu.org>

```
On Fri, Jun 12, 2015 at 5:43 PM, Jean-Yves LENHOF
<jean-yves@lenhof.eu.org> wrote:
> Hi,
>
> I tried to compile git 2.4.3 using root on a server. It failed on test 41 of
> t0302-credential-store.sh
> In fact even if we remove read access on a directory, root still can acces
> this directory.
> Using a not privilegied user make the test work.
> Perhaps the test should be adapted to this corner case.
> Trace below.

Right, the test should have the SANITY prereq.

Thanks for reporting.

Regards,
Paul

```
