[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SCPC Detection Program

From: Noah Lavine
Subject: Re: SCPC Detection Program
Date: Tue, 13 Apr 2010 15:56:41 -0400

Hi Michael,

I was thinking about it, and the help string idea does seem better
than version numbers, especially if it turns out that several
different SSH implementations use similarly-formatted help strings. I
think I will check the formatting of a few different version and help
strings before coding more.

However, I thought of an alternate possibility. What if tramp first
saves the version string of ssh, then tries a connection with
ControlMaster to see if it works, and then remembers whether this
worked or not? Then it would choose a method for future connections
based on the results of the test until the version string changed, at
which point it would experiment again.

That way it would have to run a test connection only when the user
updated their ssh installation, which seems infrequent enough to be
reasonable, and it would have the advantage that we wouldn't have to
keep any sort of whitelist of ssh programs or help string formats.


On Mon, Apr 12, 2010 at 3:55 PM, Michael Albinus <address@hidden> wrote:
> Noah Lavine <address@hidden> writes:
>> Hi Michael,
> Hi Noah,
>> I checked with my version of ssh, and we would indeed be able to
>> detect this from its help version string. However, it seems like this
>> could have similar fragility issues as the version number idea, if the
>> help string changed format some time. You could solve this by only
>> trying scpc on help strings that are known to be good, but you could
>> also have a version number whitelist that would serve the same
>> purpose. It seems like both of these would work and would be quite
>> similar - is there a reason to think that one would be better than the
>> other?
> I have no bullet-proof reason. But your version test depends on
> underlying OpenSSH, and its version numbering scheme. What if other ssh
> implementations will support this option as well? Therefore, the version
> check seems to be more fragile to me than the "-M" option. Again, it is
> just a feeling.
> Another test could be the following:
> $ ssh -o ControlMaster=auto wrong-host
> ssh: Could not resolve hostname wrong-host: Name or service not known
> This would indicate, that the option is supported. Unsupported options
> return the following error message:
> $ ssh -o ControlMasterr=auto wrong-host
> command-line: line 0: Bad configuration option: ControlMasterr
>> As for the test connection, maybe a change would help. It's probably
>> not good to try connecting to a known-good host, but what about trying
>> it with the host that Tramp needs to connect to anyway? You could try
>> it first with the -ControlMaster option, and if ssh gave an error,
>> then try again without it and fall back on the other method. This
>> wouldn't create more ssh connections than necessary. The problem I see
>> is that it might require a more substantial change to the Tramp
>> codebase than the other methods, but I don't know, because I haven't
>> looked around enough to see. Do you think this method would be useful
>> enough to make it worth looking through the Tramp code more and maybe
>> making bigger changes?
> Yes, this would require deeper changes in Tramp's workflow, which I
> would like to avoid. And it might discriminate users for whom the test
> fails, because they would *always* need to spend the time for that
> failed test.
>> Noah
> Best regards, Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]