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.bugs Subject: bug#44217: bug#44216: 28.0.50; Incorret during delete in Tramp: Trashing...done Date: Mon, 26 Oct 2020 16:35:25 +0100 Message-ID: <878sbtuhj6.fsf@gmx.de> References: <86mu0ayu2b.fsf@protected.rcdrun.com> <87eell2q96.fsf@gnus.org> <87imaxuo74.fsf@gmx.de> <87tuuh15zm.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18269"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 44217@debbugs.gnu.org, Jean Louis To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 26 16:51:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kX4m8-0004br-Cp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 16:51:12 +0100 Original-Received: from localhost ([::1]:33852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX4m7-0006KH-5s for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Oct 2020 11:51:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX4YQ-0000Mo-5Z for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 11:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kX4YP-0001O9-Ra for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 11:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kX4YP-00083S-Oj for bug-gnu-emacs@gnu.org; Mon, 26 Oct 2020 11:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Oct 2020 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44217 X-GNU-PR-Package: emacs Original-Received: via spool by 44217-submit@debbugs.gnu.org id=B44217.160372656630892 (code B ref 44217); Mon, 26 Oct 2020 15:37:01 +0000 Original-Received: (at 44217) by debbugs.gnu.org; 26 Oct 2020 15:36:06 +0000 Original-Received: from localhost ([127.0.0.1]:40842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX4XW-00082C-59 for submit@debbugs.gnu.org; Mon, 26 Oct 2020 11:36:06 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:60199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX4XU-00081c-6b for 44217@debbugs.gnu.org; Mon, 26 Oct 2020 11:36:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1603726527; bh=u/A0NFs7CInIDiG1LEko/LInBi4a21qUq8WJdqRJWDo=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=U0lFsedxZ5Hq+h+b5g+X+Jw+enz31vHLppWaVfwGQ/7DqrEfnT0qfhuBYJG2luzzc KZHmKGlBPAtdEUOIbBOU3q4JPeXo8PJIhnbBNL1nxrSq65XjCFUH1ZAsPmDQvR9d+Y IoWy7S/t7hdl/W446JQXR2OSqK/QlyPwhlAOvjcU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.54.197]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTzb8-1kwosG3GDK-00QzBP; Mon, 26 Oct 2020 16:35:27 +0100 In-Reply-To: <87tuuh15zm.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 26 Oct 2020 14:17:33 +0100") X-Provags-ID: V03:K1:PdcDYvTxfmtDJDYG5vwZg6KqKp7WMD87lw0CKCMESIo2U1cZGrf nDYomAbc1eJfqYsymKEzYPNMX8OcItzxe2q+8TcmKTWI6UjEtuDswhj1jkYdn9WUR2qAPwL a8kla5/Q32DoSZGlgYQuf23yX6RKFPitTJ24iIR0A91Z0eXmZBCsq8Ukgyr6eZu8fAGo5yE WJz8ztMXYFs7tCqBOEMYw== X-UI-Out-Filterresults: notjunk:1;V03:K0:5gfuA6YmsRg=:dMKtsyinxnZR8zJmcv7knH qNEhKiPmN6dRRkXjh9cA6KPTQccgg7ahONzmfTrfp18ic1EI9Mcr4YSu72mlyii2vDxMgV2VK Sb2m5w/ZRANF1CYxC5jl4CqUCuWn6UySKQ4Jy9lGmLy6F7MW8NQMmokvFEQVI3mB6tNAFbQId lSr+r0BMAm1wRCGDdLSsT3RQFBJk54UF1Jvbl1Gpzmp4ffXsfjq0AvQJQ0cuD7ysvV6l1EvJC 7Fo+U5tQG4ari0wI+oU5iIeLHs7WKYsG3xlp75vTxX9Jz5aF1qvxkm5aDffgLc6Ybb2f0ExHz LDmk30j58FsyM9IyL3ezCyRc+QxP8nP4f0PcyLK7VY5HwiZRmBkoED5MBRYCHxZAxtYW5O4Kf W7NIFtGKESnj4n7f+3iSsA/bL3+UXHGizFwKwGPCuj85tYCT2OkLjSiNE4azEkjqMuAL0EGiY ug7wzFlZfaiDSmXktCOftBppREJqoXTr7VFPEf81em8TFylhBtYs6SayVRfsJdLt7N0gcADnR g1Q8zVcBMnuHmrMJzSeU800EDJqMJonfSVuHfeCta9t+7JLvcGWcp8F//CrMaEHl8IDLK/tL/ bwk6gSFuX5c2DAKgtoDPFHUlO5yp1SlKXvrwAsP/gSO7HzyXvHUVdGWnY0xIM37o9NY8cJJrz FZ6zkZnMU5784h3gvpGFPcm9QzNtJXH7qwllHOw1z/8tpKkjpOs69xJsXF/U4ciFF2v7Xra4F 6N+yd+CMW4gx3BAK/mBHQOC/2rkySXtGDwtDCAcvb2mI1N+A0I4NEcVctsuPq0cNuLj5AU9s X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191592 Archived-At: Lars Ingebrigtsen writes: Hi Lars, >>> Shouldn't Tramp then move the file to `trash-directory' instead of >>> giving up and just deleting the file? >> >> Why that? `trash-directory' is defined as target for >> `move_file_to_trash'; it has nothing to do with deleting of remote >> files. > > It doesn't now, but that's only because it's implemented that way. When the feature "move to trash" was designed, Tramp was not regarded as game player. I've tried to implement where it is possible, that is for ssh-like connections using the remote "trash" command, and for remote connections based on GVFS using the "gio trash" command. And that's it. For all other remote connections, we delete the file. >> And it would be a security flaw, if remote files would be moved >> to the local "~/Trash" directory. > > Well... no, not more than usual. You can delete a non-Tramp file from > an encrypted file system, and have the Trash on a non-encrypted file > system, and that would be the same flaw. Whether Tramp is involved or > not is orthogonal. (Except as an efficiency thing.) No, for Tramp it is different. You move the file from one machine to another. And you change the ownership: one file accessible only by root on one system, is then accessible by whomever on another machine, in the waste basket. That is a much more serious security flaw, and it would be unexpected for the majority of the users. For that reason, it is common practice to provide one waste basket on every physical file system, even for different file systems accessible on the same machine (aka "mounted"). >>> If this is working as designed, it should at least be mentioned in the >>> doc string(s) and the manual. >> >> I believe it is mentioned. See the docstrings of `trash-directory' and >> `move-file-to-trash'. Well, the latter might explicitly state that it is >> not intended for remote files, but this is another game. > > Neither doc string says anything about remote files? > > --- > > Directory for =E2=80=98move-file-to-trash=E2=80=99 to move files and dire= ctories to. > This directory is used only when the function =E2=80=98system-move-file-t= o-trash=E2=80=99 > is not defined. > Relative paths are interpreted relative to =E2=80=98default-directory=E2= =80=99. > If the value is nil, Emacs uses a freedesktop.org-style trashcan. It says it indirectly, because move-file-to-trash is intended for local operation only. > --- > > Move the file (or directory) named FILENAME to the trash. > When =E2=80=98delete-by-moving-to-trash=E2=80=99 is non-nil, this functio= n is > called by =E2=80=98delete-file=E2=80=99 and =E2=80=98delete-directory=E2= =80=99 instead of > deleting files outright. > > If the function =E2=80=98system-move-file-to-trash=E2=80=99 is defined, c= all it > with FILENAME as an argument. > Otherwise, if =E2=80=98trash-directory=E2=80=99 is non-nil, move FILENAME= to that > directory. > Otherwise, trash FILENAME using the freedesktop.org conventions, > like the GNOME, KDE and XFCE desktop environments. Emacs moves > files only to "home trash", ignoring per-volume trashcans. As I said the other message, it shall make it clear that it is an operation for a local file system. As designed. That's why it is called in delete-file end delete-directory only after the file name handler. Best regards, Michael.