djherbis / keepass-pinentry

Keepass Plugin for gpg-agent pinentry
MIT License
29 stars 10 forks source link

Is this compatible with Linux/Mono? #7

Open ThePirate42 opened 1 year ago

ThePirate42 commented 1 year ago

It isn't clear from the readme.

djherbis commented 1 year ago

@ThePirate42 I haven't tested with mono so I don't know but you're welcome to try and let us know!

ThePirate42 commented 8 months ago

When I try to use the plugin (built locally), keepass says that the plugin isn't compatible with the current keepass version (2.54). Is this a Linux only problem?

ThePirate42 commented 8 months ago

immagine

When I run with --debug, this is the error message (sorry for the screenshot, the text cannot be copied).

ThePirate42 commented 8 months ago

Running keepass with sudo (administrator rights) makes it work (but isn't an acceptable workaround, GUI applications should never run as administrator on linux unless they are developed for it).

This may be relevant: https://stackoverflow.com/questions/10254954/mono-linux-socket-denied

djherbis commented 8 months ago

Id try switching the env var STDPROXY_PORT above 1024 (default is 500). I think ports below 1024 are privileged process only on Linux.

ThePirate42 commented 8 months ago

I found the issue: opening a port with a number under 1024 on an unix system requires root access by default, which means the 500 default is not ok. Could you consider using an higher port as a default? Possibly not a round number, to avoid collisions.

BTW, I managed to open keepass with the plugin loaded without errors! I still haven't tested if it actually works.

EDIT: I see now that you had already replied 😅

ThePirate42 commented 8 months ago

When I try to use it, I get this 😭: immagine

ThePirate42 commented 8 months ago

I think this is the fault of this mono bug. I'll try to generate a certificate with the legacy option.

ThePirate42 commented 8 months ago

It works! If it's ok with you, I wanted to make a pull request with a unix version of createcert.cmd (and maybe an update to the readme)

Doing the whole install.cmd could be more complicated, because there isn't a setx equivalent on linux, and adding user environment variables (not system wide) programmatically isn't a very common practice. What do you think?

djherbis commented 8 months ago

Sounds good to me, thanks for looking into this!