]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
acl-permissions, file-has-acl: Remove support for OSF/1.
authorBruno Haible <bruno@clisp.org>
Tue, 9 Sep 2025 10:37:35 +0000 (12:37 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 9 Sep 2025 10:37:55 +0000 (12:37 +0200)
* 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.

ChangeLog
doc/acl-resources.txt
lib/acl-internal.c
lib/acl-internal.h
lib/acl_entries.c
lib/file-has-acl.c
lib/set-permissions.c
m4/acl.m4

index 382f66b9d063990f1e3a50a409dd064738a24061..138f342d10f246b26dd3f0797b127e0a845ef0f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2025-09-09  Bruno Haible  <bruno@clisp.org>
 
+       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.
index 7b3ae5078e3def63083ede94e48138a1a131f4b1..26593162dec73bcdf87fbb5ecb796c19cf5a8a60 100644 (file)
@@ -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:
-  <sys/acl.h>
-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:
index 6c50feacbb811da92da9a68d544132d87ad8dbf3..ca340c319a5cfef70b357e908287a9092966ebe7 100644 (file)
@@ -31,7 +31,7 @@
 # include <string.h>
 #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
index cb969e9797e958794a3b67b211988df7a4c49b56..f1b6d4706eec6f216ffab07e2af5e86ad5d730c3 100644 (file)
@@ -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;
index 57b7b4998c07c6d52103a3cf5d318b61b36e0c21..909a09129e443726a47f239c553eb7d3ae0bbe81 100644 (file)
@@ -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
     }
 
index a9cfbf3a16e67e3cff29932692af3af70f8d5794..b8aee6d9ec2dc60d8ae0e2dd0a85c82ff499269d 100644 (file)
@@ -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 <fcntl.h>
 #  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;
index 2da2e98e426250d57a3f6feff872d143137e3d74..8b16186b0edd0655a9036e89afa99540316fe6b2 100644 (file)
 #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).
index 2dd33497efd35bc173216a6a050fc8c2243e7144..941d4ad57bc7d1e7a8120b680f0bc931293adf19 100644 (file)
--- 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