Skip to content

Commit

Permalink
Fix install-pn-test-server for recent Git security issues (#2323)
Browse files Browse the repository at this point in the history
A recent-ish security update (git 1:2.39.5-0+deb12u1) broke the ability
to clone a local directory that is owned by another user. This broke
`ssh-install-pn-test-server`:

```
Cloning into bare repository 'physionet-build.git'...
fatal: detected dubious ownership in repository at '/tmp/physionet-tmp.git'
To add an exception for this directory, call:

	git config --global --add safe.directory /tmp/physionet-tmp.git
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```
  • Loading branch information
bemoody authored Jan 22, 2025
2 parents a107763 + d71e3a2 commit 1f40829
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions deploy/test-server/install-pn-test-server
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ apt-get install -y \
################################################################

if [ -n "$WFDB_REPOSITORY" ]; then
if [ -d "$WFDB_REPOSITORY" ]; then
git config --global --add safe.directory "$WFDB_REPOSITORY"
fi
git clone "$WFDB_REPOSITORY" $HOME/wfdb
(
cd $HOME/wfdb
Expand All @@ -70,6 +73,9 @@ if [ -n "$WFDB_REPOSITORY" ]; then
make -j$(nproc) -Cdata install
)
if [ -n "$LIGHTWAVE_REPOSITORY" ]; then
if [ -d "$LIGHTWAVE_REPOSITORY" ]; then
git config --global --add safe.directory "$LIGHTWAVE_REPOSITORY"
fi
git clone "$LIGHTWAVE_REPOSITORY" $HOME/lightwave
(
cd $HOME/lightwave
Expand Down Expand Up @@ -119,6 +125,9 @@ su pn -c '
virtualenv --no-download -ppython3 /physionet/python-env/physionet
. /physionet/python-env/physionet/bin/activate
if [ -d "$REPOSITORY" ]; then
git config --global --add safe.directory "$REPOSITORY"
fi
git clone --bare "$REPOSITORY" physionet-build.git
cd /physionet/physionet-build.git
GIT_WORK_TREE=/physionet/physionet-build git checkout --force "$REVISION_ID"
Expand Down

0 comments on commit 1f40829

Please sign in to comment.