IJHack / QtPass

QtPass is a multi-platform GUI for pass, the standard unix password manager.
https://qtpass.org/
GNU General Public License v3.0
1.03k stars 162 forks source link

UI can't handle passwords with periods in their name #520

Closed gardenappl closed 3 years ago

gardenappl commented 4 years ago

Let's say, I have a password named my.account, so it's stored in a file named my.account.gpg. I want to rename it to different-name, so I click on "Rename password".

Tested on Windows 10, without Git or native Pass.

woodenphone commented 4 years ago

I have also encountered this but while adding website passords. "foobar.com" creates a file named "foobar.com" instead of a file named "foobar.com.gpg" Manually changing the file extention of the password file(via windows explorer) to end in .gpg makes the password entry show up in the UI again.

Encountered in Windows 10, QTPass version 1.3.2, manually configured gpg "C:/Program Files (x86)/GnuPG/bin/gpg.exe" git "C:/Program Files/Git/bin/git.exe" pwgen "C:/Program Files (x86)/PWGen/PWGen.exe", native git/gpg option used, password store path "C:/Users/USERNAME/password-store/", "Use git" checked, "Automatically add .gpg-id" checked", "Automatically push/pull" both unchecked.

unor commented 4 years ago

On GNU/Linux (using Pass, but not using Git):

So, on GNU/Linux the issue of the renaming UI is the same as described above for Windows, but the files get renamed correctly, so the entries do not disappear in the list UI.

ichthyosaurus commented 3 years ago

When I enter the name "different-name", instead of saving it as different-name.gpg, it saves it as different-name.account! Then it no longer shows up on the password list.

... and

I have also encountered this but while adding website passords. "foobar.com" creates a file named "foobar.com" instead of a file named "foobar.com.gpg"

Can you reproduce this? I can't and the relevant code in realpass.cpp:118 looks fine to me.

gardenappl commented 3 years ago

Can you reproduce this? I can't and the relevant code in realpass.cpp:118 looks fine to me.

I wasn't using real pass, I was imitating it.

I suspect it has something to do with Qt's baseName() function.

You should probably use completeBaseName() instead.

ichthyosaurus commented 3 years ago

Ah, yes, in imitatepass.cpp:347 it's the same problem I fixed in #558 . The function is a bit messy though; I think it would be better if the author (or anyone familiar with the code) could have a look at it.

ichthyosaurus commented 3 years ago

I had another look and fixed the "baseName" problem in #559 . I still cannot see how the old suffix ".account" could be kept if the new name "different-name" is correctly used. Before the fixes it should have either become "my.gpg" or "different-name.gpg". Or "different-name" already contained ".account"...?

@woodenphone 's bug could be related to real pass (realpass.cpp:60). Adding the suffix is left to pass, there.

I'll stop digging in code I'm not familiar with :).

gardenappl commented 3 years ago

@ichthyosaurus About the suffix bug, I was using v1.3.2 (latest release version) and I believe this was the cause of the error: https://github.com/IJHack/QtPass/blob/d242041c3efdba43b037ef3f8fb9f526a46173a9/src/mainwindow.cpp#L1010

Replacing baseName() with the inserted name, and then for some reason removing the .gpg extension from the new file. That just looks very wrong to me.

But that was fixed with a commit in June. It's just that the latest release is extremely old... And nobody (myself included) is gonna build stuff from source on Windows.

So yeah, don't worry about that.

gardenappl commented 3 years ago

I suppose this means I can close this issue, but man, the fact that the last release binaries are over a year old just really rubs me the wrong way. That's no way to maintain a password manager.