From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 22 11:37:42 2019 Received: (at submit) by debbugs.gnu.org; 22 Dec 2019 16:37:42 +0000 Received: from localhost ([127.0.0.1]:50165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ij4Eg-0000ol-91 for submit@debbugs.gnu.org; Sun, 22 Dec 2019 11:37:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:59440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ij4Ef-0000oc-Ef for submit@debbugs.gnu.org; Sun, 22 Dec 2019 11:37:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38844) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ij4Ee-0000gu-9P for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 11:37:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ij4Ed-0002fD-6W for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 11:37:40 -0500 Received: from anteater.elm.relay.mailchannels.net ([23.83.212.3]:63350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ij4Ec-0002V0-QV for bug-gnu-emacs@gnu.org; Sun, 22 Dec 2019 11:37:39 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 29FFC58078D for ; Sun, 22 Dec 2019 16:37:36 +0000 (UTC) Received: from pdx1-sub0-mail-a93.g.dreamhost.com (100-96-91-164.trex.outbound.svc.cluster.local [100.96.91.164]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B8772580148 for ; Sun, 22 Dec 2019 16:37:35 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a93.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sun, 22 Dec 2019 16:37:36 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Bubble-Print: 55c01d32018da0ab_1577032655967_1276001883 X-MC-Loop-Signature: 1577032655967:2690411787 X-MC-Ingress-Time: 1577032655967 Received: from pdx1-sub0-mail-a93.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a93.g.dreamhost.com (Postfix) with ESMTP id 9826E7ED6B for ; Sun, 22 Dec 2019 08:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=jidanni.org; bh=P9kR7wUIs63cYSeAq6 JreVp0UK0=; b=Bz9Ye3s/HoxvEVHp+yfBr4QNRr81HAclAQ4QBn7SL0T1Cp76cu WW025fOSTh3s1ZtB+8YYYn5uNlxO3MIU5ZYsOKSOspsVCJQ9BBIekm0WLOI7R87z kDhF3GQLyEW+kjHxVZwTekthBchF1H89Z5nQnI52/MHWTKW+3In/8ipbE= Received: from jidanni.org (220-140-4-157.dynamic-ip.hinet.net [220.140.4.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a93.g.dreamhost.com (Postfix) with ESMTPSA id 2E55A7ED69 for ; Sun, 22 Dec 2019 08:37:29 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a93 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-gnu-emacs@gnu.org Subject: dired-do-rename doesn't check for "/" ! Date: Mon, 23 Dec 2019 00:37:26 +0800 Message-ID: <87d0cge2pl.5.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddukedgkeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkgggtgfesthekredttddtjeenucfhrhhomhepnjjnnjcuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqnecukfhppedvvddtrddugedtrdegrdduheejnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjihgurghnnhhirdhorhhgpdhinhgvthepvddvtddrudegtddrgedrudehjedprhgvthhurhhnqdhprghthheppeeruhhtfhdqkeerueerheeimhfphefnihehhegsveekreepucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqedpmhgrihhlfhhrohhmpehjihgurghnnhhisehjihgurghnnhhirdhorhhgpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.3 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) R runs the command dired-do-rename (found in dired-mode-map), which is an interactive autoloaded compiled Lisp function in =E2=80=98dired-aux.el= =E2=80=99. But it has a big bug. Let's say you tell it to rename qqq to "xxx/yyy/zzz/". And it works. You get xxx/yyy/zzz/qqq But if there is no directory zzz, then one day you will discover you got xxx/yyy/qqq . Real "mv" doesn't have this bug. $ mv k /tmp/p/ mv: cannot create regular file '/tmp/p/': Not a directory dired-do-rename perhaps under the hood does the "mv" action, but instead of reporting the failure, tries again with the final slash removed! emacs-version "26.3" From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 23 23:29:08 2019 Received: (at 38707) by debbugs.gnu.org; 24 Dec 2019 04:29:08 +0000 Received: from localhost ([127.0.0.1]:51903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijboh-0006Nv-Q5 for submit@debbugs.gnu.org; Mon, 23 Dec 2019 23:29:08 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ijbof-0006NR-ER for 38707@debbugs.gnu.org; Mon, 23 Dec 2019 23:29:06 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EA28521FBA for <38707@debbugs.gnu.org>; Mon, 23 Dec 2019 23:28:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 23 Dec 2019 23:28:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenpoint.co.nz; h=to:subject:references:from:date:in-reply-to:message-id :mime-version:content-type; s=fm2; bh=QXU2ovZfBw5IlCrSyN0CHq9h/1 hA56KFeWK7Hd8gHGU=; b=eVP4hTc1SOxnr2w3X9hHq6rROwBlxlOdQSUYVd9meu yD7Xr8N+Fb91rOTo0AqHxtcfRu6YLRA61aaRY8f6fu7RyvqFiTtXxEjl0YHXyHKc qD9mQrgLUYuo4vWBgBel40vREgA4lhTr+j9P4aH6TvxhW5yb/u14jjEvRCzUBdI0 lMsgtJ3qoUQ2SdPsTvMYF5uPznN84kY1e7nQEGw7NwxKG06JP+f+DgAX9tPfD3qf Mldxp1PuO2egfLOrQEyPr/RgOKD9t4NphxCodbQ3nhpSJEO0kWQGvO4Wjec8N6qk MbPMsoT4m/CF0ex0+axjXkNEU0d+ibX9JkHHVfN01bEA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=QXU2ov ZfBw5IlCrSyN0CHq9h/1hA56KFeWK7Hd8gHGU=; b=fi7ocDxSi/OXv7pGH2Bcws eLh7n4CrUoodW+cuzUT2iPbce7wL//Y0Bd4MMoFTTqenI2nZ6wx+p3K8ijmrgULA DIbqie6XSovIaOUcrlndtzgd4FiFvqebYjFOa6LP3HiBON4MTFc0dsg+8aFgR0el gIQb/P9BtDt1LWiQqynblY+CLC96BAVvny65GPxSWQ3DAhdXGaMqicdoTlh5mmDp wANCD0QSGeagmpMKtCdqSehepTV1Xf+EOwJqSzxV9SbXO2F2Hv0kdKcZbWSGrmH8 lyeYaNM2aCfiaXhg14zEK/oC7FPeOhJnl5oJI/x6NbP2NPKQtRiT0M8HTqnqCERQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddvuddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefvufhfhfffjgfkfgggtgesthdtre dttdertdenucfhrhhomheppfhitghkucfjvghlmhcuoehnihgtkhesthgvnhhpohhinhht rdgtohdrnhiiqeenucfkphepuddvhedrvdefledruddvtddrudeltdenucfrrghrrghmpe hmrghilhhfrhhomhepnhhitghksehtvghnphhoihhnthdrtghordhniienucevlhhushht vghrufhiiigvpedt X-ME-Proxy: Received: from jupiter.local (125-239-120-190-vdsl.sparkbb.co.nz [125.239.120.190]) by mail.messagingengine.com (Postfix) with ESMTPA id AD6A58005C for <38707@debbugs.gnu.org>; Mon, 23 Dec 2019 23:28:58 -0500 (EST) To: 38707@debbugs.gnu.org Subject: Re: bug#38707: dired-do-rename doesn't check for "/" ! References: <87d0cge2pl.5.fsf@jidanni.org> From: Nick Helm Date: Tue, 24 Dec 2019 17:28:55 +1300 In-Reply-To: <87d0cge2pl.5.fsf@jidanni.org> (=?utf-8?B?IuepjeS4ueWwvA==?= Dan Jacobson"'s message of "Mon, 23 Dec 2019 00:37:26 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 38707 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Dan Jacobson writes: > Let's say you tell it to rename qqq to "xxx/yyy/zzz/". > > And it works. > > You get xxx/yyy/zzz/qqq > > But if there is no directory zzz, > then one day you will discover you got > > xxx/yyy/qqq . I'm not sure this is actually a bug, but it looks like the behaviour happens because of these lines in dired-do-create-files. ;; rename-file bombs when moving directories unless we do this: (or into-dir (setq target (directory-file-name target))) Dired could check for and issue an error in the case where the source is a file and the target appears to be a non-existent directory. Something like this perhaps? --- a/lisp/dired-aux.el 2019-12-23 15:12:26.000000000 +1300 +++ b/lisp/dired-aux.el 2019-12-23 15:18:17.000000000 +1300 @@ -1878,6 +1878,10 @@ (apply (car into-dir) operation rfn-list fn-list target (cdr into-dir)) (if (not (or dired-one-file into-dir)) (error "Marked %s: target must be a directory: %s" operation target)) + (if (and (not (file-directory-p (car fn-list))) + (not (file-directory-p target)) + (directory-name-p target)) + (error "%s: Target directory does not exist: %s" operation target)) ;; rename-file bombs when moving directories unless we do this: (or into-dir (setq target (directory-file-name target))) (dired-create-files Nick From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 06 06:14:06 2020 Received: (at 38707) by debbugs.gnu.org; 6 Aug 2020 10:14:06 +0000 Received: from localhost ([127.0.0.1]:53202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3cuT-0005jE-VA for submit@debbugs.gnu.org; Thu, 06 Aug 2020 06:14:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3cuS-0005iX-89 for 38707@debbugs.gnu.org; Thu, 06 Aug 2020 06:14:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SJZtuZnCyN2BZArK5tmw2Qi79zYC7DGXZco3EcWovj0=; b=gM6C9GK24iYGU05Oc6wyxWMVVr u03aXDFgCgibvmHC/dphr0ZRVueoLR5qqvI5P1UaMCN6b51r6q3cbgJZjkMfY1HIlJzciuuI6O6X7 PMfYI9lIJsvkm8fRTuuC4Sr0p4mgcISvISV9AOPhE0KwWRjVw1lRkmIB+LjtDA6bEcgc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3cuD-00008F-Bb; Thu, 06 Aug 2020 12:13:57 +0200 From: Lars Ingebrigtsen To: Nick Helm Subject: Re: bug#38707: dired-do-rename doesn't check for "/" ! References: <87d0cge2pl.5.fsf@jidanni.org> Date: Thu, 06 Aug 2020 12:13:48 +0200 In-Reply-To: (Nick Helm's message of "Tue, 24 Dec 2019 17:28:55 +1300") Message-ID: <87wo2cdqub.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Nick Helm writes: > Dired could check for and issue an error in the case where the source is > a file and the target appears to be a non-existent directory. Something > like this perhaps? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38707 Cc: 38707@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Nick Helm writes: > Dired could check for and issue an error in the case where the source is > a file and the target appears to be a non-existent directory. Something > like this perhaps? [...] > + (if (and (not (file-directory-p (car fn-list))) > + (not (file-directory-p target)) > + (directory-name-p target)) > + (error "%s: Target directory does not exist: %s" operation target)) I think this makes sense, so I've applied it to Emacs 28.1. However, it is a slight behavioural change -- previously you could enter, say "/tmp/bar/" (when moving one file), and it would move the file to the file "/tmp/bar". I think the new behaviour is better (i.e., bugging out), but if people complain for some reason, then it should perhaps be reverted. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 06 06:14:11 2020 Received: (at control) by debbugs.gnu.org; 6 Aug 2020 10:14:11 +0000 Received: from localhost ([127.0.0.1]:53205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3cuZ-0005jU-60 for submit@debbugs.gnu.org; Thu, 06 Aug 2020 06:14:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k3cuX-0005j1-Rq for control@debbugs.gnu.org; Thu, 06 Aug 2020 06:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kqW/a0vWNVHXKLxaVlqsEcBPAfDO7dR5ucibYeVmw6k=; b=YS8HhuT3CPhaBnF1jY0ld0fvde tvbmprZoJvs3wtv52M8GbcXH1cXqs4XeovZzBz73QS/D7uIr2kdToaMZJwU+2lyqfzvHs+Vy8UKC0 Ux3OS76rkiOQjeqs5SY5eq+HxSCmRItPgdUOTdeRWQeh/JAU05QFyjvAdU1jQCZcFLB0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k3cuQ-00008M-5J for control@debbugs.gnu.org; Thu, 06 Aug 2020 12:14:04 +0200 Date: Thu, 06 Aug 2020 12:14:00 +0200 Message-Id: <87v9hwdqtz.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #38707 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 38707 fixed close 38707 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 38707 fixed close 38707 28.1 quit From unknown Wed Jun 18 23:13:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 03 Sep 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator