From a5f3665168946318c98ed5407b9314d400bd6dde Mon Sep 17 00:00:00 2001 From: renelson Date: Tue, 17 Dec 2013 10:44:23 -0800 Subject: Handle acl flags from util-linux mount command Add acl, noacl and posixacl to option_map, avoiding ENOENT error case when mount from util-linux-2.24 execs mount.zfs with any of those flags Signed-off-by: Brian Behlendorf Signed-off-by: renelson Issue #1968 --- lib/libspl/include/sys/mntent.h | 9 ++++++--- lib/libspl/include/sys/mount.h | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/libspl') diff --git a/lib/libspl/include/sys/mntent.h b/lib/libspl/include/sys/mntent.h index 736c3f866..a4be01d75 100644 --- a/lib/libspl/include/sys/mntent.h +++ b/lib/libspl/include/sys/mntent.h @@ -93,9 +93,12 @@ #define MNTOPT_NOXATTR "noxattr" /* disable extended attributes */ #define MNTOPT_COMMENT "comment" /* comment */ #define MNTOPT_ZFSUTIL "zfsutil" /* called by zfs utility */ +#define MNTOPT_ACL "acl" /* passed by util-linux-2.24 mount */ +#define MNTOPT_NOACL "noacl" /* likewise */ +#define MNTOPT_POSIXACL "posixacl" /* likewise */ -#define ZS_COMMENT 0x00000000 /* comment */ -#define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */ -#define ZS_NOCONTEXT 0x00000002 /* do not add selinux context */ +#define ZS_COMMENT 0x00000000 /* comment */ +#define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */ +#define ZS_NOCONTEXT 0x00000002 /* do not add selinux context */ #endif /* _SYS_MNTENT_H */ diff --git a/lib/libspl/include/sys/mount.h b/lib/libspl/include/sys/mount.h index 7b1e06bdb..0fa4f2554 100644 --- a/lib/libspl/include/sys/mount.h +++ b/lib/libspl/include/sys/mount.h @@ -51,6 +51,15 @@ #define MS_DIRSYNC S_WRITE #endif +/* + * Some old glibc headers don't correctly define MS_POSIXACL and + * instead leave it undefined. When using these older headers define + * MS_POSIXACL to the reserved value of (1<<16). + */ +#if !defined(MS_POSIXACL) +#define MS_POSIXACL (1<<16) +#endif + #define MS_USERS (MS_NOEXEC|MS_NOSUID|MS_NODEV) #define MS_OWNER (MS_NOSUID|MS_NODEV) #define MS_GROUP (MS_NOSUID|MS_NODEV) -- cgit v1.2.3