1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

Merge from gnulib

This incorporates:
2015-07-05 acl-permissions: Document FreeBSD ACL_TYPE_NFS4 acls
2015-07-05 acl-permissions: Fix on FreeBSD
2015-07-05 file-has-acl, acl-permissions: fix some more HP-UX typos
* lib/acl-internal.c, lib/acl-internal.h, lib/get-permissions.c:
* lib/set-permissions.c: Copy from gnulib.
This commit is contained in:
Paul Eggert 2015-07-14 22:29:16 -07:00
parent ff0e184ef3
commit c40ea1328b
4 changed files with 30 additions and 1 deletions

View File

@ -115,6 +115,13 @@ acl_access_nontrivial (acl_t acl)
# 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 */

View File

@ -155,6 +155,12 @@ extern int acl_extended_nontrivial (acl_t);
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 */

View File

@ -60,6 +60,12 @@ get_permissions (const char *name, int desc, mode_t mode,
return -1;
}
# if HAVE_ACL_TYPE_NFS4 /* FreeBSD */
/* TODO (see set_permissions). */
# endif
# else /* HAVE_ACL_TYPE_EXTENDED */
/* Mac OS X */

View File

@ -530,7 +530,8 @@ set_acls (struct permission_context *ctx, const char *name, int desc,
*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
@ -540,6 +541,15 @@ set_acls (struct permission_context *ctx, const char *name, int desc,
}
}
# 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 */