Blame SOURCES/nfs-utils-1.3.0-exportfs-securitylabel.patch

64c563
diff -up nfs-utils-1.3.0/support/include/nfs/export.h.orig nfs-utils-1.3.0/support/include/nfs/export.h
64c563
--- nfs-utils-1.3.0/support/include/nfs/export.h.orig	2017-03-27 10:07:41.440397336 -0400
64c563
+++ nfs-utils-1.3.0/support/include/nfs/export.h	2017-03-27 10:08:57.195772235 -0400
64c563
@@ -18,7 +18,8 @@
64c563
 #define NFSEXP_ASYNC		0x0010
64c563
 #define NFSEXP_GATHERED_WRITES	0x0020
64c563
 #define NFSEXP_NOREADDIRPLUS	0x0040
64c563
-/* 80, 100 unused */
64c563
+#define NFSEXP_SECURITY_LABEL	0x0080
64c563
+/* 0x100 unused */
64c563
 #define NFSEXP_NOHIDE		0x0200
64c563
 #define NFSEXP_NOSUBTREECHECK	0x0400
64c563
 #define NFSEXP_NOAUTHNLM	0x0800
64c563
diff -up nfs-utils-1.3.0/support/nfs/exports.c.orig nfs-utils-1.3.0/support/nfs/exports.c
64c563
--- nfs-utils-1.3.0/support/nfs/exports.c.orig	2017-03-27 10:07:41.549399315 -0400
64c563
+++ nfs-utils-1.3.0/support/nfs/exports.c	2017-03-27 10:08:58.441794848 -0400
64c563
@@ -274,6 +274,8 @@ putexportent(struct exportent *ep)
64c563
 		"no_" : "");
64c563
 	if (ep->e_flags & NFSEXP_NOREADDIRPLUS)
64c563
 		fprintf(fp, "nordirplus,");
64c563
+	if (ep->e_flags & NFSEXP_SECURITY_LABEL)
64c563
+		fprintf(fp, "security_label,");
64c563
 	fprintf(fp, "%spnfs,", (ep->e_flags & NFSEXP_PNFS)? "" : "no_");
64c563
 	if (ep->e_flags & NFSEXP_FSID) {
64c563
 		fprintf(fp, "fsid=%d,", ep->e_fsid);
64c563
@@ -543,6 +545,8 @@ parseopts(char *cp, struct exportent *ep
64c563
 			setflags(NFSEXP_ASYNC, active, ep);
64c563
 		else if (!strcmp(opt, "nordirplus"))
64c563
 			setflags(NFSEXP_NOREADDIRPLUS, active, ep);
64c563
+		else if (!strcmp(opt, "security_label"))
64c563
+			setflags(NFSEXP_SECURITY_LABEL, active, ep);
64c563
 		else if (!strcmp(opt, "nohide"))
64c563
 			setflags(NFSEXP_NOHIDE, active, ep);
64c563
 		else if (!strcmp(opt, "hide"))
64c563
diff -up nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig nfs-utils-1.3.0/utils/exportfs/exportfs.c
64c563
--- nfs-utils-1.3.0/utils/exportfs/exportfs.c.orig	2017-03-27 10:08:58.441794848 -0400
64c563
+++ nfs-utils-1.3.0/utils/exportfs/exportfs.c	2017-03-27 10:11:00.939046616 -0400
64c563
@@ -835,6 +835,8 @@ dump(int verbose, int export_format)
64c563
 				c = dumpopt(c, "no_subtree_check");
64c563
 			if (ep->e_flags & NFSEXP_NOAUTHNLM)
64c563
 				c = dumpopt(c, "insecure_locks");
64c563
+			if (ep->e_flags & NFSEXP_SECURITY_LABEL)
64c563
+				c = dumpopt(c, "security_label");
64c563
 			if (ep->e_flags & NFSEXP_NOACL)
64c563
 				c = dumpopt(c, "no_acl");
64c563
 			if (ep->e_flags & NFSEXP_PNFS)
64c563
diff -up nfs-utils-1.3.0/utils/exportfs/exports.man.orig nfs-utils-1.3.0/utils/exportfs/exports.man
64c563
--- nfs-utils-1.3.0/utils/exportfs/exports.man.orig	2017-03-27 10:07:41.515398698 -0400
64c563
+++ nfs-utils-1.3.0/utils/exportfs/exports.man	2017-03-27 10:08:58.441794848 -0400
64c563
@@ -417,6 +417,14 @@ devices. The default can be explicitly r
64c563
 .I no_pnfs
64c563
 option.
64c563
 
64c563
+.TP
64c563
+.IR security_label
64c563
+With this option set, clients using NFSv4.2 or higher will be able to
64c563
+set and retrieve security labels (such as those used by SELinux).  This
64c563
+will only work if all clients use a consistent security policy.  Note
64c563
+that early kernels did not support this export option, and instead
64c563
+enabled security labels by default.
64c563
+
64c563
 .SS User ID Mapping
64c563
 .PP
64c563
 .B nfsd