make ksshaskpass work with git-lfs
ClosedPublic

Authored by mkoller on Nov 30 2017, 4:58 PM.

Details

Summary

On our git-lfs setup, I could not authenticate to the server due to 2 problems with ksshaskpass:

  1. the git-lfs uses yet another syntax for the prompt, which was not covered by a regular expression
  2. KWallet writes an error to stderr when a 0-winId is given to openWallet() which is received by git-lfs and aborts the operation.

The attached patch solves both issues.

  1. a new regexp is added
  2. I pass the desktop winId to openWallet
Test Plan

using git with lfs

Diff Detail

Repository
R105 KDE SSH Password Dialog
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mkoller created this revision.Nov 30 2017, 4:58 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 30 2017, 4:58 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mkoller requested review of this revision.Nov 30 2017, 4:58 PM
kossebau resigned from this revision.Nov 30 2017, 5:07 PM

no clue about these ksshaskpass internals, sorry

fvogt added a subscriber: fvogt.Jan 11 2018, 11:02 AM

Looks good to me, but I wonder whether

KWallet writes an error to stderr when a 0-winId is given to openWallet() which is received by git-lfs and aborts the operation.

should be fixed more in a more general way as well.

In D9072#189303, @fvogt wrote:

Looks good to me, but I wonder whether

KWallet writes an error to stderr when a 0-winId is given to openWallet() which is received by git-lfs and aborts the operation.

should be fixed more in a more general way as well.

Like how ?

fvogt added a comment.Jan 20 2018, 4:29 PM
In D9072#189303, @fvogt wrote:

Looks good to me, but I wonder whether

KWallet writes an error to stderr when a 0-winId is given to openWallet() which is received by git-lfs and aborts the operation.

should be fixed more in a more general way as well.

Like how ?

Duping stdout/stderr to new file descriptors, using those and closing 1/2 would be very effective.

Does kwallet really write to stderr? If so, why does git-lfs parse stderr in addition to stdout?

so you mean instead of a one line change fiddling with file descriptors is a better way ?
I don't think so.

And effectively I was told that passing a 0 pointer to kwallet is wrong.
https://mail.kde.org/pipermail/kde-frameworks-devel/2017-May/045085.html

  • Does kwallet really write to stderr?

yes, using qDebug()

  • If so, why does git-lfs parse stderr in addition to stdout?

you have to ask the developers of git-lfs. I don't know.

fvogt accepted this revision.Jan 20 2018, 11:02 PM

so you mean instead of a one line change fiddling with file descriptors is a better way ?
I don't think so.

And effectively I was told that passing a 0 pointer to kwallet is wrong.
https://mail.kde.org/pipermail/kde-frameworks-devel/2017-May/045085.html

Obviously your fix is correct and necessary, I never stated the opposite.
I merely suggested that a more generic way in addition to this would prevent future issues.

I'd say you can commit this to the Plasma/5.12 branch.

This revision is now accepted and ready to land.Jan 20 2018, 11:02 PM
This revision was automatically updated to reflect the committed changes.