X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/59db4308b546cbe32d3bfe6e23dbc1899d511975..0cd2e923dba8d8c7128b0c084ce6af22069e8db5:/lib/acl-internal.h diff --git a/lib/acl-internal.h b/lib/acl-internal.h index 11fdea1404..636273e0fb 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -1,6 +1,6 @@ -/* Internal implementation of access control lists. +/* Internal implementation of access control lists. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -127,10 +127,8 @@ rpl_acl_set_fd (int fd, acl_t acl) # define acl_extended_file(name) (-1) # endif -/* Linux-specific */ -# ifndef HAVE_ACL_FROM_MODE -# define HAVE_ACL_FROM_MODE false -# define acl_from_mode(mode) (NULL) +# if ! defined HAVE_ACL_FROM_MODE && ! defined HAVE_ACL_FROM_TEXT +# define acl_from_mode (NULL) # endif /* Set to 0 if a file's mode is stored independently from the ACL. */ @@ -157,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 */ @@ -251,7 +255,7 @@ extern int acl_nontrivial (int count, struct acl *entries); struct permission_context { mode_t mode; -#ifdef USE_ACL +#if USE_ACL # if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ acl_t acl; # if !HAVE_ACL_TYPE_EXTENDED @@ -289,6 +293,10 @@ struct permission_context { int get_permissions (const char *, int, mode_t, struct permission_context *); int set_permissions (struct permission_context *, const char *, int); -void free_permission_context (struct permission_context *); +void free_permission_context (struct permission_context *) +#if ! (defined USE_ACL && (HAVE_ACL_GET_FILE || defined GETACL)) + _GL_ATTRIBUTE_CONST +#endif + ; _GL_INLINE_HEADER_END