From 42a826eed32cd428a3f7c796c619a854c1f8f9dd Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Sat, 30 Nov 2019 15:49:09 -0800 Subject: [PATCH] Add FreeBSD required defines to mntent.h Linux and FreeBSD use different names for suid / setuid. Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9632 --- include/sys/mntent.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/sys/mntent.h b/include/sys/mntent.h index fac751b46..8d578f67b 100644 --- a/include/sys/mntent.h +++ b/include/sys/mntent.h @@ -29,6 +29,8 @@ #ifndef _SYS_MNTENT_H #define _SYS_MNTENT_H +#define MNTMAXSTR 128 + #define MNTTYPE_ZFS "zfs" /* ZFS file system */ #define MOUNT_SUCCESS 0x00 /* Success */ @@ -71,8 +73,15 @@ #define MNTOPT_STRICTATIME "strictatime" /* strict access time updates */ #define MNTOPT_NOSTRICTATIME "nostrictatime" /* No strict access time updates */ #define MNTOPT_LAZYTIME "lazytime" /* Defer access time writing */ +#ifdef __linux__ #define MNTOPT_SETUID "suid" /* Both setuid and devices allowed */ #define MNTOPT_NOSETUID "nosuid" /* Neither setuid nor devices allowed */ +#elif defined(__FreeBSD__) +#define MNTOPT_SETUID "setuid" /* Set uid allowed */ +#define MNTOPT_NOSETUID "nosetuid" /* Set uid not allowed */ +#else +#error "unknown OS" +#endif #define MNTOPT_OWNER "owner" /* allow owner mount */ #define MNTOPT_NOOWNER "noowner" /* do not allow owner mount */ #define MNTOPT_REMOUNT "remount" /* change mount options */