Skip to content

Commit

Permalink
dkms: Suggest trusting the git directory if version detection failed
Browse files Browse the repository at this point in the history
Git 2.35.2 added a trust model to prevent user scripts and hooks of git
repositories to be executed with elevated privileges by accident. This
prevents the installer from getting the repository version when the
repository was checked out by a non-root user.

This commit adds an error message to suggest trusting the repository
and also links to the bug report for further details.

Fixes: #346
Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed May 26, 2022
1 parent 1c249cf commit 685a3c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ fi
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)

__version() {
git describe --tags --dirty 2>/dev/null || sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION"
git describe --tags --dirty 2>/dev/null || sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION" || {
echo >&2 "ERROR: If you install from a git repository, you may need to run"
echo >&2 "ERROR: sudo git config --global --add safe.directory \$PWD"
echo >&2 "ERROR: to trust this git checkout for the root user."
echo >&2 "ERROR: See https://github.com/atar-axis/xpadneo/issues/346"
exit 3
}
}

__version_lte() {
Expand Down

0 comments on commit 685a3c0

Please sign in to comment.