* lib/acl-internal.c: Update comments.
* lib/acl_entries.c: Likewise.
* tests/test-file-has-acl.sh: Likewise.
* tests/test-copy-acl.sh: Likewise.
+2025-03-29 Bruno Haible <bruno@clisp.org>
+
+ acl-permissions: Update comments regarding NetBSD.
+ * lib/acl-internal.c: Update comments.
+ * lib/acl_entries.c: Likewise.
+ * tests/test-file-has-acl.sh: Likewise.
+ * tests/test-copy-acl.sh: Likewise.
+
2025-03-28 Collin Funk <collin.funk1@gmail.com>
doc: Document NetBSD acl functions.
# include <string.h>
#endif
-#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
+#if USE_ACL && HAVE_ACL_GET_FILE /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */
return (acl_entries (acl) > 0);
}
-# else /* Linux, FreeBSD, IRIX, Tru64, Cygwin >= 2.5 */
+# else /* Linux, FreeBSD, NetBSD >= 10, IRIX, Tru64, 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.
at least, allowing us to write
return (3 < acl_entries (acl));
but the following code is more robust. */
-# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Cygwin >= 2.5 */
+# if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */
acl_entry_t ace;
int got_one;
free_permission_context (struct permission_context *ctx)
{
#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, NetBSD >= 10, Mac OS X, IRIX, Tru64, Cygwin >= 2.5 */
if (ctx->acl)
acl_free (ctx->acl);
# if !HAVE_ACL_TYPE_EXTENDED
#include "acl-internal.h"
/* This file assumes POSIX-draft like ACLs
- (Linux, FreeBSD, Mac OS X, IRIX, Tru64, Cygwin >= 2.5). */
+ (Linux, FreeBSD, NetBSD >= 10, Mac OS X, IRIX, Tru64, Cygwin >= 2.5). */
/* Return the number of entries in ACL.
Return -1 and set errno upon failure to determine it. */
if (acl != NULL)
{
-#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, Mac OS X, Cygwin >= 2.5 */
+#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */
# 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. */
got_one >= 0;
got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace))
count++;
-# else /* Linux, FreeBSD, 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;
acl_flavor=none
if (getfacl tmpfile0 >/dev/null) 2>/dev/null; then
# Platforms with the getfacl and setfacl programs.
- # Linux, FreeBSD, Solaris, Cygwin.
+ # Linux, FreeBSD, NetBSD >= 10, Solaris, Cygwin.
if (setfacl --help >/dev/null) 2>/dev/null; then
# Linux, Cygwin.
if (LC_ALL=C setfacl --help | grep ' --set-file' >/dev/null) 2>/dev/null; then
acl_flavor=cygwin
fi
else
- # FreeBSD, Solaris.
+ # FreeBSD, NetBSD >= 10, Solaris.
if (LC_ALL=C setfacl 2>&1 | grep '\-x entries' >/dev/null) 2>/dev/null; then
- # FreeBSD.
+ # FreeBSD, NetBSD >= 10.
acl_flavor=freebsd
else
# Solaris.
acl_flavor=none
if (getfacl tmpfile0 >/dev/null) 2>/dev/null; then
# Platforms with the getfacl and setfacl programs.
- # Linux, FreeBSD, Solaris, Cygwin.
+ # Linux, FreeBSD, NetBSD >= 10, Solaris, Cygwin.
if (setfacl --help >/dev/null) 2>/dev/null; then
# Linux, Cygwin.
if (LC_ALL=C setfacl --help | grep ' --test' >/dev/null) 2>/dev/null; then
acl_flavor=cygwin
fi
else
- # FreeBSD, Solaris.
+ # FreeBSD, NetBSD >= 10, Solaris.
if (LC_ALL=C setfacl 2>&1 | grep '\-x entries' >/dev/null) 2>/dev/null; then
- # FreeBSD.
+ # FreeBSD, NetBSD >= 10.
acl_flavor=freebsd
else
# Solaris.