lib/file-has-acl.c


Log

Author Commit Date CI Message
Paul Eggert efbd564c 2012-02-20T01:55:37 acl: Don't use ACL_CNT and similar ops, since they are unreliable. * lib/file-has-acl.c (file_has_acl) [HP-UX, NonStop Kernel]: Read the entries into a stack-allocated buffer directly. * lib/copy-acl.c (qcopy_acl) [HP-UX, NonStop Kernel]: Likewise.
Paul Eggert c78091be 2012-02-20T01:12:06 acl: Don't use GETACLCNT and similar ops, since they are unreliable. - There were several instances of this pattern: for (;;) { n = acl (f, GETACLCNT, 0, NULL); [ allocate an array A of size N ] if (acl (f, GETACL, n, a) == n) break; } This loop might never terminate if some other process is constantly manipulating the file's ACL. The loop should be rewritten to terminate. - The acl (... GETACLNT ...) call is merely an optimization; its value is merely a hint as to how big to make the array. A better optimization is to avoid the acl (... GETACLNT ...) call entirely, and just guess a reasonably-big size, growing the size and trying again if it's not large enough. This guarantees termination, and saves a system call. * lib/acl-internal.h: Include <limits.h>. (MIN, SIZE_MAX): New macros. * lib/file-has-acl.c (file_has_acl) [Solaris]: Read the entries into a stack-allocated buffer, and use malloc if it does not fit. Don't use GETACLCNT. * lib/set-mode-acl.c (qset_acl) [Solaris]: Likewise.
Bruno Haible 1e5535ce 2012-02-19T22:17:05 acl: Fix endless loop on Solaris with vxfs. * lib/file-has-acl.c (file_has_acl) [Solaris]: Treat a failing acl()/facl() call for ACE_GETACL like a failing call for ACE_GETACLCNT. * lib/set-mode-acl.c (qset_acl) [Solaris]: Likewise. * lib/copy-acl.c (qcopy_acl)[Solaris]: Likewise. * tests/test-sameacls.c (main)[Solaris]: Likewise. Reported by Bill Jones in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10639>, via Paul Eggert.
Bruno Haible ec10a26a 2012-02-19T21:59:07 acl: Fix copy-acl test failure on Solaris 11 2011-11. * lib/file-has-acl.c (NEW_ACE_WRITEA_DATA): New macro. (acl_ace_nontrivial): Relax the restrictions on access_masks[] so that this function returns 0 in some more cases.
Jim Meyering 93f8bee7 2012-02-02T09:12:13 file-has-acl: suppress a warning from gcc -Wsuggest-attribute=const * lib/file-has-acl.c (file_has_acl): This function (for some #ifdefs) would evoke a new gcc warning. Given all of the #ifdefs, it is better not even to try to add the attribute. Instead, add a pragma to suppress the suggestion/warning.
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Jim Meyering d813b688 2011-10-05T15:06:49 file-has-acl: revert both recent changes, 80af92af and 95f7c57f * lib/file-has-acl.c: While the 2011-10-03 change does fix the ls -lL regression introduced in coreutils-8.12, it does so at the cost of an additional stat call in the common case. Besides, now that the kernel change that prompted commit 95f7c57f has been reverted (see https://bugzilla.redhat.com/show_bug.cgi?id=720325#c24) we have no use for commit 95f7c57f, "file-has-acl: use acl_extended_file_nofollow if available".
Kamil Dudka 80af92af 2011-10-03T12:17:22 file-has-acl: revert unintended change in behavior of ls -L * lib/file-has-acl.c (acl_extended_file_wrap): New function, derived from... (file_has_acl): ...code here. Call it. This problem was introduced with 2011-07-22 commit 95f7c57f, "file-has-acl: use acl_extended_file_nofollow if available". See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28538
Bruno Haible d586cbff 2011-10-03T15:48:57 acl: Fix specification. * lib/file-has-acl.c (file_has_acl): Fix specification.
Bruno Haible 389df9e5 2011-09-11T11:56:35 acl: Fix compilation on Solaris 10 (older version). * lib/file-has-acl.c (acl_ace_nontrivial): Use NEW_ACE_EVERYONE instead of ACE_EVERYONE. * lib/set-mode-acl.c (qset_acl): Likewise. Reported by Christian Jullien <eligis@orange.fr>.
Bruno Haible 797d7f58 2011-09-06T11:32:18 acl: Update for AIX >= 5.3 with NFS. * lib/file-has-acl.c (file_has_acl): Interpret aclx_get failure with ENOSYS as no ACL.
Joachim Schmitz 794c770c 2011-09-06T00:34:33 acl: Avoid errors on NonStop Kernel. * lib/file-has-acl.c (file_has_acl) [NonStop Kernel]: Ignore ENOSYS and ENOTSUP errors.
Bruno Haible 1b73d498 2011-09-06T00:26:07 acl: Clean up Solaris code. * lib/acl-internal.h: Remove no-op #if. * lib/file-has-acl.c: Likewise. * lib/set-mode-acl.c (qset_acl): Remove unused Solaris code. * lib/copy-acl.c (qcopy_acl): Likewise.
Bruno Haible 9128d710 2011-09-06T00:01:24 acl: Fix a bug with NFSv4 ACLs on Solaris 10 (newer version). * lib/file-has-acl.c (file_has_acl): ACLs with 4..6 ACEs can be trivial.
Bruno Haible ceb5e179 2011-09-05T23:45:11 acl: Improve support of NFSv4 ACLs on Solaris 10 (newer version). * lib/acl-internal.h (acl_nontrivial): Declare also on newer Solaris 10. * lib/file-has-acl.c (acl_nontrivial): Define also on newer Solaris 10. (acl_ace_nontrivial): Likewise. Recognize the trivial ACLs with 6 ACEs. * lib/copy-acl.c (qcopy_acl): On newer Solaris 10, use acl or facl instead of acl_get, facl_get, acl_set, facl_set.
Kamil Dudka 95f7c57f 2011-07-22T14:48:42 file-has-acl: use acl_extended_file_nofollow if available * lib/acl-internal.h (HAVE_ACL_EXTENDED_FILE): New macro. (acl_extended_file): New macro. * lib/file-has-acl.c (file_has_acl): Use acl_extended_file_nofollow. * m4/acl.m4 (gl_FUNC_ACL): Check for acl_extended_file_nofollow. This addresses http://bugzilla.redhat.com/692823.
Bruno Haible 227b08bb 2011-06-13T02:11:03 acl: Add support for HP-UX >= 11.11 JFS ACLs. * doc/acl-resources.txt: Add info about the ACL APIs on HP-UX. * m4/acl.m4 (gl_FUNC_ACL): Also test for HP-UX 11.11 API. * lib/acl-internal.h [HP-UX 11.11]: Include <aclv.h>. (acl, aclsort): New declarations. (aclv_nontrivial): New declaration. * lib/file-has-acl.c (aclv_nontrivial) [HP-UX 11.11]: New function. (file_has_acl): Read also the second kind of HP-UX ACLs. * lib/set-mode-acl.c (qset_acl) [HP-UX 11.11]: Try to set the second kind of HP-UX ACLs if the first kind fails. * lib/copy-acl.c (qcopy_acl) [HP-UX 11.11]: Read and set also the second kind of HP-UX ACLs. * tests/test-sameacls.c [HP-UX 11.11]: Include <aclv.h>. (main) [HP-UX 11.11]: Test also whether the second kind of HP-UX ACLs agree. * tests/test-file-has-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-set-mode-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. Handle hpuxjfs. * tests/test-copy-acl.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs. * tests/test-copy-file.sh (acl_flavor) [HP-UX 11.11]: Set to hpuxjfs. (func_test_same_acls): Use both lsacl and getacl. Handle hpuxjfs.
Bruno Haible 9cbf59b7 2011-06-13T01:17:20 acl: Complete the 2010-08-10 fix. * lib/file-has-acl.c (file_has_acl) [HP-UX]: Also test against ENOTSUP. * lib/set-mode-acl.c (qset_acl) [HP-UX]: Likewise. * lib/copy-acl.c (qcopy_acl) [HP-UX]: Test for the errno values explicitly. * tests/test-sameacls.c (main) [HP-UX]: Also test against ENOTSUP. Reported in <http://debbugs.gnu.org/db/60/6053.html>.
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Bruno Haible 7c2e3688 2010-10-03T18:03:48 acl: Add support for ACLs on NonStop Kernel. * m4/acl.m4 (gl_FUNC_ACL): For Solaris, test for facl(), not for acl(). Check whether the function aclsort() exists. * lib/acl-internal.h: For Solaris, test HAVE_FACL, not HAVE_ACL. (acl_nontrivial) [HAVE_ACLSORT]: New declaration. * lib/file-has-acl.c: For Solaris, test HAVE_FACL, not HAVE_ACL. (acl_nontrivial [HAVE_ACLSORT]: New function. (file_has_acl): Implement for NonStop Kernel. * lib/set-mode-acl.c: For Solaris, test HAVE_FACL, not HAVE_ACL. (qset_acl): Implement for NonStop Kernel. * lib/copy-acl.c (qcopy_acl): Implement for NonStop Kernel. * tests/test-sameacls.c: For Solaris, test HAVE_FACL, not HAVE_ACL. (main): Implement for NonStop Kernel. * tests/test-file-has-acl.sh (acl_flavor): Set to 'nsk' on NonStop Kernel. Handle this flavor. * tests/test-set-mode-acl.sh: Likewise. * tests/test-copy-acl.sh: Likewise. * tests/test-copy-file.sh: Likewise.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Eric Blake 231bdaf6 2009-10-09T19:17:17 maint: prefer 'file system' over 'filesystem' * doc/posix-functions/fstatat.texi (fstatat): Likewise. * doc/posix-functions/lstat.texi (lstat): Likewise. * lib/file-has-acl.c (file_has_acl): Likewise. * lib/fwriteerror.c [TEST]: Likewise. * tests/test-areadlink.h (test_areadlink): Likewise. * tests/test-areadlinkat-with-size.c (main): Likewise. * tests/test-areadlinkat.c (main): Likewise. * tests/test-canonicalize-lgpl.c (main): Likewise. * tests/test-canonicalize.c (main): Likewise. * tests/test-fstatat.c (main): Likewise. * tests/test-linkat.c (main): Likewise. * tests/test-lstat.h (test_lstat_func): Likewise. * tests/test-mkdir.h (test_mkdir): Likewise. * tests/test-readlink.h (test_readlink): Likewise. * tests/test-remove.c (main): Likewise. * tests/test-rename.h (test_rename): Likewise. * tests/test-renameat.c (main): Likewise. * tests/test-rmdir.h (test_rmdir_func): Likewise. * tests/test-symlink.h (test_symlink): Likewise. * tests/test-symlinkat.c (main): Likewise. * tests/test-unlink.h (test_unlink_func): Likewise. * tests/test-unlinkat.c (main): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 961ac078 2009-09-27T14:11:54 Disable untested support for new flavours of ACLs on AIX.
Bruno Haible 49f59583 2009-09-27T14:05:56 Add support for new flavours of ACLs on AIX. (Untested.)
David Bartley 71cd7127 2009-05-04T03:30:54 acl: Fix infinite loop on FreeBSD.
Bruno Haible 765ede78 2008-06-10T02:40:28 Work around the Solaris 10 ACE ACLs ABI change.
Jim Meyering 1c6985c9 2008-06-09T11:28:55 add more guards around definition of ACE_-related code * lib/file-has-acl.c (acl_ace_nontrivial): Define only if ALLOW and ACE_OWNER are also defined.
Bruno Haible 45b218a2 2008-06-08T23:55:37 Add me as co-author.
Bruno Haible 3f5a6401 2008-06-08T20:33:08 Add support for AIX ACLs.
Bruno Haible 7e766e7f 2008-06-08T19:08:22 Add support for HP-UX ACLs.
Bruno Haible 5aeafebd 2008-06-08T16:04:08 Add support for Solaris 7..10 ACLs.
Bruno Haible feea4bcd 2008-06-08T13:58:26 New function acl_extended_nontrivial (MacOS X only).
Bruno Haible 645ca54a 2008-06-08T13:19:49 Comments.
Bruno Haible 2217763f 2008-06-08T05:08:56 Don't test the ACL_TYPE_DEFAULT ACL on OSF/1.
Bruno Haible c9c845c2 2008-06-08T05:06:19 Add support for MacOS X ACLs.
Bruno Haible 465b7e91 2008-06-04T22:48:48 New function for testing triviality of ACL with POSIX-draft like API.
Bruno Haible fb3917ca 2008-06-04T00:00:28 Simplify #ifs. Put Solaris code after POSIX-like code.
Bruno Haible f9561cd0 2008-05-23T01:13:51 Make copy_acl work on MacOS X 10.5.
Bruno Haible 57fdfd3f 2007-10-07T19:14:58 Change copyright notice from GPLv2+ to GPLv3+.
Paul Eggert e37fe028 2007-03-19T21:58:57 Add limited support for Solaris 10 ZFS-style ACLs: just enough to handle file_has_acl. * lib/acl-internal.h, lib/acl_entries.c, lib/file-has-acl.c: New files. * lib/acl.c: Move header inclusions and related macro defns into lib/acl-internal.h. (S_ISLNK): Remove defn, since that's now done for us. (file_has_acl): Move to lib/file-has-acl.c. Call acl_trivial if available. This is the crucial part of the fix. (acl_entries): Move to lib/acl_entries.c. Now extern, since it's shared within the library. Rewrite a bit, partly to make it compatible with the GNU coding style. * m4/acl.m4 (AC_FUNC_ACL): Add AC_LIBOBJ([file-has-acl]). Remove unnecessary double-quotes. Don't test for acl_to_text; the build will catch that. Replace acl_entries if it doesn't exist and it is needed. Check for -lsec and acl_trivial (as used on Solaris 10). * modules/acl (Files): Add lib/acl-internal.h, lib/acl_entries.c, lib/file-has-acl.c. (Depends-on): Add sys_stat, for S_ISLNK.