The attached patch is meant to fix bug 350111 [1] by allowing to change the login name when no username is specified in an SFTP URI. Caveats: (a) this might break some special non-interactive login methods because we always pass "-l" to the SSH client. I'm not an expert for this, though, maybe sb. else knows better whether this can become a problem? We already use if (user_name == NULL) user_name = g_get_user_name (); in sftp_get_connection, so we seem to make special assumptions about the authentication method. Do we support private key authentication ATM? (b) we insert the login name used with a NULL username into the hash table, so when the credentials are saved and URIs with NULL usernames are opened lateron the existing connections are reused, but they are not reused when URIs that specify the usernames are passed to the module, because the ftp connection getter is not aware of the actual SSH login name, but just of the username URI part. This is how all our remote methods work ATM, so it shouldn't be a major problem, at least not one that requires immediate fixing. (c) The attached patch also fixes absence of user input in CLI authentication, and updates the affected docs. [1] http://bugzilla.gnome.org/show_bug.cgi?id=350111 -- Christian Neumair <chris gnome-de org>
Attachment:
gnome-vfs-sftp-authentication.diff
Description: Binary data