git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Autoconf selinux support
[zfs.git]
/
lib
/
libzfs
/
libzfs_mount.c
diff --git
a/lib/libzfs/libzfs_mount.c
b/lib/libzfs/libzfs_mount.c
index
88bd071
..
9950bf9
100644
(file)
--- a/
lib/libzfs/libzfs_mount.c
+++ b/
lib/libzfs/libzfs_mount.c
@@
-72,6
+72,9
@@
#include <sys/mntent.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/mntent.h>
#include <sys/mount.h>
#include <sys/stat.h>
+#ifdef HAVE_LIBSELINUX
+#include <selinux/selinux.h>
+#endif /* HAVE_LIBSELINUX */
#include <libzfs.h>
#include <libzfs.h>
@@
-277,6
+280,12
@@
zfs_mount(zfs_handle_t *zhp, const char *options, int flags)
if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL))
flags |= MS_RDONLY;
if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL))
flags |= MS_RDONLY;
+#ifdef HAVE_LIBSELINUX
+ if (is_selinux_enabled())
+ (void) strlcat(mntopts, ",context=\"system_u:"
+ "object_r:file_t:s0\"", sizeof (mntopts));
+#endif /* HAVE_LIBSELINUX */
+
if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL))
return (0);
if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL))
return (0);