AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.1k stars 472 forks source link

git-crypt can't handle utf-8 #298

Open Crims-on opened 10 months ago

Crims-on commented 10 months ago

> git-crypt unlock ../key git-crypt: System error: CreateFileA: - 2 - Områden/- 2 - Områden.mdThe system cannot find the path specified.

alerque commented 10 months ago

I use UTF8 both in files and filenames all the time. What exactly led up to this? What system was the locked file created on, what filesystem are you decoding on, etc.?

Crims-on commented 10 months ago

I made a new github for my encrypted files and uploaded them without a problem. I pulled the repo to my second windows computer and attempted to decrypt but got the error above. I have the latest windows release of git-crypt installed, so maybe that's part of the problem

alerque commented 10 months ago

I assume you mean "Git repository" not "github", but whatever...

Was the first machine you used to encrypt and push the repository a similar Windows machine? Can you clone lock/unlock the repository from the first machine? Can you clone it to a different location and unlock also from the first machine?

Crims-on commented 10 months ago

Both are x64 running latest windows, one a laptop and one a pc. I can lock and unlock but haven't tried cloning. Maybe I'll just copy the whole repo over directly

Crims-on commented 10 months ago

I think I found the problem in the function get_file_attributes in commands.cpp the -z argument isn't given which encodes an å for example to "\303\245" that seems to be the problem. I don't know any cpp though so if you would like to help me change it so it does it like in the get_encrypted_files function I'd really appreciate it :)

AGWA commented 9 months ago

Yes, get_file_attributes should indeed be passing the -z option. Good catch!

@Crims-on - if you could create a repo on GitHub containing the problematic filenames so that I can reproduce the problem, it would help me fix the bug.

Crims-on commented 9 months ago

I only got one error because it probably didn't iterate through the rest and that was for "- 2 - Områden- 2 - Områden.md"

maxisam commented 5 months ago

I have a similar issue. Not exactly like this. It only happens when I change certain characters together. It throws error like "git-crypt.exe" smudge' failed 1" However, I just need to avoid that combination, everything works. I have been using this great tool for a while, but this is the first time I see this.