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#5548: eshell has an odd idea of file permissions Date: Mon, 08 Feb 2010 18:54:47 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1265674995 11170 80.91.229.12 (9 Feb 2010 00:23:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2010 00:23:15 +0000 (UTC) To: 5548@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 09 01:23:12 2010 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 1NedsJ-0002ex-7r for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Feb 2010 01:23:02 +0100 Original-Received: from localhost ([127.0.0.1]:53887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NedsE-0000gy-R3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Feb 2010 19:22:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Neds9-0000fw-J5 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2010 19:22:33 -0500 Original-Received: from [199.232.76.173] (port=49781 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Neds9-0000fl-80 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2010 19:22:33 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Neds7-0005QX-P8 for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2010 19:22:33 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43572) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Neds5-0005Oa-3a for bug-gnu-emacs@gnu.org; Mon, 08 Feb 2010 19:22:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NedRW-000464-OF; Mon, 08 Feb 2010 18:55:02 -0500 X-Loop: bug-gnu-emacs@gnu.org 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: Mon, 08 Feb 2010 23:55:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: report 5548 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.126567329415733 (code B ref -1); Mon, 08 Feb 2010 23:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Feb 2010 23:54:54 +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 1NedRN-00045i-Qe for submit@debbugs.gnu.org; Mon, 08 Feb 2010 18:54:53 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NedRM-00045W-4G for submit@debbugs.gnu.org; Mon, 08 Feb 2010 18:54:52 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1NedRI-0001YW-3M; Mon, 08 Feb 2010 18:54:48 -0500 X-Spook: plutonium NASA Glock fraud number key SCUD missile CID X-Ran: ,h0;UQ=6uq7*\uYmU2=[ZIi~W]J0N`ml%)K5q}= 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:34961 Archived-At: Current trunk on GNU/Linux: mkdir foo cd foo touch 1 2 3 4 chmod 644 1 # writable by owner chmod 446 2 # writable by other chmod 744 3 # executable by owner chmod 447 4 # executable by other emacs -Q -f eshell eshell> ls "1" appears in eshell-ls-readonly face, "2" in default face. "3" appears in readonly face, "4" in eshell-ls-executable face. This seems to be due to eshell-ls-applicable, which looks odd to me. Firstly, it does different things according to whether or not a file's owner attribute is reported in numeric or string form. Secondly, if the attribute is a string and the file is not remote (?), it adds 6 to the index position to be checked, meaning it checks the "other" file permission index. For example, to test if a file is readable, it ends up testing the 1+6=7 th (from 0) character in "-rw-r--r--".