From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Barros Newsgroups: gmane.emacs.bugs Subject: bug#58781: 28.2; move-file-to-trash may move file across filesystems Date: Wed, 26 Oct 2022 08:05:43 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12996"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58781@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 26 13:08:24 2022 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 1oneGm-0003FX-Pc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Oct 2022 13:08:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oneFV-0003al-SJ; Wed, 26 Oct 2022 07:07:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oneFT-0003DH-89 for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 07:07:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oneFS-0005Vg-QT for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 07:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oneFS-00018j-5n for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2022 07:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Barros Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2022 11:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 58781-submit@debbugs.gnu.org id=B58781.16667823634306 (code B ref 58781); Wed, 26 Oct 2022 11:07:02 +0000 Original-Received: (at 58781) by debbugs.gnu.org; 26 Oct 2022 11:06:03 +0000 Original-Received: from localhost ([127.0.0.1]:53465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oneEV-00017N-DP for submit@debbugs.gnu.org; Wed, 26 Oct 2022 07:06:03 -0400 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:34505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oneET-00016t-8f for 58781@debbugs.gnu.org; Wed, 26 Oct 2022 07:06:01 -0400 Original-Received: by mail-pg1-f169.google.com with SMTP id 128so14446958pga.1 for <58781@debbugs.gnu.org>; Wed, 26 Oct 2022 04:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wjU16vF5JYdbjHFZrQIQpOTqbFDKav6pmExrVeReGJ4=; b=QADCMZgEZzg9poAWvQHtELskPL00ZElsxeJ0yaICra463BnGtzcd/ut9mXYASJf8AU avxALz3Xf2GD/l/3NvRQpkfW28YT72mv2yVB9ugwIUXc68l4+d5dRLJMEVF1MGEkt+BT 5BWj0IEQhBnk3E1UVeOaWhtb1lTJEgyqmcCth54c63SVAUx0unBGp4mwRtlIheTllnIU F28vgxnrkKZccbdxU7RgbcgLtS5lHQMtUz0WIn3G+G0d9bNzMFZlRdlAHQvnvRx61IRE SmcttTBatLYF2+0mUrB4bmGESV7y7vTIOf3EtcbHxNhx/acCKFvVPDfPjl5lCYN18leG UskA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wjU16vF5JYdbjHFZrQIQpOTqbFDKav6pmExrVeReGJ4=; b=ccJKVB15tEhk7R+EXv5d+QniffsRmWH45gDjT2EYu0PvksT5XACARDu0TAlGJOn6Lm 79gP5sV/DOgofR3Oh2Z80lVx6aQ4ckLlINUT4rya4izfs+AvZTrBAzsnHASKalW8K8e6 ySVV75tQqNpk8OHuh/Ldwt4/DDc7llW9Ey4AmqRvoFEJGcq/2WN+1BIX9VCHiXjezowV sPAGvKHsbppycC36rz6LgVA9p3phjTTOcYzWTzssKL7DMBeg22Vh7puGworH/NQGoOc5 We53mt1WREnjToKAWboPxSlm2znD+2Kie3Cd5OLcDEGunFh7JKdrD8xU2YOEVcuWsSyd hXfA== X-Gm-Message-State: ACrzQf2B9VDoj0f629kN260ChWA/WprkiWiMI1EwZ5CjTRsm7u73SIav 45b6qOn/tjbwLIJeWeYoZIpoWL7wU2Qa/YNYn94= X-Google-Smtp-Source: AMsMyM40OPKs6SSw943r6FJHl49ZSZONz3xXja8UlGJNFvrTUSDCsilO8p82RZiyZ0JdyAe+9CDOPX9EdOkjFvvT3zk= X-Received: by 2002:a63:f924:0:b0:46b:1a7d:3b91 with SMTP id h36-20020a63f924000000b0046b1a7d3b91mr37529820pgi.133.1666782355343; Wed, 26 Oct 2022 04:05:55 -0700 (PDT) In-Reply-To: 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246216 Archived-At: Hi Stefan, On Wed, 26 Oct 2022 at 03:22, Stefan Kangas wrote: > Yes, that argument overlooks what happens when files are moved from > encrypted partitions to unencrypted ones. That is bad. > Agreed, but I don't think this makes it into a non-bug. Thanks for looking into this. And, particularly, for the way you classified the report. It is my understanding too that this should be cause for concern. > Could you write this up as a proper patch, instead? I don't think this snippet is a proper general solution to the problem, except as a temporary workaround for anyone interested to keep in their init files. I shared it in this spirit, at least. As far as I searched, "gio" stands for "Gnome Input/Output", I presume this is distro specific. Also, even if it was not, "gio trash" appears to have some limitations in that some places are not supported like "system internal mounts" (eg. "/tmp/", this is the reason for the sentinel there), so some further handling of cases would still be necessary. Besides, unfortunately I cannot sign a patch (no papers), so I have to contribute in other ways. I'm not that well acquainted with `files.el', but as far as I've looked into `move-file-to-trash', I think the right way to handle it would be directly there, or in a dedicated `xdg-trash', as you suggest. It is more complicated than the current standing but it appears not to be overly so. It's really three cases, and then there are the checks for "$topdir/.Trash". Anyway, I didn't seem to find any "universal Linux way" available for the operation so, as far as I can tell, relying on the system tools would not be a wise alternative. Best regards, Gustavo.