Avoid needing to know the textual representation of an ACL when possible.
authorBruno Haible <bruno@clisp.org>
Sun, 8 Jun 2008 02:39:51 +0000 (04:39 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 8 Jun 2008 02:39:51 +0000 (04:39 +0200)
ChangeLog
lib/set-mode-acl.c

index e373fd0..6b4b68e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-06-07  Bruno Haible  <bruno@clisp.org>
 
+       * lib/set-mode-acl.c (qset_acl): Use acl_init(), not acl_from_text(),
+       to construct an empty ACL.
+
+2008-06-07  Bruno Haible  <bruno@clisp.org>
+
        * lib/set-mode-acl.c (chmod_or_fchmod): Document return value
        precisely.
        * lib/copy-acl.c (qcopy_acl): Trivial code simplifications.
index ae146c3..cf59738 100644 (file)
@@ -153,13 +153,7 @@ qset_acl (char const *name, int desc, mode_t mode)
     acl = acl_get_file (name, ACL_TYPE_ACCESS);
   if (acl)
     {
-#   if HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP /* MacOS X */
-      static const char empty_acl_text[] = "!#acl 1\n";
-#   else /* Unknown flavor of POSIX-like ACLs */
-#    error Unknown flavor of POSIX-like ACLs - add support for your platform.
-#   endif
-
-      acl = acl_from_text (empty_acl_text);
+      acl = acl_init (0);
       if (acl)
        {
          if (HAVE_ACL_SET_FD && desc != -1)