From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#17330: files.el cd-absolute overcome false negative from file-executable-p Date: Fri, 02 May 2014 20:24:04 -0400 Message-ID: References: <41559D99-B080-4B34-B491-3A811FA9FEAE@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1399076717 22069 80.91.229.3 (3 May 2014 00:25:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 May 2014 00:25:17 +0000 (UTC) Cc: 17330@debbugs.gnu.org To: Philip Hodges Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 03 02:25:09 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WgNlM-0001eC-Qt for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 May 2014 02:25:08 +0200 Original-Received: from localhost ([::1]:46824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgNlM-00057B-AO for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 May 2014 20:25:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgNlH-00055e-O2 for bug-gnu-emacs@gnu.org; Fri, 02 May 2014 20:25:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WgNlG-0000kQ-T2 for bug-gnu-emacs@gnu.org; Fri, 02 May 2014 20:25:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WgNlG-0000kA-Pw for bug-gnu-emacs@gnu.org; Fri, 02 May 2014 20:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WgNlG-00014n-AA for bug-gnu-emacs@gnu.org; Fri, 02 May 2014 20:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 May 2014 00:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17330 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17330-submit@debbugs.gnu.org id=B17330.13990766504060 (code B ref 17330); Sat, 03 May 2014 00:25:02 +0000 Original-Received: (at 17330) by debbugs.gnu.org; 3 May 2014 00:24:10 +0000 Original-Received: from localhost ([127.0.0.1]:48858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WgNkQ-00013P-Be for submit@debbugs.gnu.org; Fri, 02 May 2014 20:24:10 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:59690 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WgNkM-00013B-MA for 17330@debbugs.gnu.org; Fri, 02 May 2014 20:24:07 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WgNkL-0000Ny-0d; Fri, 02 May 2014 20:24:05 -0400 X-Spook: Croatian digicash Legion of Doom InfoSec World Trade X-Ran: )1y1MF]apvV.l4Gw@|t"R7R[\HP1gx,]yeg2/KA%Z2$Ify4>3|k6W[iv.PK|=%O^G\j-U< X-Hue: blue X-Attribution: GM In-Reply-To: <41559D99-B080-4B34-B491-3A811FA9FEAE@bluewin.ch> (Philip Hodges's message of "Wed, 23 Apr 2014 22:54:18 +0200") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88558 Archived-At: Philip Hodges wrote: > [using emacs-w32.exe 24.3 in cygwin but also applies to other platforms.] > > Symptom: > When I try to cd to my samba-mounted directory, > or try to run ediff-files, it refuses with the error > "Cannot cd to my_directory_name: Permission denied" > The same directory opens fine in dired-mode, and I can open files within it. > This is just one way in which file-executable-p can produce a false negative, > where executing the file or searching the directory may succeed after all. > > [False positives, where the operation refuses, have no impact so long as > the operation fails quickly with an equivalent but authoritative error message.] > > This is typical of many situations where it is not good enough just > to check quickly whether it just looks like it can or cannot be done; > you have to also actually try it, and report the outcome of > that particular attempt at that particular moment. > A preliminary check may still be useful too if it produces a better error > message quickly up front with no dashed expectations or cleaning up to do. > > The comments in fileio.c check_executable (and check_writeable) point out > that on some filesystems there might be an access control list (ACL) in force, > and that the effective user might have more permission than the real user. Perhaps there is something Cygwin-specific at work, because I don't think I can reproduce such a problem on eg RHEL 6.5 GNU/Linux. As user A: mkdir foo1 foo2 chmod 700 foo1 foo2 setfacl -m u:b:r-x foo1 As user B: In the shell: [ -x foo1 ] # -> true In Emacs 24.3: file-executable-p foo1 ; -> true (There's also file-accessible-directory-p; does that work any better for you?).