On 02/19/2012 05:00 PM, Jim Meyering wrote:
> Pádraig Brady wrote:
>> Also I was a bit surprised to see EBUSY and ENOENT in errno_unsupported().
>> Can one assume there are no other attributes on a device if you get those?
> 
> I added those to align with ACL_NOT_WELL_SUPPORTED from
> lib/acl-internal.h, but now that you mention it, I suppose we'll need
> different errno-checking functions for ACL-related than for getfilecon
> failures.  I suppose ENOENT can arise when the file is removed between
> when we stat'd it and when we perform one of these three file-name-using
> tests.

OK to push this so?

commit 7f48aa570d93347aa72d86a034e36377db6a22b9
Author: Pádraig Brady <[email protected]>
Date:   Mon Feb 20 12:33:17 2012 +0000

    ls: adjust errnos indicating device non support for xattrs

    * src/ls.c (errno_unsupported): Remove EBUSY, as this caters for
    the case where ACLs can't be accessed because the _file_ is locked.
    http://lists.gnu.org/archive/html/bug-coreutils/2005-06/msg00191.html
    Also ENOENT is not safe to include as you get that if the _file_
    is removed between the stat() and subsequent querying of xattrs.

diff --git a/src/ls.c b/src/ls.c
index 92b17a4..f1dfb1e 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2783,9 +2783,7 @@ clear_files (void)
 static bool
 errno_unsupported (int err)
 {
-  return (err == EBUSY
-          || err == EINVAL
-          || err == ENOENT
+  return (err == EINVAL
           || err == ENOSYS
           || err == ENOTSUP
           || err == EOPNOTSUPP);

Reply via email to