From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master 0ad1c0d: * lisp/net/tramp.el (tramp-handle-make-process): Handle shell commands. Date: Fri, 18 Dec 2020 13:57:44 -0500 Message-ID: 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="26049"; 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: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 18 19:58:40 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 1kqKxb-0006fW-VU for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Dec 2020 19:58:39 +0100 Original-Received: from localhost ([::1]:58740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqKxb-0003vu-1m for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Dec 2020 13:58:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqKww-0003MZ-Ky for emacs-devel@gnu.org; Fri, 18 Dec 2020 13:57:58 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqKwo-0004Ze-UU for emacs-devel@gnu.org; Fri, 18 Dec 2020 13:57:57 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0374210022E; Fri, 18 Dec 2020 13:57:47 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 561A81000CF; Fri, 18 Dec 2020 13:57:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1608317865; bh=KpTJ6JQMdP+mENnuinpj7V/jMoV+7HVKQZFSJZLaWXQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PBDELAlGVV1XoYVwIvy/2MaT2rp/7W9t9mAyD3oX64DcvL6+IPS/gyYfv3Q6kxPwV 3HZ/M06o3wHV2Y5jEtQac1XzJOcRHfol53LN95W6KUgTruK4KDl5xC8Hz+Qcd0ayDs gXpQC8ljKzryi2cBIlnXbQqJrZJMk6r2VWy7dNZAOoRaamub8GWYu8vAwNBU0eR4Si Wo3PX8c1l+uNPUuo7+FVfT8sUmFGDUp76EpKiKOOuv1UhvfLMgCKd9Kh4+VsmKd3HM k8naE3Gc0BqFj5vaXOHUCRx+ldaz0K2WM+qQJN8TIEKbxr/APOxbMXptmhZMyNkQyC JKIVC3G8WyiWw== Original-Received: from alfajor (69-165-136-52.dsl.teksavvy.com [69.165.136.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 26EB8120445; Fri, 18 Dec 2020 13:57:45 -0500 (EST) In-Reply-To: <87tusj58pw.fsf@gmx.de> (Michael Albinus's message of "Fri, 18 Dec 2020 18:23:39 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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:261219 Archived-At: > (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. Any caller which passes several `args` should be fixed. Any chance this is the problem you're seeing? If we disregard those wrong callers, the current definition is: (with-connection-local-variables (start-file-process name buffer shell-file-name shell-command-switch command)) 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. Stefan