From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands. Date: Sun, 20 Dec 2020 19:54:02 +0100 Message-ID: <87o8io9ulx.fsf@gmx.de> References: <20201218123338.4927.85373@vcs0.savannah.gnu.org> <20201218123339.A90E820B72@vcs0.savannah.gnu.org> <87czz787dk.fsf@gmx.de> <87y2hv5ch6.fsf@gmx.de> <87tusj58pw.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 20 19:55:34 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kr3ri-0002uk-3i for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Dec 2020 19:55:34 +0100 Original-Received: from localhost ([::1]:43200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kr3rh-0004m7-3g for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Dec 2020 13:55:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kr3qR-0004Gl-CU for emacs-devel@gnu.org; Sun, 20 Dec 2020 13:54:15 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:44271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kr3qL-0003hV-G8 for emacs-devel@gnu.org; Sun, 20 Dec 2020 13:54:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1608490443; bh=LLUOPKq9hSuDmbduHHEUr0J3n3fXAI+4PKYJTFw1u/k=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=KziS+LW3sT2/XunCbBFnZUF0RKfn2UVad0n7iQjevnYqp/NDpFvJJnbzE4kxnbcw6 v2ldrQQdbKFaBl4+zhmqJclrzkyNBRFTNNOq4KfovTJzAajK0cyGqOnTPfAPUiYZ3h VaEQnM8NZ/43NFzbdimljykMaJ/WDR9/9YTcvDG0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.52.107]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MzQgC-1jvmIN36eW-00vNkF; Sun, 20 Dec 2020 19:54:03 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 18 Dec 2020 13:57:44 -0500") X-Provags-ID: V03:K1:Th43rLbTbEaxy0Zhc1eOwDd46Tj1MaF91kHAcLmjnXes4ZH+LEs mk2rEryDwHSioNYGE7FVyZTAriaxcn18RJKjEYlqut/L5p1LiycY/Pha5/4JVygmKJn46RI knGp0xHwclZDykrZt+73TxlFmvXRtVVC4fqdeKOL+tycTUcr67C5uu+vYgvFAKrdpEkD8EQ y18lSK4ygwEf+/EM3RDWA== X-UI-Out-Filterresults: notjunk:1;V03:K0:8JiQ8GS3Eb8=:oGXt40bpAzoHtqNg1XsCvh FJ8G8mAGOKyiXzm7gFV9Nlw/R+9ab9PJcFz4FONBEuxLR1x98fcg8K/cKzbUbpXIaYXNp1a2Q Kve7sAk0pw7EEWUcrZzzcnr0ah0hOjBkHwsYKQAg2I4Qud7eeIMxg5BBl41gJH8uWOwkmjne8 ySrKCzkvpZEDnHcxs+VTuQJREIeSF+8dWuKwExspnE2g+i+lDwVPMsgEVvcISEISwLymNR5Fo Wdi43g3MO8cSfDDYRsU+U09DJGwObM6V3ygNJ+RZ1TCgFfaq8aGvJZ5H1a713Nmi90RSC9lAW QrK5PMMsc6Oh9PHXWu9D5iMRoackh7ACLwauSjrQadfEDXtO3ss9OWCvNFUXYlysQ44SCP0ae 5AjgYVrjT2bBd5GWAhbBeGosHwNfQkWU25u3/Fp1bdl2qdV8UFrmRLRwtFDH7cv1lcRFTI2Ty NVCpZFSEfuAPFCLDva2zk2Pp+GCFMVCCNrn/pBDCSENGfGzBA1A4Wx9CuEtVReZuipvYqnOeV nuG0NEYPjzcUHgt5DFJFH9byNDgXSjMC+xMDXwh2tE2i3ANCnabvoVSO1h1fahGeBXqM1tVAG zSOBu+N7/aPg2Z6t1O8JZjJ30u6bfhAgW6nuKOiDHQ16RfXR1ssD9fFXsxFHWeAGDWYSD+yxD wPEka09fMoK5b5kjqHA0jDqcKOYlG+1hGFk8PRHyh1UZo2GivXYUFx9ljWTlFdzm1NOUSlSxf 5oZ2zdLxb3d4MolThJxUTo8E0muRlirBVk8l1r+3LFEKxio4XZ3tkbk1DFNNAufQlkIkLH3X Received-SPF: pass client-ip=212.227.17.20; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261352 Archived-At: Stefan Monnier writes: Hi Stefan, >> (defun start-file-process-shell-command (name buffer &rest args) >> "..." >> (with-connection-local-variables >> (start-file-process >> name buffer >> shell-file-name shell-command-switch >> (shell-quote-argument (mapconcat 'identity args " "))))) > > Concatenating arguments with a " " separator is plain wrong. > That's why we have > > (declare (advertised-calling-convention (name buffer command) "23.1")) > > so we can hopefully soon drop support for that concatenation. I've dropped this. > So the `command` doesn't need any quoting here: it's > start-file-process's responsability to make sure it starts a process > with those 3 strings (shell-file-name as the name of the executable, > `shell-command-switch` as the first arg and `command` as the second). > > In the case of Tramp's implementation of `start-file-process`, you're > going to run this process by constructing a command to send to the > remote shell, so you'll indeed need to turn this list of strings > into a single string and you need to do it by quoting those strings > using the quoting that corresponds to that of the remote shell (which > is indeed what `tramp-shell-quote-argument` does, IIUC). > IOW, I'd expect `start-file-process` to do something like > > (mapconcat #'tramp-shell-quote-argument args " ") > > to construct the command to send to the remote shell. My recent patch (pushed) is along these lines. In tramp-handle-make-process, but this is just an implementation detail. It is a little bit more complicate, because it needs also some quoting for the purpose of ssh, but it works for this. There are still some problems when the connection is not performed via ssh; this I will continue to investigate. > Stefan Best regards, Michael.