From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Pucci Newsgroups: gmane.emacs.bugs Subject: bug#8035: Processing of .. in a file path after going thru symlink Date: Sat, 19 Feb 2011 18:35:35 -0800 Message-ID: References: <00lj1bd7ty.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: dough.gmane.org 1298171249 24272 80.91.229.12 (20 Feb 2011 03:07:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Feb 2011 03:07:29 +0000 (UTC) Cc: 8035@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 20 04:07:22 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pqzdq-0008Cp-4H for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Feb 2011 04:07:22 +0100 Original-Received: from localhost ([127.0.0.1]:46109 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pqzdn-0000Kn-Ko for geb-bug-gnu-emacs@m.gmane.org; Sat, 19 Feb 2011 22:07:19 -0500 Original-Received: from [140.186.70.92] (port=57700 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqzdB-0000A1-RD for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 22:06:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqzdA-0006ME-79 for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 22:06:41 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqzdA-0006Lz-4D for bug-gnu-emacs@gnu.org; Sat, 19 Feb 2011 22:06:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PqzO1-0007g1-Pq; Sat, 19 Feb 2011 21:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Steve Pucci Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Feb 2011 02:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8035 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.129817024629480 (code B ref 8035); Sun, 20 Feb 2011 02:51:01 +0000 Original-Received: (at 8035) by debbugs.gnu.org; 20 Feb 2011 02:50:46 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PqzNk-0007fQ-OK for submit@debbugs.gnu.org; Sat, 19 Feb 2011 21:50:45 -0500 Original-Received: from asmtpout023.mac.com ([17.148.16.98]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pqz9Q-0007KL-Tl for 8035@debbugs.gnu.org; Sat, 19 Feb 2011 21:35:57 -0500 Original-Received: from [192.168.1.9] (montevina-mk.surfnetc.com [64.74.213.194]) by asmtp023.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPA id <0LGW008469VBY130@asmtp023.mac.com> for 8035@debbugs.gnu.org; Sat, 19 Feb 2011 18:35:37 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-02-20_02:2011-02-19, 2011-02-20, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1102190143 In-reply-to: <00lj1bd7ty.fsf@fencepost.gnu.org> X-Mailer: Apple Mail (2.1082) X-Mailman-Approved-At: Sat, 19 Feb 2011 21:50:43 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 19 Feb 2011 21:51:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Sat, 19 Feb 2011 22:07:13 -0500 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:44275 Archived-At: On Feb 19, 2011, at 1:37 PM, Glenn Morris wrote: > This appears to be a feature of expand-file-name (and possibly other > things). It does seem a little weird that there isn't even an option to > have a more thorough expansion... So I ran an experiment, redefining expand-file-name as follows to skip the ".." processing (except in default-directory) and otherwise do the rest: (or (fboundp 'save-expand-file-name) (fset 'save-expand-file-name (symbol-function 'expand-file-name))) (defun expand-file-name (NAME &optional DEFAULT-DIRECTORY) (cond ((string-match "^/" NAME) NAME) ((string-match "^\\(~[^/]*\\)\\(.*\\)$" NAME) (let ((userdir (match-string 1 NAME)) (rest (match-string 2 NAME))) (concat (save-expand-file-name userdir) rest))) (t (concat (save-expand-file-name (if DEFAULT-DIRECTORY DEFAULT-DIRECTORY default-directory)) NAME)))) While this does the trick (it expands only ~ and relative paths and properly leaves the OP path intact), it fails to fix the problem with next-error. So I conclude you're right there are other places that do the same thing, apparently. My workaround now is to wrap my build script in a Perl script which rewrites all "../" paths it finds within its output. So I'm ok, though I'm surprised this hasn't come up before...