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.02k stars 161 forks source link

edit of password broken with active "Automatically push" #177

Closed juergenthomann closed 8 years ago

juergenthomann commented 8 years ago

If I try to change an existing password, it doesn't show anything of the saved data and the password field contains "Already up-to-date."

Version is 1.1.1 (openSUSE rpm)

annejan commented 8 years ago

The "Already up-to-date" looks like a git notification for some reason ended up as the decrypted password. Does viewing password work without an issue?

juergenthomann commented 8 years ago

viewing works fine for me

annejan commented 8 years ago

Installing openSUSE to try and reproduce this bug..

juergenthomann commented 8 years ago

I looked now a bit into the code and I'm not sure how this exactly works but I added some debugging stuff that may can help you.

I added a debug output in MainWindow::readyRead

+  qDebug() << "Current Action: " << currentAction;
   QString error = process->readAllStandardError();
   if (currentAction != GPG_INTERNAL) {
     output = process->readAllStandardOutput();
+    qDebug() << output;

The result without pull:

Current Action: 0 "\nlogin:\n"

With pull enabled:

Current Action: 0 "Already up-to-date.\n" Current Action: 0 "\nlogin:\n"

Interesting is the result when I press the pull button manually:

Current Action: 1 "Already up-to-date.\n"

I solved this problem when I changed MainWindow::editPassword:

   if (useGit && autoPull)
     on_updateButton_clicked();
   waitFor(30);
+  process->waitForFinished();
   // TODO(annejan) move to editbutton stuff possibly?
   currentDir = getDir(ui->treeView->currentIndex(), false);

So more it looks a bit like a race condition here for me. If you like to have some more debug output or other changes, just let me know.