aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libspl
diff options
context:
space:
mode:
authorMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
committerMatt Macy <mmacy@FreeBSD.org>2020-10-17 00:05:34 +0000
commit0be360124f8f108f73365e31448e7550f877f3ac (patch)
tree78557e980720fdcfd76497e6630c29ce1688559c /lib/libspl
parente2228bd99047bb6a0cef0da931147b1f28f155c2 (diff)
downloadsrc-vendor/openzfs.tar.gz
src-vendor/openzfs.zip
Update OpenZFS to 2.0.0-rc3-gbd565fvendor/openzfs/2.0.0-rc3-gfc5966vendor/openzfs
Notes
Notes: svn path=/vendor-sys/openzfs/dist/; revision=366774 svn path=/vendor-sys/openzfs/2.0.0-rc3-gfc5966/; revision=366775; tag=vendor/openzfs/2.0.0-rc3-gfc5966
Diffstat (limited to 'lib/libspl')
-rw-r--r--lib/libspl/include/os/freebsd/sys/param.h4
-rw-r--r--lib/libspl/include/sys/acl.h66
-rw-r--r--lib/libspl/os/freebsd/getmntany.c4
3 files changed, 41 insertions, 33 deletions
diff --git a/lib/libspl/include/os/freebsd/sys/param.h b/lib/libspl/include/os/freebsd/sys/param.h
index 7c23b670591a..cb5260ea3d7e 100644
--- a/lib/libspl/include/os/freebsd/sys/param.h
+++ b/lib/libspl/include/os/freebsd/sys/param.h
@@ -45,10 +45,6 @@
*/
#define MAXNAMELEN 256
-#ifndef IN_BASE
-#define UID_NOBODY 60001 /* user ID no body */
-#define GID_NOBODY UID_NOBODY
-#endif
#define UID_NOACCESS 60002 /* user ID no access */
#define MAXUID UINT32_MAX /* max user id */
diff --git a/lib/libspl/include/sys/acl.h b/lib/libspl/include/sys/acl.h
index e6df864f850f..31168421b088 100644
--- a/lib/libspl/include/sys/acl.h
+++ b/lib/libspl/include/sys/acl.h
@@ -19,8 +19,12 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2017 RackTop Systems.
*/
#ifndef _SYS_ACL_H
@@ -75,23 +79,24 @@ typedef struct acl_info acl_t;
/*
* The following are defined for ace_t.
*/
-#define ACE_READ_DATA 0x00000001
-#define ACE_LIST_DIRECTORY 0x00000001
-#define ACE_WRITE_DATA 0x00000002
-#define ACE_ADD_FILE 0x00000002
-#define ACE_APPEND_DATA 0x00000004
-#define ACE_ADD_SUBDIRECTORY 0x00000004
-#define ACE_READ_NAMED_ATTRS 0x00000008
-#define ACE_WRITE_NAMED_ATTRS 0x00000010
-#define ACE_EXECUTE 0x00000020
-#define ACE_DELETE_CHILD 0x00000040
-#define ACE_READ_ATTRIBUTES 0x00000080
-#define ACE_WRITE_ATTRIBUTES 0x00000100
-#define ACE_DELETE 0x00010000
-#define ACE_READ_ACL 0x00020000
-#define ACE_WRITE_ACL 0x00040000
-#define ACE_WRITE_OWNER 0x00080000
-#define ACE_SYNCHRONIZE 0x00100000
+#define ACE_READ_DATA 0x00000001 /* file: read data */
+#define ACE_LIST_DIRECTORY 0x00000001 /* dir: list files */
+#define ACE_WRITE_DATA 0x00000002 /* file: write data */
+#define ACE_ADD_FILE 0x00000002 /* dir: create file */
+#define ACE_APPEND_DATA 0x00000004 /* file: append data */
+#define ACE_ADD_SUBDIRECTORY 0x00000004 /* dir: create subdir */
+#define ACE_READ_NAMED_ATTRS 0x00000008 /* FILE_READ_EA */
+#define ACE_WRITE_NAMED_ATTRS 0x00000010 /* FILE_WRITE_EA */
+#define ACE_EXECUTE 0x00000020 /* file: execute */
+#define ACE_TRAVERSE 0x00000020 /* dir: lookup name */
+#define ACE_DELETE_CHILD 0x00000040 /* dir: unlink child */
+#define ACE_READ_ATTRIBUTES 0x00000080 /* (all) stat, etc. */
+#define ACE_WRITE_ATTRIBUTES 0x00000100 /* (all) utimes, etc. */
+#define ACE_DELETE 0x00010000 /* (all) unlink self */
+#define ACE_READ_ACL 0x00020000 /* (all) getsecattr */
+#define ACE_WRITE_ACL 0x00040000 /* (all) setsecattr */
+#define ACE_WRITE_OWNER 0x00080000 /* (all) chown */
+#define ACE_SYNCHRONIZE 0x00100000 /* (all) */
#define ACE_FILE_INHERIT_ACE 0x0001
#define ACE_DIRECTORY_INHERIT_ACE 0x0002
@@ -116,8 +121,6 @@ typedef struct acl_info acl_t;
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
ACL_DEFAULTED)
-#ifdef _KERNEL
-
/*
* These are only applicable in a CIFS context.
*/
@@ -137,6 +140,8 @@ typedef struct acl_info acl_t;
#define ACE_ALL_TYPES 0x001F
+#if defined(_KERNEL)
+
typedef struct ace_object {
uid_t a_who; /* uid or gid */
uint32_t a_access_mask; /* read,write,... */
@@ -154,6 +159,21 @@ typedef struct ace_object {
ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
+#define ACE_ALL_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA| \
+ ACE_WRITE_ATTRIBUTES|ACE_WRITE_NAMED_ATTRS|ACE_WRITE_ACL| \
+ ACE_WRITE_OWNER|ACE_DELETE|ACE_DELETE_CHILD)
+
+#define ACE_READ_PERMS (ACE_READ_DATA|ACE_READ_ACL|ACE_READ_ATTRIBUTES| \
+ ACE_READ_NAMED_ATTRS)
+
+#define ACE_WRITE_PERMS (ACE_WRITE_DATA|ACE_APPEND_DATA|ACE_WRITE_ATTRIBUTES| \
+ ACE_WRITE_NAMED_ATTRS)
+
+#define ACE_MODIFY_PERMS (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
+ ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
+ ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
+ ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_SYNCHRONIZE)
+
/*
* The following flags are supported by both NFSv4 ACLs and ace_t.
*/
@@ -217,6 +237,7 @@ typedef struct ace_object {
#define ACL_APPEND_ID 0x1 /* append uid/gid to user/group entries */
#define ACL_COMPACT_FMT 0x2 /* build ACL in ls -V format */
#define ACL_NORESOLVE 0x4 /* don't do name service lookups */
+#define ACL_SID_FMT 0x8 /* use usersid/groupsid when appropriate */
/*
* Legacy aclcheck errors for aclent_t ACLs
@@ -272,13 +293,8 @@ extern int cmp2acls(void *, void *);
#endif /* !defined(_KERNEL) */
-#if defined(__STDC__)
extern int acl(const char *path, int cmd, int cnt, void *buf);
extern int facl(int fd, int cmd, int cnt, void *buf);
-#else /* !__STDC__ */
-extern int acl();
-extern int facl();
-#endif /* defined(__STDC__) */
#ifdef __cplusplus
}
diff --git a/lib/libspl/os/freebsd/getmntany.c b/lib/libspl/os/freebsd/getmntany.c
index b41e763cee43..0ef24059e84f 100644
--- a/lib/libspl/os/freebsd/getmntany.c
+++ b/lib/libspl/os/freebsd/getmntany.c
@@ -37,10 +37,6 @@
#include <sys/stat.h>
#include <unistd.h>
-#define BUFSIZE (MNT_LINE_MAX + 2)
-
-__thread char buf[BUFSIZE];
-
int
getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf)
{