Bug 391127 - svn+ssh doesn't work with password auth
Summary: svn+ssh doesn't work with password auth
Status: CONFIRMED
Alias: None
Product: kdevelop
Classification: Applications
Component: VCS: Subversion (show other bugs)
Version: 5.2.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
: 184845 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-26 21:44 UTC by Matthew Trescott
Modified: 2018-03-25 21:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Trescott 2018-02-26 21:44:00 UTC
When using KDevelop in a preexisting svn checkout, I am not prompted for my SourceForge credentials, I only get an error. Using svn ci from a terminal works fine.
Comment 1 Kevin Funk 2018-03-01 22:09:42 UTC
CC'ing Christoph who might be interested in looking at this.
Comment 2 Christoph Roick 2018-03-03 14:23:44 UTC
Using "SSH_ASKPASS=ksshaskpass" (https://wiki.archlinux.org/index.php/KDE_Wallet) or "SSH_ASKPASS=" (password will be asked in the terminal) I cannot confirm the issue. Some problems were fixed in commit 9fd4f6c25f6c712a76672e0b3acbefef7d4fd155, but they are not directly related to ssh authentication.

What kind of error do you get?
Comment 3 Matthew Trescott 2018-03-10 22:07:37 UTC
Well, I wasn't running KDevelop in a terminal before and unfortunately I don't remember what the error was, but I'm certain it was because I couldn't enter my password for SVN. I didn't have any error this time because I was able to enter my password, but even though I used SSH_ASKPASS=ksshaskpass kdevelop the prompt was still in the terminal rather than as a dialog. I don't think it should be necessary to change environment variables or run the IDE from a terminal just to enter your SVN password though---KDevelop should be smart enough to find an ssh askpass program if there isn't one specified in an environment variable.
Comment 4 Christoph Roick 2018-03-11 17:34:33 UTC
You are right, when run from a terminal, the password seems to be always requested there inside (which is not specific for svn).
I was referring to having SSH_ASKPASS=ksshaskpass set for the environment, when starting the usual way.

The point is, that the SVN library never gives a response to KDevelop requesting a password, since it directly calls ssh. And ssh prompts for the password in the terminal if there is one or uses SSH_ASKPASS otherwise.

I don't see how this could easily be fixed. Maybe consider setting the environment variable as a workaround.
Comment 5 Matthew Trescott 2018-03-12 20:37:18 UTC
Couldn't you set SSH_ASKPASS with putenv() before calling SVN-related functions? I imagine ssh is a child process started by svn...?
Comment 6 Kevin Funk 2018-03-15 19:23:06 UTC
Sounds like a feasible approach. Some other *cough*QtCreator*cough* famous IDE does that as well. [1]

That's a great junior job. So in case you're interested in getting this fixed this is also something you could work on!

[1] See: 
  https://github.com/qt-creator/qt-creator/blob/master/src/plugins/vcsbase/commonvcssettings.cpp#L45 (and related lines in that file)
Comment 7 Christoph Roick 2018-03-17 13:17:16 UTC
Ok, but what should it be set to? KDevelop doesn't really know what kind of program could be used to query a password, no?
Maybe a call to KDevelop itself with a new parameter could be used? Like:

SSH_ASKPASS="kdevelop --query-pw"
Comment 8 Kevin Funk 2018-03-20 07:10:37 UTC
@Christoph: Well, see the code I linked to. QtCreator does just use platform defaults (and also respects the SSH_ASKPASS env var if available).
Comment 9 Christoph Roick 2018-03-20 21:04:47 UTC
@Kevin: I'm not fully convinced.
One problem is, that SSH_ASKPASS is ignored if a terminal is set [1]. So one would have to trick ssh into believing that there is no terminal; which is explained in [1].
Interestingly ssh-askpass is not part of my system (probably due to relying on the environment variable). That's where the idea of making KDevelop itself some kind of default askpass program was coming from.

Nevertheless, setting the environment variable to some default value would surely be a start.

[1] https://unix.stackexchange.com/a/272524
Comment 10 Kevin Funk 2018-03-25 21:31:22 UTC
*** Bug 184845 has been marked as a duplicate of this bug. ***