From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#29231: 26.0.90; invald file name for symbolic files Date: Sat, 11 Nov 2017 18:25:20 +0000 Message-ID: <20171111182520.GA5075@breton.holly.idiocy.org> References: <83efp7qk9i.fsf@gnu.org> <83wp2ypn4q.fsf@gnu.org> <837euxp53y.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1510424776 30679 195.159.176.226 (11 Nov 2017 18:26:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Nov 2017 18:26:16 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: Vincent Zhang , Paul Eggert , 29231@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 11 19:26:10 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 1eDaTn-0007aW-Ds for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Nov 2017 19:26:07 +0100 Original-Received: from localhost ([::1]:46831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDaTu-0001XU-LF for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Nov 2017 13:26:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDaTl-0001XE-K0 for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 13:26:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDaTi-0000Gk-FO for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 13:26:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55175) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDaTi-0000Fm-An for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 13:26:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eDaTh-0002hK-VM for bug-gnu-emacs@gnu.org; Sat, 11 Nov 2017 13:26:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Nov 2017 18:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29231 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29231-submit@debbugs.gnu.org id=B29231.151042473310334 (code B ref 29231); Sat, 11 Nov 2017 18:26:01 +0000 Original-Received: (at 29231) by debbugs.gnu.org; 11 Nov 2017 18:25:33 +0000 Original-Received: from localhost ([127.0.0.1]:35622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDaTE-0002gZ-1H for submit@debbugs.gnu.org; Sat, 11 Nov 2017 13:25:33 -0500 Original-Received: from mail-wm0-f50.google.com ([74.125.82.50]:53330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDaTC-0002gH-Ie for 29231@debbugs.gnu.org; Sat, 11 Nov 2017 13:25:31 -0500 Original-Received: by mail-wm0-f50.google.com with SMTP id g141so8196269wmg.2 for <29231@debbugs.gnu.org>; Sat, 11 Nov 2017 10:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=/4WlSzZh7kmkjNQSdnV4mCnNnRLryLqM4uhitseR/GE=; b=Q4FkqsE7VihVYqfXsaCYdV9q359DzR35FYwdyP/1yLnLjzRCqNZQRJV8qmDr41022j 8RxHrE7aTJ0YfRFAlkIsXStdzIOqPxuEJNBKIO9uNRbXkD7Pi9qNtweYsMUlCHpbJ7gj 0vy49XPAh0ENG7+SVNv+KNyHtb/UuDpwbSpkPEiPFbgyeZXX7/xmDVtDIitghqdDAia6 zYZW7/zP9xmUVYRv42e4pZu62LubGjLnUh7KxgTiW1/hyjGc5h8FGTML4rGkhN6SvyNN v6f2HLU/e/Qu0Jt5dkqLuQbl9V1mYMj+sNkFgLPuASzyCB+pSEEWXM5wZCNRiD44guyV rd3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=/4WlSzZh7kmkjNQSdnV4mCnNnRLryLqM4uhitseR/GE=; b=FFOpvQDPlLUgGlyk5+8jdqdCnU6K76C2qBDzBv3Y0nEjoD3Psa65jg6YwczZh+Lvs+ LMwHGFZvN1J5KAxQNa2p8tn+rdrxKOyQaQbnbfJWBmGL/oteLMLuqgBW19ifWlewMmXG A2A3J/WZ2RIEk93OB7Qk6uPQrJvlchIvgclTBWx/0iC604GiOK3TseFrgz0HitPnCQnV wdHBTSvja/+RoF4wrdKOdb0F4jHtQhrrg3ftxvUlxMN9/RV1a7MDCSD9rNeHN4xoopyZ SQS6KvyqFuJ4hG4lMV5urhfai6eUvhGnRbWlSrqXENrO3G9DJlJvuJlcWEndy0ciI/7D 94Fw== X-Gm-Message-State: AJaThX7KqD/bMyDMElZ2PJmUEziWoxUUk0dUbYXsHs9ICu3FKGJNgB4F RsAEQowmO8m7G2tUyj2SOeI= X-Google-Smtp-Source: AGs4zMZmgh0aEr1DnbnTPpq4uxFzqNRJXYVegRtmugCpvEoJMnTzShLCSA+ttIqXz4I/O0hmvHVJbg== X-Received: by 10.28.35.80 with SMTP id j77mr2609811wmj.109.1510424724790; Sat, 11 Nov 2017 10:25:24 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-91df-d8a5-fef6-2802.holly.idiocy.org. [2001:8b0:3f8:8129:91df:d8a5:fef6:2802]) by smtp.gmail.com with ESMTPSA id j125sm6522496wmf.24.2017.11.11.10.25.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Nov 2017 10:25:23 -0800 (PST) Content-Disposition: inline In-Reply-To: <837euxp53y.fsf@gnu.org> 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:139769 Archived-At: On Sat, Nov 11, 2017 at 10:54:57AM +0200, Eli Zaretskii wrote: > This assumes that calling faccessat with an argument "foo/" will > return zero (i.e. succeed) only if "foo" is a directory, but will fail > (return non-zero) if it's a file. I'm guessing that on macOS, this > call succeeds even for files, or maybe just for symlinks to files. Only with symlinks faccessat returns success if it’s pointing to a file and you put ‘/’ on the end. It looks like perhaps adding / to the end ‘resolves’ symlinks: breton:/Users/alan>ls -l cows -rw-r--r-- 1 alan staff 0 11 Nov 17:33 cows breton:/Users/alan>ls cows/ ls: cows/: Not a directory breton:/Users/alan>ln -s cows moo breton:/Users/alan>ls -l moo lrwxr-xr-x 1 alan staff 4 11 Nov 18:14 moo -> cows breton:/Users/alan>ls -l moo/ -rw-r--r-- 1 alan staff 0 11 Nov 17:33 moo/ > Btw, does macOS have faccessat, or does it use the Gnulib replacement? macOS does have faccessat. I’m not sure what the fix should be here. The commit introducing this bug is: commit 3a8d0cc825635e07da2a90c4ac987b476fc9b05d (HEAD -> emacs-26) Author: Paul Eggert Date: Mon Jul 31 12:31:02 2017 -0700 Avoid most stat calls when completing file names * admin/merge-gnulib (GNULIB_MODULES): Add d-type. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * m4/d-type.m4: New file, copied from gnulib. * src/dired.c (DT_UNKNOWN, DT_DIR, DT_LINK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New constants. (dirent_type): New function. (file_name_completion): Use it, to avoid unnecessary calls to stat-like functions on GNU/Linux and other platforms with d_type. (file_name_completion_stat): Just follow the link; there is no need to try first with AT_SYMLINK_NOFOLLOW since the directory entry was already checked to exist. Perhaps revert to the old behaviour for Darwin OS? -- Alan Third