From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Building master fails on Windows 10 when testing etc/NEWS file Date: Wed, 18 Sep 2019 04:26:10 -0700 Organization: UCLA Computer Science Department Message-ID: References: <1d388216-eed3-ed6f-5710-18d38daefe58@cs.ucla.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------259E3B9B4DAE76596632F26E" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="219155"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: Juanma Barranquero , martin rudalics , emacs-devel To: Richard Copley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 18 13:28:23 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iAY8F-000utF-90 for ged-emacs-devel@m.gmane.org; Wed, 18 Sep 2019 13:28:23 +0200 Original-Received: from localhost ([::1]:57522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAY8D-00074t-V8 for ged-emacs-devel@m.gmane.org; Wed, 18 Sep 2019 07:28:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAY6A-0006Id-JP for emacs-devel@gnu.org; Wed, 18 Sep 2019 07:26:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAY69-0005d7-D0 for emacs-devel@gnu.org; Wed, 18 Sep 2019 07:26:14 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42164) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAY69-0005cT-2M for emacs-devel@gnu.org; Wed, 18 Sep 2019 07:26:13 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D5DAE1600A0; Wed, 18 Sep 2019 04:26:11 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id EZGV3oXmaPtY; Wed, 18 Sep 2019 04:26:11 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 07C05160203; Wed, 18 Sep 2019 04:26:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Y9JJVn4CEES1; Wed, 18 Sep 2019 04:26:10 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C9A731600A0; Wed, 18 Sep 2019 04:26:10 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240131 Archived-At: This is a multi-part message in MIME format. --------------259E3B9B4DAE76596632F26E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 9/18/19 3:33 AM, Richard Copley wrote: > Testing file: Permission denied, c:/var/mail Oh, my. Is the MS-Windows tradition to pretend that permission is denied to every missing directory? :-) Anyway, I installed the attached patch, which I hope fixes the problem. --------------259E3B9B4DAE76596632F26E Content-Type: text/x-patch; name="0001-Be-less-picky-about-EACCES-in-file-test-predicates.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Be-less-picky-about-EACCES-in-file-test-predicates.patc"; filename*1="h" >From efa4edfadb3d8ac051ac21ccb4238f3eadb091dd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 Sep 2019 04:21:19 -0700 Subject: [PATCH] Be less picky about EACCES in file test predicates Problem reported by Tino Calancha (Bug#37445) and others. * src/fileio.c (PICKY_EACCES): New constant, false by default. (file_test_errno): Ignore EACCES if not picky. (check_file_access): Investigate EACCES problems further if picky. --- src/fileio.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index 0977516f01..58bc6b7ee8 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -253,9 +253,23 @@ file_attribute_errno (Lisp_Object file, int err) return file_metadata_errno ("Getting attributes", file, err); } +/* In theory, EACCES errors for predicates like file-readable-p should + be checked further because they may be problems with an ancestor + directory instead of with the file itself, which means that we + don't have reliable info about the requested file. In practice, + though, such errors are common enough that signaling them can be + annoying even if the errors are real (e.g., Bug#37445). So return + nil for EACCES unless compiling with -DPICKY_EACCES, which is off + by default. */ +#ifndef PICKY_EACCES +enum { PICKY_EACCES = false }; +#endif + static Lisp_Object file_test_errno (Lisp_Object file, int err) { + if (!PICKY_EACCES && err == EACCES) + return Qnil; return file_metadata_errno ("Testing file", file, err); } @@ -2745,7 +2759,7 @@ check_file_access (Lisp_Object file, Lisp_Object operation, int amode) return Qt; int err = errno; if (err == EROFS || err == ETXTBSY - || (err == EACCES && amode != F_OK + || (PICKY_EACCES && err == EACCES && amode != F_OK && file_access_p (encoded_file, F_OK))) { errno = err; -- 2.17.1 --------------259E3B9B4DAE76596632F26E--