# endif
}
+int
+acl_default_nontrivial (acl_t acl)
+{
+ /* acl is non-trivial if it is non-empty. */
+ return (acl_entries (acl) > 0);
+}
+
# endif
#elif USE_ACL && HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.
Return -1 and set errno upon failure to determine it. */
extern int acl_access_nontrivial (acl_t);
+
+/* ACL is an ACL, from a file, stored as type ACL_TYPE_DEFAULT.
+ Return 1 if the given ACL is non-trivial.
+ Return 0 if it is trivial, i.e. equivalent to a simple stat() mode.
+ Return -1 and set errno upon failure to determine it. */
+extern int acl_default_nontrivial (acl_t);
# endif
# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */
return -1;
}
+# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */
+
+ /* TODO (see set_permissions). */
+
+# endif
+
# else /* HAVE_ACL_TYPE_EXTENDED */
/* Mac OS X */
*acls_set = true;
if (S_ISDIR(ctx->mode))
{
- if (! from_mode && ctx->default_acl)
+ if (! from_mode && ctx->default_acl &&
+ acl_default_nontrivial (ctx->default_acl))
ret = acl_set_file (name, ACL_TYPE_DEFAULT,
ctx->default_acl);
else
}
}
+# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */
+
+ /* File systems either support POSIX ACLs (for example, ufs) or NFS4 ACLs
+ (for example, zfs). */
+
+ /* TODO: Implement setting ACLs once get_permissions() reads them. */
+
+# endif
+
# else /* HAVE_ACL_TYPE_EXTENDED */
/* Mac OS X */