diff options
Diffstat (limited to 'lib/acl-internal.h')
-rw-r--r-- | lib/acl-internal.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/acl-internal.h b/lib/acl-internal.h index ebd24217bb6..93533762dd0 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -1,10 +1,10 @@ /* Internal implementation of access control lists. -*- coding: utf-8 -*- - Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2022 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 - the Free Software Foundation; either version 3 of the License, or + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -30,7 +30,8 @@ # define GETACLCNT ACL_CNT #endif -/* On Linux, additional ACL related API is available in <acl/libacl.h>. */ +/* On Linux and Cygwin >= 2.5, additional ACL related API is available in + <acl/libacl.h>. */ #ifdef HAVE_ACL_LIBACL_H # include <acl/libacl.h> #endif @@ -72,7 +73,7 @@ _GL_INLINE_HEADER_BEGIN # if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ -/* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ +/* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ # ifndef MIN_ACL_ENTRIES # define MIN_ACL_ENTRIES 4 @@ -122,7 +123,10 @@ rpl_acl_set_fd (int fd, acl_t acl) # endif /* Linux-specific */ -# ifndef HAVE_ACL_EXTENDED_FILE +/* Cygwin >= 2.5 implements this function, but it returns 1 for all + directories, thus is unusable. */ +# if !defined HAVE_ACL_EXTENDED_FILE || defined __CYGWIN__ +# undef HAVE_ACL_EXTENDED_FILE # define HAVE_ACL_EXTENDED_FILE false # define acl_extended_file(name) (-1) # endif @@ -163,7 +167,7 @@ extern int acl_access_nontrivial (acl_t); extern int acl_default_nontrivial (acl_t); # endif -# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin, not HP-UX */ +# elif HAVE_FACL && defined GETACL /* Solaris, Cygwin < 2.5, not HP-UX */ /* Set to 0 if a file's mode is stored independently from the ACL. */ # if defined __CYGWIN__ /* Cygwin */ @@ -256,14 +260,14 @@ extern int acl_nontrivial (int count, struct acl *entries); struct permission_context { mode_t mode; #if USE_ACL -# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */ acl_t acl; # if !HAVE_ACL_TYPE_EXTENDED acl_t default_acl; # endif bool acls_not_supported; -# elif defined GETACL /* Solaris, Cygwin */ +# elif defined GETACL /* Solaris, Cygwin < 2.5 */ int count; aclent_t *entries; # ifdef ACE_GETACL @@ -293,10 +297,6 @@ 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 *) -#if ! (defined USE_ACL && (HAVE_ACL_GET_FILE || defined GETACL)) - _GL_ATTRIBUTE_CONST -#endif - ; +void free_permission_context (struct permission_context *); _GL_INLINE_HEADER_END |