[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: acl: new function for testing triviality of ACL
From: |
Jim Meyering |
Subject: |
Re: acl: new function for testing triviality of ACL |
Date: |
Wed, 04 Jun 2008 14:24:23 +0200 |
Bruno Haible <address@hidden> wrote:
> In <http://lists.gnu.org/archive/html/bug-gnulib/2008-05/msg00159.html> you
> asked to unify the ACL triviality tests used in copy-acl.c and file-has-acl.c.
> This patch does it, at least for the POSIX-draft like APIs. The other APIs
> will need different auxiliary functions, since they don't have an 'acl_t'
> type.
>
> Note also that this function is meant to be applied to an ACL_TYPE_ACCESS
> ACL, *not* to an ACL_TYPE_DEFAULT ACL (used for directories) or
> AC_TYPE_EXTENDED
> (used on MacOS X). That motivates the function name acl_access_nontrivial.
>
> Note also that this implementation does a full scan of the ACL. It does not
> only count the entries. I find that a bit hazardous to just _assume_ that
> the OS will return 4 entries. Especially when I saw that while Cygwin and
> Solaris share the same API, Solaris returns 4 entries by default whereas
> Cygwin returns 3 entries by default. It is easily imaginable that this
> changes between different OS versions. - The full scan does not cause more
> system calls; it uses abstract functions to traverse the ACL that is already
> in memory.
>
> OK to apply?
>
>
> 2008-06-02 Bruno Haible <address@hidden>
>
> * lib/acl-internal.h (acl_access_nontrivial): New declaration.
> * lib/file-has-acl.c (acl_access_nontrivial): New function.
> (file_has_acl): Use it. Save errno afterwards.
> * lib/copy-acl.c (qcopy_acl): Use acl_access_nontrivial.
Thanks a lot for that nice work.
Please go ahead.