Skip to content
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 kdbx nuke #280

Closed
wants to merge 2 commits into from
Closed

Fix kdbx nuke #280

wants to merge 2 commits into from

Conversation

KeyWeeUsr
Copy link
Contributor

I was trying to reproduce the #266 issue with Google Drive + Gnome but I couldn't find any relevant seek() that would break it within the construct library nor any file from the gvfs behaved strangely. If anything, the issue might need a better traceback because self.build_stream(...) calls further and it's still Python, so it shouldn't stop somewhere in the middle of the call stack if it's able to produce an OSError.

While the #266 isn't strictly a PyKeePass issue (and it's not reproducible clearly), I think leaving a free hand for the package to break the DB isn't really useful either. On top of that, some special files on Linux are actually sockets which may also happen to be used, thus it also makes sense to allow output to a socket.

# "server" / socket dumping the content
nc -lU socket.kdbx > file.kdbx
# client
from pykeepass import create_database
db = create_database("hello.kdbx")  # or open an existing one
db.save("socket.kdbx")
# socket then receives the bytes and dumps them to the "file.kdbx"

Closes #266

@Evidlo
Copy link
Member

Evidlo commented Jul 5, 2022

Sorry I let this languish. I implemented safe saving using BytesIO, which also means that we don't seek on the write medium.

@Evidlo Evidlo closed this Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error parsing path on a virtual filesystem
2 participants