-
Notifications
You must be signed in to change notification settings - Fork 175
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
Fix updating of readonly files #320
Fix updating of readonly files #320
Conversation
@rasa - Are you sure this is actually a problem? I'm fairly sure that Can you explain where you are seeing this problem? Is it on a specific platform? I'm curious if you could do a test like this there:
|
You're right. It's specific to this environment. It's a WSL instance where
Fails in both WSL v1 and v2. Given that it's an environment specific issue, I'd understand if you'd want to reject it, but other setups may see this issue too. Perhaps network mounts via samba or NFS or sshfs or ...? Too edge case? |
No, I don't think it's a problem to include. I can't see how it will cause any problems. I really wanted to understand the issue, because I couldn't see it myself. Thanks. |
@rasa - I made an adjustment to this so the read-only state doesn't need to be saved and preserved... Instead the perms are copied onto the already moved output file after the move. Forcing the output to be writable before the move is still done. The change is in branch |
@TheLocehiliosan Sorry for the delay. I tested the |
* Use `git clone` directly during clone (#289, #323) * Fix compatibility bug with Git completions (#318, #321) * Support relative paths for --yadm-* and -w (#301) * Improve parsing of if-statement in default template (#303) * Read files without running cat in subshells (#317) * Improve portability of updating read-only files (#320) * Various code improvements (#306, #307, #311)
* Use `git clone` directly during clone (#289, #323) * Fix compatibility bug with Git completions (#318, #321) * Support relative paths for --yadm-* and -w (#301) * Improve parsing of if-statement in default template (#303) * Read files without running cat in subshells (#317) * Improve portability of updating read-only files (#320) * Various code improvements (#306, #307, #311)
What does this PR do?
Allows
yadm alt
to update files that are read-only (mode 400 / -r--------).What issues does this PR fix or reference?
None.
Previous Behavior
google-authenticator stores its configuration in
~/.google_authenticator
. Each time the user logs in, the file is set to mode 400, even if the file is 600.yadm alt
would then fail to move the$temp_file
to the$output
file, as the$output
file was read-only.New Behavior
yadm alt
can successfully update read-only files.Have tests been written for this change?
No, but all current tests pass.
Have these commits been signed with GnuPG?
Yes.
Please review yadm's Contributing Guide for best practices.