From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#28483: [PATCH] Fix copy-directory creating missing directory Date: Sun, 17 Sep 2017 19:48:44 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113cc362828410055967ea80" X-Trace: blaine.gmane.org 1505677809 18619 195.159.176.226 (17 Sep 2017 19:50:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Sep 2017 19:50:09 +0000 (UTC) To: Aaron Jensen , 28483@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 17 21:50:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtfZt-0004eH-BS for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Sep 2017 21:50:05 +0200 Original-Received: from localhost ([::1]:33515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtfa0-0002LX-RS for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Sep 2017 15:50:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtfZu-0002Jy-Kr for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2017 15:50:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtfZq-0000V8-IW for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2017 15:50:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtfZq-0000Ut-DX for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2017 15:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dtfZp-00086g-TF for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2017 15:50:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2017 19:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28483 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28483-submit@debbugs.gnu.org id=B28483.150567774231084 (code B ref 28483); Sun, 17 Sep 2017 19:50:01 +0000 Original-Received: (at 28483) by debbugs.gnu.org; 17 Sep 2017 19:49:02 +0000 Original-Received: from localhost ([127.0.0.1]:45283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtfYr-00085H-PS for submit@debbugs.gnu.org; Sun, 17 Sep 2017 15:49:02 -0400 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:51317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtfYq-00084M-9W for 28483@debbugs.gnu.org; Sun, 17 Sep 2017 15:49:00 -0400 Original-Received: by mail-io0-f174.google.com with SMTP id l15so14372871iol.8 for <28483@debbugs.gnu.org>; Sun, 17 Sep 2017 12:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=f3VekUZXunKHS+cIPGYtvbRWiz1f5DZRxBKwetxFe4k=; b=B94YrX6yrhUw2CisEaIEKbugz/05P9e8Yl2d1utKTh8NUncvUhDGpRboajNFy1w3QS RIA8MB4nt5NLTZ7INluzLgIWN96TPg2c15t26Xe/6olG2w/QZ/ta8ZSudOGQwNzXTZLA cfA7JzIxuWi5XwyLE6tx40ZL6qmOr9EbxobAMPiAU5L7dx/HXqLhOeRXoG5zxV0noK1p QG7vw39kI0tpAYUL9SdkXryOoEq36Q8IpmrSjWu2sFn67OdtKaSfWqIM4Pl6yvsQpy/v BeU4JbuhuoG7e3yfxwOeuq7XSCVQogPueRlCZMSv00sndDnxQszOxIFsRaMbfjpGHrZU UA8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=f3VekUZXunKHS+cIPGYtvbRWiz1f5DZRxBKwetxFe4k=; b=j1tpBd8qB+f5/L4VA9TlBt1q0H9AIMVsLiO0aVY6i6TCKp22JORZnKvrJNjKTIkRpY HMCo/ZYp0mUJO4C2ceJiHTQM9D5MqM+Pr9FPJnfK58FknnyvSdytuCrFWDzptRBOBaR4 tF78nXLVIPpm7pAdEzjW+GRj4gbV1nTjIycwidbGnvTk3OWoxjpfDAT1bO+0DCjZlCQd 4G75RXxb0PfCN0nNMXymPDG6k/s/FPx1szCubrdlVjy400W6Nst/JxNQNnapQrcvdSt7 7HCj9KcJZto2D3n+9Dv5QBTbhRfev+eiohT/YgDWxTbG9pbKZhmFEJaF1gRCeUjN0q0T tWBg== X-Gm-Message-State: AHPjjUiwV6K5d0LxufACLDgV87bWRMwBxPAUDgh5Td4k8Sp9aqRqL/6+ XDFz5OEhF1UwYqJ7CSZoL2N+ibVZN7H7uAwbKyM= X-Google-Smtp-Source: AOwi7QCA039leXC++BplvrjdOACztLH/KDSqCObr+YiTjlOG3iHC7sqAtPRTfm6Ci/yDxmbDTSCgs+1CyvBeUEb1uaA= X-Received: by 10.202.171.147 with SMTP id u141mr15747475oie.312.1505677734477; Sun, 17 Sep 2017 12:48:54 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137035 Archived-At: --001a113cc362828410055967ea80 Content-Type: text/plain; charset="UTF-8" Aaron Jensen schrieb am So., 17. Sep. 2017 um 21:16 Uhr: > * lisp/files.el (copy-directory): Use file-directory-p instead of > directory-name-p. > --- > lisp/files.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/files.el b/lisp/files.el > index c55c8097c1..b3a55af976 100644 > --- a/lisp/files.el > +++ b/lisp/files.el > @@ -5540,7 +5540,7 @@ copy-directory > (setq directory (directory-file-name (expand-file-name directory)) > newname (expand-file-name newname)) > > - (cond ((not (directory-name-p newname)) > + (cond ((not (file-directory-p newname)) > ;; If NEWNAME is not a directory name, create it; > ;; that is where we will copy the files of DIRECTORY. > (make-directory newname parents)) > This would reintroduce the security hole that e22794867d878d53675fcc91d2ef1ad2494a2ff2 fixed. Paul, maybe you want to add some comments to the places where you introduced `directory-name-p' so that people don't attempt to revert these changes? --001a113cc362828410055967ea80 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


--001a113cc362828410055967ea80--