From: Bruno Haible Date: Wed, 10 Sep 2025 20:52:31 +0000 (+0200) Subject: acl-permissions, file-has-acl: Remove support for IRIX. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=552641c54bcb463a544bfa1dbd099987e011f5ee;p=thirdparty%2Fgnulib.git acl-permissions, file-has-acl: Remove support for IRIX. * lib/acl-internal.h (MODE_INSIDE_ACL): Remove code for IRIX. * lib/acl-internal.c (acl_access_nontrivial): Likewise. * lib/acl_entries.c (acl_entries): Likewise. * lib/file-has-acl.c: Update comments. * lib/get-permissions.c: Likewise. * lib/set-permissions.c: Likewise. * m4/acl.m4 (gl_FUNC_ACL): Likewise. * doc/acl-resources.txt: Remove info about IRIX. --- diff --git a/ChangeLog b/ChangeLog index 23aa790dd6..d2961d359a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2025-09-10 Bruno Haible + acl-permissions, file-has-acl: Remove support for IRIX. + * lib/acl-internal.h (MODE_INSIDE_ACL): Remove code for IRIX. + * lib/acl-internal.c (acl_access_nontrivial): Likewise. + * lib/acl_entries.c (acl_entries): Likewise. + * lib/file-has-acl.c: Update comments. + * lib/get-permissions.c: Likewise. + * lib/set-permissions.c: Likewise. + * m4/acl.m4 (gl_FUNC_ACL): Likewise. + * doc/acl-resources.txt: Remove info about IRIX. + acl, file-has-acl, copy-file tests: Remove support for IRIX. * tests/test-file-has-acl.sh: Remove code for IRIX ACLs. * tests/test-set-mode-acl.sh: Likewise. diff --git a/doc/acl-resources.txt b/doc/acl-resources.txt index 26593162de..f0f31cbc68 100644 --- a/doc/acl-resources.txt +++ b/doc/acl-resources.txt @@ -340,49 +340,6 @@ Utilities: setacl -IRIX ACLs - -Manual pages: - http://techpubs.sgi.com/library/tpl/cgi-bin/browse.cgi?cmd=search&db=man&srch=acl&coll=0650&range=0,133 - http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat4/acl.z -Includes: - -Library: - none needed -Functions: - acl_add_perm - acl_calc_mask - acl_clear_perms - acl_copy_entry - acl_copy_ext - acl_copy_int - acl_create_entry - acl_delete_def_file - acl_delete_entry - acl_delete_perm - acl_dup - acl_free - acl_from_text - acl_get_entry - acl_get_fd - acl_get_file - acl_get_permset - acl_get_qualifier - acl_get_tag_type - acl_init - acl_set_fd - acl_set_file - acl_set_permset - acl_set_qualifier - acl_set_tag_type - acl_size - acl_to_short_text - acl_to_text - acl_valid -Utilities: - chacl - - AIX ACLs Documentation: diff --git a/lib/acl-internal.c b/lib/acl-internal.c index ca340c319a..11bd15c432 100644 --- a/lib/acl-internal.c +++ b/lib/acl-internal.c @@ -31,7 +31,7 @@ # include #endif -#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Cygwin >= 2.5 */ +#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */ # if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ @@ -45,7 +45,7 @@ acl_extended_nontrivial (acl_t acl) return (acl_entries (acl) > 0); } -# else /* Linux, FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ +# else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ /* ACL is an ACL, from a file, stored as type ACL_TYPE_ACCESS. Return 1 if the given ACL is non-trivial. @@ -137,23 +137,6 @@ acl_access_nontrivial (acl_t acl) } return got_one; -# elif HAVE_ACL_TO_SHORT_TEXT /* IRIX */ - /* Don't use acl_get_entry: it is undocumented. */ - - int count = acl->acl_cnt; - int i; - - for (i = 0; i < count; i++) - { - acl_entry_t ace = &acl->acl_entry[i]; - acl_tag_t tag = ace->ae_tag; - - if (!(tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ - || tag == ACL_OTHER_OBJ)) - return 1; - } - return 0; - # else errno = ENOSYS; @@ -525,7 +508,7 @@ void free_permission_context (struct permission_context *ctx) { #if USE_ACL -# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */ if (ctx->acl) acl_free (ctx->acl); # if !HAVE_ACL_TYPE_EXTENDED diff --git a/lib/acl-internal.h b/lib/acl-internal.h index f1b6d4706e..cf41e050ec 100644 --- a/lib/acl-internal.h +++ b/lib/acl-internal.h @@ -68,7 +68,7 @@ _GL_INLINE_HEADER_BEGIN # if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ -/* Linux, FreeBSD, Mac OS X, IRIX, Cygwin >= 2.5 */ +/* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */ # ifndef MIN_ACL_ENTRIES # define MIN_ACL_ENTRIES 4 @@ -116,7 +116,7 @@ _GL_INLINE_HEADER_BEGIN # endif /* Set to 0 if a file's mode is stored independently from the ACL. */ -# if (HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP) || defined __sgi /* Mac OS X, IRIX */ +# if HAVE_ACL_COPY_EXT_NATIVE && HAVE_ACL_CREATE_ENTRY_NP /* Mac OS X */ # define MODE_INSIDE_ACL 0 # endif @@ -240,7 +240,7 @@ 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, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */ acl_t acl; # if !HAVE_ACL_TYPE_EXTENDED acl_t default_acl; diff --git a/lib/acl_entries.c b/lib/acl_entries.c index 909a09129e..b78ba18a65 100644 --- a/lib/acl_entries.c +++ b/lib/acl_entries.c @@ -22,7 +22,7 @@ #include "acl-internal.h" /* This file assumes POSIX-draft like ACLs - (Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Cygwin >= 2.5). */ + (Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5). */ /* Return the number of entries in ACL. Return -1 and set errno upon failure to determine it. */ @@ -34,8 +34,7 @@ acl_entries (acl_t acl) if (acl != NULL) { -#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */ -# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ +#if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */ /* acl_get_entry returns 0 when it successfully fetches an entry, and -1/EINVAL at the end. */ acl_entry_t ace; @@ -45,7 +44,7 @@ acl_entries (acl_t acl) got_one >= 0; got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace)) count++; -# else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ +#else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ /* acl_get_entry returns 1 when it successfully fetches an entry, and 0 at the end. */ acl_entry_t ace; @@ -57,10 +56,6 @@ acl_entries (acl_t acl) count++; if (got_one < 0) return -1; -# endif -#else /* IRIX */ - /* Don't use acl_get_entry: it is undocumented. */ - count = acl->acl_cnt; #endif } diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index b8aee6d9ec..0dc42a91b2 100644 --- a/lib/file-has-acl.c +++ b/lib/file-has-acl.c @@ -384,9 +384,9 @@ acl_nfs4_nontrivial (uint32_t *xattr, ssize_t nbytes) #if (!USE_LINUX_XATTR && USE_ACL && HAVE_ACL_GET_FILE \ && !HAVE_ACL_EXTENDED_FILE && !HAVE_ACL_TYPE_EXTENDED) -/* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ +/* FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ -# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP /* IRIX, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP /* Cygwin >= 2.5 */ # include # ifdef O_PATH # define acl_get_fd_np(fd, type) acl_get_fd (fd) @@ -522,7 +522,7 @@ fdfile_has_aclinfo (MAYBE_UNUSED int fd, { /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Cygwin >= 2.5 */ + /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */ int ret; # if HAVE_ACL_EXTENDED_FILE /* Linux */ @@ -553,7 +553,7 @@ fdfile_has_aclinfo (MAYBE_UNUSED int fd, } else ret = -1; -# else /* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ +# else /* FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */ acl_t acl = acl_get_fdfile (fd, name, ACL_TYPE_ACCESS, flags); if (acl) @@ -562,7 +562,7 @@ fdfile_has_aclinfo (MAYBE_UNUSED int fd, int saved_errno = errno; acl_free (acl); errno = saved_errno; - /* On Linux, FreeBSD, NetBSD, IRIX, + /* On Linux, FreeBSD, NetBSD, acl_get_file (name, ACL_TYPE_ACCESS) and acl_get_file (name, ACL_TYPE_DEFAULT) on a directory either both succeed or both fail; it depends on the diff --git a/lib/get-permissions.c b/lib/get-permissions.c index 5ea23dc44f..9b904e8ca2 100644 --- a/lib/get-permissions.c +++ b/lib/get-permissions.c @@ -38,9 +38,9 @@ get_permissions (const char *name, int desc, mode_t mode, #if USE_ACL && HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - /* Linux, FreeBSD, Mac OS X, IRIX, Cygwin >= 2.5 */ + /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */ # if !HAVE_ACL_TYPE_EXTENDED - /* Linux, FreeBSD, IRIX, Cygwin >= 2.5 */ + /* Linux, FreeBSD, Cygwin >= 2.5 */ if (HAVE_ACL_GET_FD && desc != -1) ctx->acl = acl_get_fd (desc); diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 8b16186b0e..af0b5de228 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -25,7 +25,7 @@ #include "minmax.h" #if USE_ACL -# if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, IRIX, Cygwin >= 2.5 */ +# if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, Cygwin >= 2.5 */ # if HAVE_ACL_GET_FILE && !HAVE_ACL_TYPE_EXTENDED static acl_t @@ -486,9 +486,9 @@ set_acls (struct permission_context *ctx, const char *name, int desc, # if HAVE_ACL_GET_FILE /* POSIX 1003.1e (draft 17 -- abandoned) specific version. */ - /* Linux, FreeBSD, Mac OS X, IRIX, Cygwin >= 2.5 */ + /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */ # if !HAVE_ACL_TYPE_EXTENDED - /* Linux, FreeBSD, IRIX, Cygwin >= 2.5 */ + /* Linux, FreeBSD, Cygwin >= 2.5 */ # ifndef HAVE_ACL_FROM_TEXT # error Must have acl_from_text (see POSIX 1003.1e draft 17). diff --git a/m4/acl.m4 b/m4/acl.m4 index 941d4ad57b..0ab7d34e2d 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 -# serial 38 +# serial 39 dnl Copyright (C) 2002, 2004-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN_ONCE([gl_FUNC_ACL], gl_saved_LIBS=$LIBS dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, NetBSD >= 10, - dnl Mac OS X, IRIX, Cygwin >= 2.5). + dnl Mac OS X, Cygwin >= 2.5). dnl -lacl is needed on GNU/Linux. if test $use_acl = 0; then AC_SEARCH_LIBS([acl_get_file], [acl],