GNU bug report logs - #37922
26.3; move-file-to-trash puts wrong trash file name at name collision

Previous Next

Package: emacs;

Reported by: Shingo Tanaka <shingo.fg8 <at> gmail.com>

Date: Fri, 25 Oct 2019 14:41:02 UTC

Severity: normal

Tags: easy

Found in version 26.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 37922-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Shingo Tanaka <shingo.fg8 <at> gmail.com>
Cc: 37922-done <at> debbugs.gnu.org
Subject: Re: bug#37922: 26.3;
 move-file-to-trash puts wrong trash file name at name collision
Date: Sat, 16 Nov 2019 14:56:37 +0200
> From: Shingo Tanaka <shingo.fg8 <at> gmail.com>
> Date: Fri, 25 Oct 2019 22:59:28 +0900
> 
> When delete-by-moving-to-trash is t and system-move-file-to-trash is not
> defined, move-file-to-trash moves the deleted file to system trash can
> following freedesktop.org trash can specification.
> 
> In this condition, when a file is deleted and it has the same name as the
> one of an already deleted file in trash can, move-file-to-trash generates
> another file name by using make-temp-file to avoid the name collision.
> Unfortunately, it does put a wrong name with suffix ".trashinfo".
> 
> For example, when 2 "hoge.txt" are deleted, expected files are like:
> 
> /home/myusername/.local/share/Trash/files:
> -rw-rw-rw- 1 myusername  10 2019-10-25 20:00 hoge.txt
> -rw-rw-rw- 1 myusername  10 2019-10-25 20:00 hoge.txtwmWP0h
> 
> /home/myusername/.local/share/Trash/info:
> -rw-rw-rw- 1 myusername  75 2019-10-25 20:00 hoge.txt.trashinfo
> -rw------- 1 myusername  75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo
> 
> However, the reality is the 2nd trash file in files directory is named
> wrongly with ".trashinfo" suffix like:
> 
> /home/myusername/.local/share/Trash/files:
> -rw-rw-rw- 1 myusername  10 2019-10-25 20:00 hoge.txt
> -rw-rw-rw- 1 myusername  10 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo
>                                                             ^^^^^^^^^
> /home/myusername/.local/share/Trash/info:
> -rw-rw-rw- 1 myusername  75 2019-10-25 20:00 hoge.txt.trashinfo
> -rw------- 1 myusername  75 2019-10-25 20:00 hoge.txtwmWP0h.trashinfo
> 
> Here is a potential patch.

Thanks, I installed this.




This bug report was last modified 5 years and 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.