Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9885 (closed defect: fixed)

Opened 9 months ago

Last modified 5 months ago

scm_prefer_prompt functionality does not handle remote password prompts correctly

Reported by: lyricsboy Assigned to: minam
Priority: normal Milestone: 2.x
Component: Capistrano Version: edge
Severity: normal Keywords:
Cc:

Description

The scm_prefer_prompt variable feature added in Capistrano 2.1 only appears to affect whether or not to include the --password command line option on 'svn' command lines.

It should also be considered when responding to a remote command's prompt for the password. Currently if scm_prefer_prompt is set, no password variable is set, and the remote svn command prompts for a password, a blank password will be sent. This makes svn ask then for a username, which confuses Capistrano into waiting forever for the command to complete.

In my opinion, it would be preferable if the scm_prefer_prompt feature encapsulated the pattern of asking for the password itself, as can be done like so:

set(:scm_password) { Capistrano::CLI.password_prompt("Subversion password: ") }

However, this sort of muddles the two goals of prompting for a password and avoiding the password appearing in plain text within the svn command lines, at least if implemented exactly the same way. Perhaps scm_prefer_prompt could tell Capistrano to prompt for a password, store that password, and use it in response to only remote prompts. Hard to say.

Change History

11/25/07 21:23:50 changed by ebeland

Hi,

Adding the lines below in the case statement at line 87 (as of capistrano 2.1) in subversion.rb within the handle_data function will prevent the "capistrano becomes confused" part of this issue.

when /\busername.*:/i

"#{variable(:scm_username)}\n"

Thanks, Eric

01/30/08 05:56:26 changed by minam

  • status changed from new to closed.
  • resolution set to fixed.

(In [8754]) If subversion asks for a password, prompt as a last resort (closes #9885)