-
-
Notifications
You must be signed in to change notification settings - Fork 340
Interaction between 'safe.directory' and trust level and remotes. #1912
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
Comments
Thanks a lot for bringing this to my attention. Interestingly just a couple of days ago I thought about this for no apparent reason and I wondered the same - does safeDirectories affect the current implementation in terms of trust? And even though something is implemented in that regard (I'd have to check for details), I don't think that configuration files are affected enough, or it's a bug. I put this on my list, but it's long and any help is appreciated. |
This means that repo-local configuration that is considered safe, ideally with `safe.directory=safe/dir/*` notation, will be usable for sensitive operations.
Even though this is fixed, I'd really like some help with figuring out a way to test this, on any platform. |
On another note, and something that might require a follow-up: configuration is only marked as safe if either one uses prefix-based directory specifications , like The latter is probably unintuitive if one wants to be euphemistic, or a bug if one wants to be realistic. |
Current behavior 😯
(version 0.70.0)
When a .git is not owned by the current user,
but is listed in safe.directories,
open(repo).remote_names() returns an empty list.
bail_if_untrusted(true) does not seem to make a difference.
See jj-vcs/jj#6155
Expected behavior 🤔
If the directory is in safe.directories, I'd expect it to be trusted.
Or, if gitoxide doesn't read safe.directories, I'd expect it to fail if bail_if_untrusted is set.
Git behavior
Git lists the remotes in both cases.
Steps to reproduce 🕹
git init owned; cd owned; git remote add origin https://github.com/GitoxideLabs/gitoxide; cd ..
git init non_owned; cd non_owned; git remote add origin https://github.com/GitoxideLabs/gitoxide; cd ..; sudo chown -R root non_owned
The text was updated successfully, but these errors were encountered: