sftp / ssh password problems with bzr 0.8 prerelease

Bug #40508 reported by Daniel Holbach
6
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Pool
bzr (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When connecting to sftp if ssh asks for your password, the cursor "sits a line below" and if type the password it appears on the screen. It doesn't seem to get transmitted either.

This is caused by the recent setpgrp fix to prevent stale locks on ctrl-C.

You can workaround it by using ssh keys and adding the keypair to your agent. Or, if you are in a trusted environment you can embed the password in the url, but *this is a security concern* and *not recommended*.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 40508] ssh password problems with new bzr

Robert recently changed bzr so that ssh is run in a separate process
group, with the goal of protecting it from being abruptly terminated by
^C (and therefore preventing us from cleaning up before closing the
connection.)

This may well be a consequence of that - being in a new pgrp likely
prevents ssh setting the terminal mode.

I'm not sure which is the lesser evil... perhaps we should keep the old
behaviour?

--
Martin

Revision history for this message
Martin Pool (mbp) wrote : Re: ssh password problems with new bzr

The previous fix was for bug #5987

Revision history for this message
Daniel Holbach (dholbach) wrote :

My opinion might not be definitive, but I'd rather roll back until the fix for bug 5987 is less problematic.

Revision history for this message
Robert Collins (lifeless) wrote :

what about ssh -f ? that seems like it might do the trick.
or -o BatchMode ?

I think that its better to not support passwords than to have broken locks on ctrl-C, to be honest.

Alternately we could use a subprocess of our own that will wait for traffic to bzr to flow and then setpgrp. Don't know if that would work or not.

Revision history for this message
Martin Pool (mbp) wrote :

ssh -f seems to cause ssh to close stdin and stdout, so wouldn't be suitable.

-o BatchMode would disable password prompts.

Perhaps a better solution for bug 5987 is to ignore SIGINT in the child before starting ssh? I *think* ignored signals are retained across exec(), but I haven't checked yet.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 40508] Re: ssh password problems with new bzr

On Mon, 2006-04-24 at 02:46 +0000, Martin Pool wrote:
> ssh -f seems to cause ssh to close stdin and stdout, so wouldn't be suitable.
>
> -o BatchMode would disable password prompts.
>
> Perhaps a better solution for bug 5987 is to ignore SIGINT in the child before starting ssh? I *think* ignored signals are retained across exec(), but I haven't checked yet.

posix_spawn lets you set a sig mask as you create the process.
http://www.opengroup.org/onlinepubs/000095399/functions/exec.html
confirms that we *should* be able to ignore the signal in the child.

So changing the after_fork call from setpgrp to setsigmask should work.

Rob

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Martin Pool (mbp)
Changed in bzr:
status: Unconfirmed → Confirmed
assignee: nobody → mbp
description: updated
John A Meinel (jameinel)
Changed in bzr:
status: Confirmed → Fix Released
Revision history for this message
Daniel Holbach (dholbach) wrote :

This problem does not exist in Ubuntu any more.

Changed in bzr:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.