From: Bruno Haible Date: Tue, 9 Sep 2025 10:37:35 +0000 (+0200) Subject: acl-permissions, file-has-acl: Remove support for OSF/1. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e107905f11de87c5aa23819b75e4c93b0427fe0b;p=thirdparty%2Fgnulib.git acl-permissions, file-has-acl: Remove support for OSF/1. * m4/acl.m4 (gl_FUNC_ACL): Don't test for libpacl. * lib/acl-internal.h (rpl_acl_get_fd, rpl_acl_set_fd): Remove functions. * lib/acl-internal.c (acl_access_nontrivial): Remove code for OSF/1. * lib/acl_entries.c (acl_entries): Likewise. * lib/file-has-acl.c (fdfile_has_aclinfo): Likewise. * lib/set-permissions.c (acl_from_mode): Likewise. * doc/acl-resources.txt: Remove info about OSF/1. --- diff --git a/ChangeLog b/ChangeLog index 382f66b9d0..138f342d10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2025-09-09 Bruno Haible + acl-permissions, file-has-acl: Remove support for OSF/1. + * m4/acl.m4 (gl_FUNC_ACL): Don't test for libpacl. + * lib/acl-internal.h (rpl_acl_get_fd, rpl_acl_set_fd): Remove functions. + * lib/acl-internal.c (acl_access_nontrivial): Remove code for OSF/1. + * lib/acl_entries.c (acl_entries): Likewise. + * lib/file-has-acl.c (fdfile_has_aclinfo): Likewise. + * lib/set-permissions.c (acl_from_mode): Likewise. + * doc/acl-resources.txt: Remove info about OSF/1. + acl, file-has-acl, copy-file tests: Remove support for OSF/1. * tests/test-file-has-acl.sh: Remove code for OSF/1 ACLs. * tests/test-set-mode-acl.sh: Likewise. diff --git a/doc/acl-resources.txt b/doc/acl-resources.txt index 7b3ae5078e..26593162de 100644 --- a/doc/acl-resources.txt +++ b/doc/acl-resources.txt @@ -383,97 +383,6 @@ Utilities: chacl -Tru64 ACLs - -Manual pages: - https://backdrift.org/man/tru64/man4/acl.4.html - https://backdrift.org/man/tru64/man3/acl_add_perm.3.html - https://backdrift.org/man/tru64/man3/acl_clear_perm.3.html - https://backdrift.org/man/tru64/man3/acl_copy_entry.3.html - https://backdrift.org/man/tru64/man3/acl_copy_ext.3.html - https://backdrift.org/man/tru64/man3/acl_copy_int.3.html - https://backdrift.org/man/tru64/man3/acl_create_entry.3.html - https://backdrift.org/man/tru64/man3/acl_delete_def_fd.3.html - https://backdrift.org/man/tru64/man3/acl_delete_def_file.3.html - https://backdrift.org/man/tru64/man3/acl_delete_entry.3.html - https://backdrift.org/man/tru64/man3/acl_delete_perm.3.html - https://backdrift.org/man/tru64/man3/acl_dup.3.html - https://backdrift.org/man/tru64/man3/acl_first_entry.3.html - https://backdrift.org/man/tru64/man3/acl_free.3.html - https://backdrift.org/man/tru64/man3/acl_free_qualifier.3.html - https://backdrift.org/man/tru64/man3/acl_free_text.3.html - https://backdrift.org/man/tru64/man3/acl_from_text.3.html - https://backdrift.org/man/tru64/man3/acl_get_entry.3.html - https://backdrift.org/man/tru64/man3/acl_get_fd.3.html - https://backdrift.org/man/tru64/man3/acl_get_file.3.html - https://backdrift.org/man/tru64/man3/acl_get_permset.3.html - https://backdrift.org/man/tru64/man3/acl_get_qualifier.3.html - https://backdrift.org/man/tru64/man3/acl_get_tag_type.3.html - https://backdrift.org/man/tru64/man3/acl_init.3.html - https://backdrift.org/man/tru64/man3/acl_set_fd.3.html - https://backdrift.org/man/tru64/man3/acl_set_file.3.html - https://backdrift.org/man/tru64/man3/acl_set_permset.3.html - https://backdrift.org/man/tru64/man3/acl_set_qualifier.3.html - https://backdrift.org/man/tru64/man3/acl_set_tag_type.3.html - https://backdrift.org/man/tru64/man3/acl_size.3.html - https://backdrift.org/man/tru64/man3/acl_to_text.3.html - https://backdrift.org/man/tru64/man3/acl_valid.3.html -Includes: - -Library: - -lpacl -Functions: - acl_add_perm - acl_clear_perm - acl_copy_entry - acl_copy_ext - acl_copy_int - acl_create_entry - acl_delete_def_fd - acl_delete_def_file - acl_delete_entry - acl_delete_perm - acl_dup - acl_first_entry - acl_free - acl_free_qualifier - acl_free_text - 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_text - acl_valid -Unportable functions: - acl_add_entry - acl_delete_access_fd - acl_delete_access_file - acl_delete_def_dir_fd - acl_delete_def_dir_file - acl_ext_to_text - acl_find_entry - acl_get - acl_mod_perm - acl_set - acl_to_fmt_text - allocate_acl_entry - convert_to_er - isaclprop -Utilities: - getacl - setacl - - AIX ACLs Documentation: diff --git a/lib/acl-internal.c b/lib/acl-internal.c index 6c50feacbb..ca340c319a 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, Tru64, Cygwin >= 2.5 */ +#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, 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, Tru64, Cygwin >= 2.5 */ +# else /* Linux, FreeBSD, NetBSD >= 10, IRIX, 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. @@ -154,29 +154,6 @@ acl_access_nontrivial (acl_t acl) } return 0; -# elif HAVE_ACL_FREE_TEXT /* Tru64 */ - /* Don't use acl_get_entry: it takes only one argument and does not work. */ - - int count = acl->acl_num; - acl_entry_t ace; - - for (ace = acl->acl_first; count > 0; ace = ace->next, count--) - { - acl_tag_t tag; - acl_perm_t perm; - - tag = ace->entry->acl_type; - if (!(tag == ACL_USER_OBJ || tag == ACL_GROUP_OBJ || tag == ACL_OTHER)) - return 1; - - perm = ace->entry->acl_perm; - /* On Tru64, perm can also contain non-standard bits such as - PERM_INSERT, PERM_DELETE, PERM_MODIFY, PERM_LOOKUP, ... */ - if ((perm & ~(ACL_READ | ACL_WRITE | ACL_EXECUTE)) != 0) - return 1; - } - return 0; - # else errno = ENOSYS; @@ -548,7 +525,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, Tru64, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, 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 cb969e9797..f1b6d4706e 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, Tru64, Cygwin >= 2.5 */ +/* Linux, FreeBSD, Mac OS X, IRIX, Cygwin >= 2.5 */ # ifndef MIN_ACL_ENTRIES # define MIN_ACL_ENTRIES 4 @@ -76,17 +76,7 @@ _GL_INLINE_HEADER_BEGIN /* POSIX 1003.1e (draft 17) */ # ifdef HAVE_ACL_GET_FD -/* Most platforms have a 1-argument acl_get_fd, only OSF/1 has a 2-argument - macro(!). */ -# if HAVE_ACL_FREE_TEXT /* OSF/1 */ -ACL_INTERNAL_INLINE acl_t -rpl_acl_get_fd (int fd) -{ - return acl_get_fd (fd, ACL_TYPE_ACCESS); -} -# undef acl_get_fd -# define acl_get_fd rpl_acl_get_fd -# endif +/* acl_get_fd takes one argument. */ # else # define HAVE_ACL_GET_FD false # undef acl_get_fd @@ -95,17 +85,7 @@ rpl_acl_get_fd (int fd) /* POSIX 1003.1e (draft 17) */ # ifdef HAVE_ACL_SET_FD -/* Most platforms have a 2-argument acl_set_fd, only OSF/1 has a 3-argument - macro(!). */ -# if HAVE_ACL_FREE_TEXT /* OSF/1 */ -ACL_INTERNAL_INLINE int -rpl_acl_set_fd (int fd, acl_t acl) -{ - return acl_set_fd (fd, ACL_TYPE_ACCESS, acl); -} -# undef acl_set_fd -# define acl_set_fd rpl_acl_set_fd -# endif +/* acl_set_fd takes two arguments. */ # else # define HAVE_ACL_SET_FD false # undef acl_set_fd @@ -260,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, Tru64, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, 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 57b7b4998c..909a09129e 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, Tru64, Cygwin >= 2.5). */ + (Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Cygwin >= 2.5). */ /* Return the number of entries in ACL. Return -1 and set errno upon failure to determine it. */ @@ -58,16 +58,9 @@ acl_entries (acl_t acl) if (got_one < 0) return -1; # endif -#else /* IRIX, Tru64 */ -# if HAVE_ACL_TO_SHORT_TEXT /* IRIX */ +#else /* IRIX */ /* Don't use acl_get_entry: it is undocumented. */ count = acl->acl_cnt; -# endif -# if HAVE_ACL_FREE_TEXT /* Tru64 */ - /* Don't use acl_get_entry: it takes only one argument and does not - work. */ - count = acl->acl_num; -# endif #endif } diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c index a9cfbf3a16..b8aee6d9ec 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, Tru64, Cygwin >= 2.5 */ +/* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ -# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP /* IRIX, Tru64, Cygwin >= 2.5 */ +# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP /* IRIX, 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, Tru64, Cygwin >= 2.5 */ + /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, 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, Tru64, Cygwin >= 2.5 */ +# else /* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ acl_t acl = acl_get_fdfile (fd, name, ACL_TYPE_ACCESS, flags); if (acl) @@ -562,11 +562,6 @@ fdfile_has_aclinfo (MAYBE_UNUSED int fd, int saved_errno = errno; acl_free (acl); errno = saved_errno; -# if HAVE_ACL_FREE_TEXT /* Tru64 */ - /* On OSF/1, acl_get_file (name, ACL_TYPE_DEFAULT) always - returns NULL with errno not set. There is no point in - making this call. */ -# else /* FreeBSD, NetBSD >= 10, IRIX, Cygwin >= 2.5 */ /* On Linux, FreeBSD, NetBSD, IRIX, acl_get_file (name, ACL_TYPE_ACCESS) and acl_get_file (name, ACL_TYPE_DEFAULT) on a directory @@ -580,26 +575,25 @@ fdfile_has_aclinfo (MAYBE_UNUSED int fd, acl = acl_get_fdfile (fd, name, ACL_TYPE_DEFAULT, flags); if (acl) { -# ifdef __CYGWIN__ /* Cygwin >= 2.5 */ +# ifdef __CYGWIN__ /* Cygwin >= 2.5 */ ret = acl_access_nontrivial (acl); saved_errno = errno; acl_free (acl); errno = saved_errno; -# else +# else ret = (0 < acl_entries (acl)); acl_free (acl); -# endif +# endif } else { ret = -1; -# ifdef __CYGWIN__ /* Cygwin >= 2.5 */ +# ifdef __CYGWIN__ /* Cygwin >= 2.5 */ if (d_type == DT_UNKNOWN) ret = 0; -# endif +# endif } } -# endif } else ret = -1; diff --git a/lib/set-permissions.c b/lib/set-permissions.c index 2da2e98e42..8b16186b0e 100644 --- a/lib/set-permissions.c +++ b/lib/set-permissions.c @@ -25,17 +25,13 @@ #include "minmax.h" #if USE_ACL -# if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */ +# if ! defined HAVE_ACL_FROM_MODE && defined HAVE_ACL_FROM_TEXT /* FreeBSD, IRIX, Cygwin >= 2.5 */ # if HAVE_ACL_GET_FILE && !HAVE_ACL_TYPE_EXTENDED static acl_t acl_from_mode (mode_t mode) { -# if HAVE_ACL_FREE_TEXT /* Tru64 */ - char acl_text[] = "u::---,g::---,o::---,"; -# else /* FreeBSD, IRIX, Cygwin >= 2.5 */ char acl_text[] = "u::---,g::---,o::---"; -# endif if (mode & S_IRUSR) acl_text[ 3] = 'r'; if (mode & S_IWUSR) acl_text[ 4] = 'w'; @@ -490,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, Tru64, Cygwin >= 2.5 */ + /* Linux, FreeBSD, Mac OS X, IRIX, Cygwin >= 2.5 */ # if !HAVE_ACL_TYPE_EXTENDED - /* Linux, FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */ + /* Linux, FreeBSD, IRIX, 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 2dd33497ef..941d4ad57b 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 -# serial 37 +# serial 38 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,10 +35,10 @@ 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, Tru64, Cygwin >= 2.5). - dnl -lacl is needed on GNU/Linux, -lpacl on OSF/1. + dnl Mac OS X, IRIX, Cygwin >= 2.5). + dnl -lacl is needed on GNU/Linux. if test $use_acl = 0; then - AC_SEARCH_LIBS([acl_get_file], [acl pacl], + AC_SEARCH_LIBS([acl_get_file], [acl], [if test "$ac_cv_search_acl_get_file" != "none required"; then LIB_ACL=$ac_cv_search_acl_get_file fi