-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: compile.sh
amends user's global git config; fails if it can't
#7907
Comments
Hey @kjkent !Looks like it's your first time interacting with Armbian here on GitHub. Welcome and thank you for taking the time to report an issue ❤️. Don't forget to star ⭐ the repo. |
Jira ticket: AR-2624 |
compile.sh
amends user's global git config; fails if it can't
Indeed. This is known dirty workaround, but have to scratch my head to understand why we had to use this. IIRC it was due to some changes introduced by Git client. We tried to address this several times, but then if fail out of urgent things. |
Makes sense. Repos not being owned by the current user might be more of an issue on Windows, as that appeared to be a common thread when I searched this. It's not an issue I've encountered on Linux (as far as I remember!) |
git.sh currently fails because git is usually called from outside the git directory it is supposed to work on. Before ccde662 git config was called with --global which was wrong (armbian#7907) but worked from any directory. Now git config is called correctly with --local but that only works when cd'ing into the git directory first.
The Armbian project should not touch a user's git configuration outside of project folders. This commit fixes that. The current solution is still quite a bit of a hack as we are opting out of a safety feature on the users' behalf without their consent. As of now, we add the full and absolute path to the list of safe directories. If the directory is moved, it will need to be readded. It might be preferrable to use '.' instead for the relative path. If we can limit opting out of the entire working directory but use only a subset of subdirectories (like ./build or ./sources), that would be an improvement which ought to be made in the future. Closing armbian#7907 AR-2624
What happened?
Running
./compile
fails if the user's global git config is a symlink to a read-only filesystem, as it usually is in NixOS. I imagine this holds true for other situations in which a user's git config is read-only to that user.Log:
Here's the relevant code:
There is that call to
alert
, but, as seen in the output above, there's no console output other than the error.I'm not knowledgeable about the build process enough to understand why the compile script, for a Dockerised build, needs to access a git config file in a parent directory either not as me, or not owned by me; however, silently altering global git config in order to bypass a CVE-related security feature specifically to prevent this does pose the question of its appropriateness. It feels like sketchy behaviour, even when it's for benign reasons as I'm sure it is here.
(As an aside, the shell.nix in the repo root suggests NixOS compatibility, but this and (moreso) #7052) are blockers for usage on these systems -- though non-NixOS systems using Nix as a package manager would probably work fine.
How to reproduce?
./compile
in repo directory.Branch
v25.02
On which host OS are you running the build script and observing this problem?
NixOS 24.11
Are you building on Windows WSL2?
Relevant log URL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: