From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: spucci Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Feb 2011 05:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8035 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8035@debbugs.gnu.org X-Debbugs-Original-To: Bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.12976625976192 (code B ref -1); Mon, 14 Feb 2011 05:50:03 +0000 Received: (at submit) by debbugs.gnu.org; 14 Feb 2011 05:49:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PorJs-0001bo-GL for submit@debbugs.gnu.org; Mon, 14 Feb 2011 00:49:57 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PoocL-00055G-0j for submit@debbugs.gnu.org; Sun, 13 Feb 2011 21:56:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pooky-00053g-Du for submit@debbugs.gnu.org; Sun, 13 Feb 2011 22:05:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:42702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pooky-00053c-AH for submit@debbugs.gnu.org; Sun, 13 Feb 2011 22:05:44 -0500 Received: from [140.186.70.92] (port=56429 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pookx-00050W-7U for Bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 22:05:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pookw-00053P-2P for Bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 22:05:43 -0500 Received: from sam.nabble.com ([216.139.236.26]:48349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pookv-00053E-ND for Bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 22:05:41 -0500 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Pooku-00036J-DZ for Bug-gnu-emacs@gnu.org; Sun, 13 Feb 2011 19:05:40 -0800 Message-ID: <30918394.post@talk.nabble.com> Date: Sun, 13 Feb 2011 19:05:40 -0800 (PST) From: spucci MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: slpnabble@blackberry-hill.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 216.139.236.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Mon, 14 Feb 2011 00:49:56 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) The behavior is general, but it's a particular problem with next-error: When emacs attempts to find a file with "../" as a path component, it appears to be "smart" about it and simply remove the previous directory path (e.g., "foo/bar/../x" gets converted to "foo/x"). But if bar is a symlink, then it doesn't properly find the file. So in compiler output, which references such files, the next-error function fails to find the file with the given name. mkdir dest mkdir dest/subdir mkdir src ln -s ../dest/subdir src/subdir echo "#error This is an error" > dest/foo.c Now M-x compile, and give it cc -c src/subdir/../foo.c *compilation* buffer has: cc -c src/subdir/../foo.c src/subdir/../foo.c:1:2: error: #error This is an error and do a next-error: Emacs complains it can't find the file. And if you try to find-file that file path (src/subdir/../foo.c) it doesn't work either. Nor does "emacsclient src/subdir/../foo.c. I couldn't find an option to disable this behavior; it seems like there should be one even if the default continues to be as it is today. This is Gnu Emacs 23.2.1 I built myself on MacOS X 10.6.6. Thanks, Steve -- View this message in context: http://old.nabble.com/Processing-of-..-in-a-file-path-after-going-thru-symlink-tp30918394p30918394.html Sent from the Emacs - Bugs mailing list archive at Nabble.com. From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Feb 2011 21:38: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: To: spucci Cc: 8035@debbugs.gnu.org Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.129815146032585 (code B ref 8035); Sat, 19 Feb 2011 21:38:01 +0000 Received: (at 8035) by debbugs.gnu.org; 19 Feb 2011 21:37:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PquUl-0008TW-Km for submit@debbugs.gnu.org; Sat, 19 Feb 2011 16:37:39 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PquUh-0008T6-GR for 8035@debbugs.gnu.org; Sat, 19 Feb 2011 16:37:36 -0500 Received: from localhost ([127.0.0.1]:53928) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PquUc-0003Y4-0r; Sat, 19 Feb 2011 16:37:30 -0500 From: Glenn Morris References: <30918394.post@talk.nabble.com> X-Spook: S Box ANDVT Kosovo industrial espionage rail gun Israel X-Ran: qdK4NFw1Io(iF7\KUwJv)W2j^,>tq%@}av$%+-DwSizUk<*#1vfAW/E~,hIswBKl>p`v_5 X-Hue: white X-Attribution: GM Date: Sat, 19 Feb 2011 16:37:29 -0500 In-Reply-To: <30918394.post@talk.nabble.com> (spucci's message of "Sun, 13 Feb 2011 19:05:40 -0800 (PST)") Message-ID: <00lj1bd7ty.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) spucci wrote: > When emacs attempts to find a file with "../" as a path component, it > appears to be "smart" about it and simply remove the previous directory path > (e.g., "foo/bar/../x" gets converted to "foo/x"). But if bar is a symlink, > then it doesn't properly find the file. 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... From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink 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: To: Glenn Morris Cc: 8035@debbugs.gnu.org Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.129817024629480 (code B ref 8035); Sun, 20 Feb 2011 02:51:01 +0000 Received: (at 8035) by debbugs.gnu.org; 20 Feb 2011 02:50:46 +0000 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 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 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII 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 From: Steve Pucci In-reply-to: <00lj1bd7ty.fsf@fencepost.gnu.org> Date: Sat, 19 Feb 2011 18:35:35 -0800 Message-id: References: <00lj1bd7ty.fsf@fencepost.gnu.org> X-Mailer: Apple Mail (2.1082) X-Spam-Score: -2.6 (--) 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) 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... From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink 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:02 +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: To: Glenn Morris , 8035@debbugs.gnu.org Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.129817024629483 (code B ref 8035); Sun, 20 Feb 2011 02:51:02 +0000 Received: (at 8035) by debbugs.gnu.org; 20 Feb 2011 02:50:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PqzNl-0007fT-4e for submit@debbugs.gnu.org; Sat, 19 Feb 2011 21:50:45 -0500 Received: from asmtpout029.mac.com ([17.148.16.104]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PqzEg-0007Rk-3a for 8035@debbugs.gnu.org; Sat, 19 Feb 2011 21:41:22 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from [192.168.1.9] (montevina-mk.surfnetc.com [64.74.213.194]) by asmtp029.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPA id <0LGW001EGA4O7280@asmtp029.mac.com> for 8035@debbugs.gnu.org; Sat, 19 Feb 2011 18:41:16 -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-1102190144 From: Steve Pucci In-reply-to: Date: Sat, 19 Feb 2011 18:41:11 -0800 Message-id: <39D26BEB-205A-469C-B0A1-A02548C4BAC2@mac.com> References: <00lj1bd7ty.fsf@fencepost.gnu.org> X-Mailer: Apple Mail (2.1082) X-Spam-Score: -2.6 (--) 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 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Feb 19, 2011, at 6:35 PM, Steve Pucci wrote: > So I conclude you're right there are other places that do the same thing, apparently. Well, my experiment didn't intercept the (literally) 98 places that call Fexpand_file_name() directly from the C code, of course... From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 16:31: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: To: spucci Cc: 8035@debbugs.gnu.org Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.162999541121792 (code B ref 8035); Thu, 26 Aug 2021 16:31:01 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 16:30:11 +0000 Received: from localhost ([127.0.0.1]:50239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIGZ-0005fP-HF for submit@debbugs.gnu.org; Thu, 26 Aug 2021 12:30:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIGY-0005e6-0e for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 12:30:10 -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=6MCg+dIBhdWXOvEo5cZc1/XpQshvgENM0JuBMQAe3R8=; b=qF3PtyeZYwk/YE2+y3vvxFAXiu WUB3+1KlZZA2r+Ic4vRktE0CatNIPpBe+5DB/8bbw32kU3rl/iW5QsxTSr80HQDdiyvdOUaosUjRz G/oLz8FGOt9us6mt7Kx1SqVFF2gOLmU2OlJqzkyv2bi4yltQGGURfRLUzPtyaut4l99s=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJIGM-0002vx-8k; Thu, 26 Aug 2021 18:30:02 +0200 From: Lars Ingebrigtsen References: <30918394.post@talk.nabble.com> Date: Thu, 26 Aug 2021 18:29:54 +0200 In-Reply-To: <30918394.post@talk.nabble.com> (spucci's message of "Sun, 13 Feb 2011 19:05:40 -0800 (PST)") Message-ID: <877dg8yxrx.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: spucci writes: > When emacs attempts to find a file with "../" as a path component, it > appears to be "smart" about it and simply remove the previous directory path > (e.g., "foo/bar/../x" gets converted to "foo/x" [...] 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: -2.3 (--) 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: -3.3 (---) spucci writes: > When emacs attempts to find a file with "../" as a path component, it > appears to be "smart" about it and simply remove the previous directory path > (e.g., "foo/bar/../x" gets converted to "foo/x"). But if bar is a symlink, > then it doesn't properly find the file. So in compiler output, which > references such files, the next-error function fails to find the file with > the given name. > > mkdir dest > mkdir dest/subdir > mkdir src > ln -s ../dest/subdir src/subdir > echo "#error This is an error" > dest/foo.c > > Now M-x compile, and give it cc -c src/subdir/../foo.c > > *compilation* buffer has: > cc -c src/subdir/../foo.c > src/subdir/../foo.c:1:2: error: #error This is an error > > and do a next-error: Emacs complains it can't find the file. This is an even more foundational problem: (file-exists-p "/tmp/comp/src/subdir/../foo.c") => nil (file-truename "/tmp/comp/src/subdir/../foo.c") => "/tmp/comp/dest/foo.c" (file-exists-p (file-truename "/tmp/comp/src/subdir/../foo.c")) => t And this is because: static Lisp_Object check_file_access (Lisp_Object file, Lisp_Object operation, int amode) { file = Fexpand_file_name (file, Qnil); I'm guessing it's calling expand-file-name here to resolve "~"? It's also a micro-optimisation, I guess -- collapsing "parent/.." textually without checking the file system is very cheap. But... this does mean that `file-exists-p' and friends are unreliable in the presence of symlinks, which is pretty depressing. I think that `expand-file-name' call in check_file_access should be changed to something that just does the "~" expansion. Any opinions? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 12:30:19 2021 Received: (at control) by debbugs.gnu.org; 26 Aug 2021 16:30:19 +0000 Received: from localhost ([127.0.0.1]:50242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIGg-0005fk-Rf for submit@debbugs.gnu.org; Thu, 26 Aug 2021 12:30:18 -0400 Received: from quimby.gnus.org ([95.216.78.240]:48960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIGf-0005fX-7j for control@debbugs.gnu.org; Thu, 26 Aug 2021 12:30:17 -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=qqX42Iy7WuNXjAuLiFGnxIgmam66dVDSoDl3hl1vLyg=; b=HE8fu4Ou3yoS/Cu1DqS9dOiLig zV8Gln8ZlJ5U6db/erJYFCai+uMcQQafCrVZ6ark3JlbGDkyS22phxnw3Oz4F8fL1HQnCnB7BA9kw c17zCWLs2Ssm+XOVXjnevb53zkD3iA84T5QLwP136IzOITFfK81vQnWX1I4C4WxBCpyM=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJIGW-0002wC-U2 for control@debbugs.gnu.org; Thu, 26 Aug 2021 18:30:11 +0200 Date: Thu, 26 Aug 2021 18:30:06 +0200 Message-Id: <875yvsyxrl.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #8035 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 8035 + moreinfo 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: -2.3 (--) 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: -3.3 (---) tags 8035 + moreinfo quit From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 16:45:02 +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: moreinfo To: Lars Ingebrigtsen Cc: 8035@debbugs.gnu.org, slpnabble@blackberry-hill.com Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.162999628123248 (code B ref 8035); Thu, 26 Aug 2021 16:45:02 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 16:44:41 +0000 Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIUb-00062u-I3 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 12:44:41 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIUZ-00062h-Iq for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 12:44:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42918) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIUT-0003si-IE; Thu, 26 Aug 2021 12:44:33 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2161 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIUS-0007Zj-6W; Thu, 26 Aug 2021 12:44:33 -0400 Date: Thu, 26 Aug 2021 19:44:11 +0300 Message-Id: <83sfywrw9w.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <877dg8yxrx.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 26 Aug 2021 18:29:54 +0200) References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Lars Ingebrigtsen > Date: Thu, 26 Aug 2021 18:29:54 +0200 > Cc: 8035@debbugs.gnu.org > > (file-exists-p "/tmp/comp/src/subdir/../foo.c") > => nil > (file-truename "/tmp/comp/src/subdir/../foo.c") > => "/tmp/comp/dest/foo.c" > (file-exists-p (file-truename "/tmp/comp/src/subdir/../foo.c")) > => t > > And this is because: > > static Lisp_Object > check_file_access (Lisp_Object file, Lisp_Object operation, int amode) > { > file = Fexpand_file_name (file, Qnil); > > I'm guessing it's calling expand-file-name here to resolve "~"? No, because we always must call expand-file-name before invoking a libc function that accesses files -- to support file names relative to their buffer's default-directory. > I think that `expand-file-name' call in check_file_access should be > changed to something that just does the "~" expansion. I don't think we can do that, for the reason explained above. From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 16:54:02 +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: moreinfo To: Lars Ingebrigtsen Cc: 8035@debbugs.gnu.org, spucci Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.162999682432534 (code B ref 8035); Thu, 26 Aug 2021 16:54:02 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 16:53:44 +0000 Received: from localhost ([127.0.0.1]:50292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIdI-0008SZ-P0 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 12:53:44 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:43520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIdD-0008SN-7k for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 12:53:39 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4GwTSY3h3wz1rk4s; Thu, 26 Aug 2021 18:53:32 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4GwTSX3q2Nz1r6PH; Thu, 26 Aug 2021 18:53:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 1LJkg7ABJGOD; Thu, 26 Aug 2021 18:53:31 +0200 (CEST) X-Auth-Info: 8TWX5DUMkIzeUjDD/mzMjoA8qtGXHXwr60EzjTBGVA2HxPP7ytJAIYmSW8+HhZ1y Received: from igel.home (ppp-46-244-172-67.dynamic.mnet-online.de [46.244.172.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 26 Aug 2021 18:53:31 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 5E1072C2664; Thu, 26 Aug 2021 18:53:31 +0200 (CEST) From: Andreas Schwab References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> X-Yow: My life is a patio of fun! Date: Thu, 26 Aug 2021 18:53:31 +0200 In-Reply-To: <877dg8yxrx.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Aug 2021 18:29:54 +0200") Message-ID: <875yvstaes.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) 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.5 (-) On Aug 26 2021, Lars Ingebrigtsen wrote: > But... this does mean that `file-exists-p' and friends are unreliable > in the presence of symlinks, This is not true. It is consistent with all other file handling functions in Emacs. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:04:02 +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: moreinfo To: Eli Zaretskii Cc: 8035@debbugs.gnu.org, slpnabble@blackberry-hill.com Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299974211144 (code B ref 8035); Thu, 26 Aug 2021 17:04:02 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:03:41 +0000 Received: from localhost ([127.0.0.1]:50300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJImz-0000IO-IM for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:03:41 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJImx-0000Hw-NA for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:03:40 -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=Dg0W/Vdzka6m/z68bSegA9QDBa5aLRn1essrww464sA=; b=R7287ua9bLEOuNBziVDmfRWJdU qeJEH66ORU4Mu/PQVe/vxjgyVZXc8bcmdlf66fE+FQ84V+hemeXTgPdcBG/yP+Q0QoJj+zMIDraM8 sTs5EVjolO4FCAc8ykN052mY5zdXdPuAzLzC+Hck3lHaVBwNLrqyRP0PfUnPG+DGSItk=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJImm-0003DR-4a; Thu, 26 Aug 2021 19:03:32 +0200 From: Lars Ingebrigtsen References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <83sfywrw9w.fsf@gnu.org> Date: Thu, 26 Aug 2021 19:03:24 +0200 In-Reply-To: <83sfywrw9w.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Aug 2021 19:44:11 +0300") Message-ID: <87sfywxhnn.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: Eli Zaretskii writes: >> I'm guessing it's calling expand-file-name here to resolve "~"? > > No, because we always must call expand-file-name before invoking a > libc function that accesses files -- to support file names r [...] 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: -2.3 (--) 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: -3.3 (---) Eli Zaretskii writes: >> I'm guessing it's calling expand-file-name here to resolve "~"? > > No, because we always must call expand-file-name before invoking a > libc function that accesses files -- to support file names relative to > their buffer's default-directory. These are absolute file names, though. I can understand expanding if they're not. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:05: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: moreinfo To: Andreas Schwab Cc: 8035@debbugs.gnu.org, spucci Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299974821259 (code B ref 8035); Thu, 26 Aug 2021 17:05:01 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:04:42 +0000 Received: from localhost ([127.0.0.1]:50305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJInx-0000KF-Ru for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:04:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJInw-0000K2-0k for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:04:40 -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=B3l2dXnuz9sfhKRV3k+AQkUFNtUFB2miSzuH5cn3xxM=; b=IZvg9V9c0assNvVfrBe0mqAZUc sU3opDdXDFrYxcy2KTOcS+v3kPpy3VtDGPaie3va0Lup+Lrr3HwgnvsBNFiXalrqiAuDvldDsis6X WwNAnQaZ8737ytHM7sc+heaHrlb9QslcmVCJfyf0FJXDkKnTKuTRPAnZS8CYYEuz4HT0=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJInk-0003Fw-R1; Thu, 26 Aug 2021 19:04:33 +0200 From: Lars Ingebrigtsen References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <875yvstaes.fsf@igel.home> Date: Thu, 26 Aug 2021 19:04:28 +0200 In-Reply-To: <875yvstaes.fsf@igel.home> (Andreas Schwab's message of "Thu, 26 Aug 2021 18:53:31 +0200") Message-ID: <87o89kxhlv.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: Andreas Schwab writes: > On Aug 26 2021, Lars Ingebrigtsen wrote: > >> But... this does mean that `file-exists-p' and friends are unreliable >> in the presence of symlinks, > > This is not true. It is consistent with all ot [...] 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: -2.3 (--) 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: -3.3 (---) Andreas Schwab writes: > On Aug 26 2021, Lars Ingebrigtsen wrote: > >> But... this does mean that `file-exists-p' and friends are unreliable >> in the presence of symlinks, > > This is not true. It is consistent with all other file handling > functions in Emacs. I don't see a contradiction between `file-exists-p' being unreliable and being consistent with all other file handling functions in Emacs. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:10: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: moreinfo To: Lars Ingebrigtsen Cc: 8035@debbugs.gnu.org, slpnabble@blackberry-hill.com Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299977421782 (code B ref 8035); Thu, 26 Aug 2021 17:10:01 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:09:02 +0000 Received: from localhost ([127.0.0.1]:50317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIs9-0000Sb-S7 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:09:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJIs5-0000S3-3k for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:09:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43624) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJIry-0003jO-TT; Thu, 26 Aug 2021 13:08:51 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3685 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJIry-0000G8-G6; Thu, 26 Aug 2021 13:08:50 -0400 Date: Thu, 26 Aug 2021 20:08:30 +0300 Message-Id: <83mtp4rv5d.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87sfywxhnn.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 26 Aug 2021 19:03:24 +0200) References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <83sfywrw9w.fsf@gnu.org> <87sfywxhnn.fsf@gnus.org> X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Lars Ingebrigtsen > Cc: slpnabble@blackberry-hill.com, 8035@debbugs.gnu.org > Date: Thu, 26 Aug 2021 19:03:24 +0200 > > Eli Zaretskii writes: > > >> I'm guessing it's calling expand-file-name here to resolve "~"? > > > > No, because we always must call expand-file-name before invoking a > > libc function that accesses files -- to support file names relative to > > their buffer's default-directory. > > These are absolute file names, though. I can understand expanding if > they're not. You asked why expand-file-name is there in general, so I gave a general explanation. expand-file-name also normalizes file names, though. Which is also needed in some use cases, e.g. when the /foo/bar/ isn't accessible, but /foo/ is, in which case failing to normalize /foo/bar/../quux could fail some file I/O function. From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:21:02 +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: moreinfo To: Lars Ingebrigtsen Cc: 8035@debbugs.gnu.org, spucci Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299984053089 (code B ref 8035); Thu, 26 Aug 2021 17:21:02 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:20:05 +0000 Received: from localhost ([127.0.0.1]:50326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJ2q-0000nl-Jj for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:20:04 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:50754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJ2o-0000nF-Bd for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:20:03 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4GwV346Pdzz1qwGb; Thu, 26 Aug 2021 19:20:00 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4GwV343cR8z1r6PJ; Thu, 26 Aug 2021 19:20:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id c635tITtri-4; Thu, 26 Aug 2021 19:19:59 +0200 (CEST) X-Auth-Info: uAMVIZclcifZPF3cC866GcU8Ds7TAAOmsHJSSfKnXEkl++iSX+zECTlNynT1IuK4 Received: from igel.home (ppp-46-244-172-67.dynamic.mnet-online.de [46.244.172.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 26 Aug 2021 19:19:59 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id B9B5E2C2664; Thu, 26 Aug 2021 19:19:58 +0200 (CEST) From: Andreas Schwab References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <875yvstaes.fsf@igel.home> <87o89kxhlv.fsf@gnus.org> X-Yow: Now that I have my ``APPLE,'' I comprehend COST ACCOUNTING!! Date: Thu, 26 Aug 2021 19:19:58 +0200 In-Reply-To: <87o89kxhlv.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 26 Aug 2021 19:04:28 +0200") Message-ID: <87zgt4rum9.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) 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.5 (-) On Aug 26 2021, Lars Ingebrigtsen wrote: > Andreas Schwab writes: > >> On Aug 26 2021, Lars Ingebrigtsen wrote: >> >>> But... this does mean that `file-exists-p' and friends are unreliable >>> in the presence of symlinks, >> >> This is not true. It is consistent with all other file handling >> functions in Emacs. > > I don't see a contradiction between `file-exists-p' being unreliable > and being consistent with all other file handling functions in Emacs. It would be unreliable if it were inconsistent. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:25: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: moreinfo To: Eli Zaretskii Cc: 8035@debbugs.gnu.org, slpnabble@blackberry-hill.com Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299986823616 (code B ref 8035); Thu, 26 Aug 2021 17:25:01 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:24:42 +0000 Received: from localhost ([127.0.0.1]:50330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJ7K-0000wG-9s for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:24:42 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJ7J-0000vz-Bb for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:24:41 -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=sAQYFCjnegAa7Nw0KlWFuHVL7CnK1aT6dKb09YaC/oo=; b=Xpaa2sMq8Z5ZbdnrZGnplCMkrc ETxC+isSfufQU4rlHqFJloThiUhaL4aGkQWxcs5+DADvKp+Z9JoE+BVweZSJrNmlQqxR6SY1sEeIZ GqSOECbqiru6ecoe1FYQp04OZVxYNVfk/NuBR0GAlipfEU9LWR3iHJv3Fl4yBK6wkeGo=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJJ78-0003R4-AX; Thu, 26 Aug 2021 19:24:34 +0200 From: Lars Ingebrigtsen References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <83sfywrw9w.fsf@gnu.org> <87sfywxhnn.fsf@gnus.org> <83mtp4rv5d.fsf@gnu.org> Date: Thu, 26 Aug 2021 19:24:28 +0200 In-Reply-To: <83mtp4rv5d.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Aug 2021 20:08:30 +0300") Message-ID: <87czq0xgoj.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: Eli Zaretskii writes: > expand-file-name also normalizes file names, though. Which is also > needed in some use cases, e.g. when the /foo/bar/ isn't accessible, > but /foo/ is, in which case failing to normalize /foo/bar/. [...] 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: -2.3 (--) 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: -3.3 (---) Eli Zaretskii writes: > expand-file-name also normalizes file names, though. Which is also > needed in some use cases, e.g. when the /foo/bar/ isn't accessible, > but /foo/ is, in which case failing to normalize /foo/bar/../quux > could fail some file I/O function. Hm, yes, that's a point... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:31: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: moreinfo To: spucci Cc: 8035@debbugs.gnu.org Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299990294345 (code B ref 8035); Thu, 26 Aug 2021 17:31:01 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:30:29 +0000 Received: from localhost ([127.0.0.1]:50347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJCv-000181-4r for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:29 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJCu-00017j-1R for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:28 -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=8twU7dzQdZI3jiTBym7TB1Uqr/+lma9+vQvYe1e9EhA=; b=WMIiz+B9pWVdLYi+iVXP3dRWjA 9QT7Gd9yp8VDv60i/0Q0fL44+5PROjnf0XeUNcG7aE95q0qY0KYFwoq6iIk6LD6KKWFTsl/QbmJgk pxrfFFCkM4gXyWEhGZq6Htg/0+y+KDW7ZWFMhvyrofVGDqHkDka+Sxyt2ZrIsqu/E9zs=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJJCj-0003SX-BS; Thu, 26 Aug 2021 19:30:21 +0200 From: Lars Ingebrigtsen References: <30918394.post@talk.nabble.com> Date: Thu, 26 Aug 2021 19:30:16 +0200 In-Reply-To: <30918394.post@talk.nabble.com> (spucci's message of "Sun, 13 Feb 2011 19:05:40 -0800 (PST)") Message-ID: <878s0oxgev.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: spucci writes: > mkdir dest > mkdir dest/subdir > mkdir src > ln -s ../dest/subdir src/subdir > echo "#error This is an error" > dest/foo.c > > Now M-x compile, and give it cc -c src/subdir/../foo.c 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: -2.3 (--) 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: -3.3 (---) spucci writes: > mkdir dest > mkdir dest/subdir > mkdir src > ln -s ../dest/subdir src/subdir > echo "#error This is an error" > dest/foo.c > > Now M-x compile, and give it cc -c src/subdir/../foo.c This should now be fixed in Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Jun 21 05:08:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8035: Processing of .. in a file path after going thru symlink Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Aug 2021 17:31:02 +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: moreinfo To: Lars Ingebrigtsen Cc: 8035@debbugs.gnu.org, slpnabble@blackberry-hill.com Received: via spool by 8035-submit@debbugs.gnu.org id=B8035.16299990584410 (code B ref 8035); Thu, 26 Aug 2021 17:31:02 +0000 Received: (at 8035) by debbugs.gnu.org; 26 Aug 2021 17:30:58 +0000 Received: from localhost ([127.0.0.1]:50353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJDO-000194-H2 for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJDM-00018p-8a for 8035@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44092) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJJDG-0001Dy-Dh; Thu, 26 Aug 2021 13:30:50 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1088 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJJDF-0001ox-Oi; Thu, 26 Aug 2021 13:30:50 -0400 Date: Thu, 26 Aug 2021 20:30:29 +0300 Message-Id: <83k0k8ru4q.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87czq0xgoj.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 26 Aug 2021 19:24:28 +0200) References: <30918394.post@talk.nabble.com> <877dg8yxrx.fsf@gnus.org> <83sfywrw9w.fsf@gnu.org> <87sfywxhnn.fsf@gnus.org> <83mtp4rv5d.fsf@gnu.org> <87czq0xgoj.fsf@gnus.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) > From: Lars Ingebrigtsen > Cc: slpnabble@blackberry-hill.com, 8035@debbugs.gnu.org > Date: Thu, 26 Aug 2021 19:24:28 +0200 > > Eli Zaretskii writes: > > > expand-file-name also normalizes file names, though. Which is also > > needed in some use cases, e.g. when the /foo/bar/ isn't accessible, > > but /foo/ is, in which case failing to normalize /foo/bar/../quux > > could fail some file I/O function. > > Hm, yes, that's a point... The OP's use case is clearly documented in the ELisp manual: Note also that ‘expand-file-name’ does not follow symbolic links at any level. This results in a difference between the way ‘file-truename’ and ‘expand-file-name’ treat ‘..’. Assuming that ‘/tmp/bar’ is a symbolic link to the directory ‘/tmp/foo/bar’ we get: (file-truename "/tmp/bar/../myfile") ⇒ "/tmp/foo/myfile" (expand-file-name "/tmp/bar/../myfile") ⇒ "/tmp/myfile" If you may need to follow symbolic links preceding ‘..’, you should make sure to call ‘file-truename’ without prior direct or indirect calls to ‘expand-file-name’. *Note Truenames::. So I think we need to use file-truename if we want to support such uses of symlinks in "M-x compile" etc. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 26 13:30:37 2021 Received: (at control) by debbugs.gnu.org; 26 Aug 2021 17:30:37 +0000 Received: from localhost ([127.0.0.1]:50350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJD3-00018M-BO for submit@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:37 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49534) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJJD2-000189-93 for control@debbugs.gnu.org; Thu, 26 Aug 2021 13:30:36 -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=LlJPZ7KBl9JQXiQBYTfQNIdNcdMLq715EnWQTGDFrf8=; b=Z5A/a+Pi7ZwEl+7yhGlpVmb4OK ctOadn54FUlyYKOWVrjdvHL23ZnJn3AP7Qserv2f8RA0BbfDikybt6I9Vzqvx3imKFtA2jxB7lzMu oXesmBr1fW5OqsPrYRFcGDcjmjX2rcp0LH3vrM+GfUMbbtcXVH61q6k5g7Yw/CqROeK4=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJJCu-0003Se-AF for control@debbugs.gnu.org; Thu, 26 Aug 2021 19:30:30 +0200 Date: Thu, 26 Aug 2021 19:30:24 +0200 Message-Id: <877dg8xgen.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #8035 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: close 8035 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: -2.3 (--) 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: -3.3 (---) close 8035 28.1 quit