summaryrefslogtreecommitdiffstats
path: root/support/nfs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2017-01-12 10:16:42 -0500
committerSteve Dickson <steved@redhat.com>2017-01-12 10:16:42 -0500
commit13e2f9577b88d44001b509e89122ad907805b250 (patch)
tree1a685945bfdfcaa1cd3f5674c65a63f2bbd2610b /support/nfs
parent9e12e221ead6d869977b43a99e4a7d13a33d82ee (diff)
downloadnfs-utils-13e2f9577b88d44001b509e89122ad907805b250.tar.gz
nfs-utils-13e2f9577b88d44001b509e89122ad907805b250.tar.xz
nfs-utils-13e2f9577b88d44001b509e89122ad907805b250.zip
exportfs: support "security_label" export option
On recent kernels only exports with NFSEXP_SECURITY_LABEL set will export security labels. Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs')
-rw-r--r--support/nfs/exports.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index d992747..92bd6e6 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -274,6 +274,8 @@ putexportent(struct exportent *ep)
"no_" : "");
if (ep->e_flags & NFSEXP_NOREADDIRPLUS)
fprintf(fp, "nordirplus,");
+ if (ep->e_flags & NFSEXP_SECURITY_LABEL)
+ fprintf(fp, "security_label,");
fprintf(fp, "%spnfs,", (ep->e_flags & NFSEXP_PNFS)? "" : "no_");
if (ep->e_flags & NFSEXP_FSID) {
fprintf(fp, "fsid=%d,", ep->e_fsid);
@@ -543,6 +545,8 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
setflags(NFSEXP_ASYNC, active, ep);
else if (!strcmp(opt, "nordirplus"))
setflags(NFSEXP_NOREADDIRPLUS, active, ep);
+ else if (!strcmp(opt, "security_label"))
+ setflags(NFSEXP_SECURITY_LABEL, active, ep);
else if (!strcmp(opt, "nohide"))
setflags(NFSEXP_NOHIDE, active, ep);
else if (!strcmp(opt, "hide"))