From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.emacs.tramp,gmane.emacs.devel Subject: Re: SCPC Detection Program Date: Mon, 12 Apr 2010 15:36:42 -0400 Message-ID: References: <8739z26jxo.fsf@gmx.de> <87iq7weaz4.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1271103894 6496 80.91.229.12 (12 Apr 2010 20:24:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Apr 2010 20:24:54 +0000 (UTC) Cc: tramp-devel@gnu.org, emacs-devel@gnu.org To: Michael Albinus Original-X-From: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Mon Apr 12 22:24:53 2010 Return-path: Envelope-to: tramp@deer.gmane.org Original-Received: from quimby.gnus.org ([80.91.231.51]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O1QBg-0003Cz-Vg for tramp@deer.gmane.org; Mon, 12 Apr 2010 22:24:52 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1O1QBg-00033w-00 for ; Mon, 12 Apr 2010 22:24:52 +0200 Original-Received: from localhost ([127.0.0.1]:60375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1QBf-0002MU-RR for tramp@quimby.gnus.org; Mon, 12 Apr 2010 16:24:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1PRD-0007OT-6J for tramp-devel@gnu.org; Mon, 12 Apr 2010 15:36:51 -0400 Original-Received: from [140.186.70.92] (port=49182 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1PRA-0007OG-Kj for tramp-devel@gnu.org; Mon, 12 Apr 2010 15:36:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1PR9-0003Lb-8M for tramp-devel@gnu.org; Mon, 12 Apr 2010 15:36:48 -0400 Original-Received: from mail-pz0-f198.google.com ([209.85.222.198]:34469) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1PR6-0003LD-07; Mon, 12 Apr 2010 15:36:44 -0400 Original-Received: by pzk36 with SMTP id 36so4684528pzk.24 for ; Mon, 12 Apr 2010 12:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=uO5ARJHYjMuU7NLssdYpAUTejIGvmIDN92D2kPWiPR8=; b=xchlzaZ6T2psEjzZNZIQYkkMvMS43lC5CUO/NBT64mcQc6GuAZKUMKKT3vxgUqdVtY /phn3AkZD2bfqmw5rDX6dRaopbEc+1bBQNKFNImwbbFCNB6LzHffs8pRovYhnJlGd85J e/cgqCvZwM/CSVQ9Cp6fM7izPS7grFfwU1Ni8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=l3Wjij2RlAmDVpQHEk93cMlk30xiHOoUOss1pqO9DPj0L6z/Niz+nNKGfXvW4fwMsy Ylu6SlEdQ5DhSe9F9v5tbzIe+gqktPx+b1xl8cBOBNgUUbokxNCTFb5Z842PK6Mwuhyc AuQFEMW0RTC94oQaBht9+SF7rhuPagTmgHRuI= Original-Received: by 10.231.37.2 with HTTP; Mon, 12 Apr 2010 12:36:42 -0700 (PDT) In-Reply-To: <87iq7weaz4.fsf@gmx.de> Original-Received: by 10.115.67.11 with SMTP id u11mr385839wak.196.1271101002717; Mon, 12 Apr 2010 12:36:42 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Mon, 12 Apr 2010 16:24:40 -0400 X-BeenThere: tramp-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: tramp-devel.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Errors-To: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Xref: news.gmane.org gmane.emacs.tramp:7230 gmane.emacs.devel:123542 Archived-At: Hi Michael, 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? 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? Noah On Mon, Apr 12, 2010 at 3:18 PM, Michael Albinus wrote: > Noah Lavine writes: > >> Michael, > > Hi Noah, > >> Is there a commonly-used way to discover the capabilities of a system >> other than version numbers? Talking to the system package manager >> would also work for most (although not all) cases, and I could look >> into writing a connection to PackageKit if that seemed like it could >> work. >> >> It would also be really cool if the ssh program had a way to tell us >> what command-line arguments it accepted, but I don't see any way to do >> that short of asking it to open up a test connection and seeing if it >> gave an error message. That might actually be a reasonable way to do >> this, if you defer the checking until the first use of ssh - first try >> opening a connection with ControlMaster, and if that fails, try again >> without it. > > Maybe "ssh --help", and checking for the "-M" option, might be sufficient. > Trying a "test connection" is not mature, because you don't know which > test host to connect to. "localhost" does not need to run the sshd daemon. > >> Noah > > Best regards, Michael. >