diff options
| author | Dave Quigley <dpquigl@taiga.selinuxproject.org> | 2012-02-21 12:53:13 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2012-02-21 12:53:13 -0500 |
| commit | 6523cedb3d95a99b828a264de8d2921c01a9a949 (patch) | |
| tree | 8014e688ed904d161913ad89393d72af9b9e22f2 /support | |
| parent | a9b897fe1aaf4927478350d4e927cf69b45b8aab (diff) | |
| download | nfs-utils-lnfsd-export.tar.gz | |
Add support to specify which exports will provide Labeled NFS support.lnfsd-export
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
| -rw-r--r-- | support/include/nfs/export.h | 3 | ||||
| -rw-r--r-- | support/nfs/exports.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/support/include/nfs/export.h b/support/include/nfs/export.h index 1547a87..b8e2fb0 100644 --- a/support/include/nfs/export.h +++ b/support/include/nfs/export.h @@ -17,7 +17,8 @@ #define NFSEXP_ALLSQUASH 0x0008 #define NFSEXP_ASYNC 0x0010 #define NFSEXP_GATHERED_WRITES 0x0020 -/* 40, 80, 100 unused */ +#define NFSEXP_SECURITY_LABEL 0x0040 /* Support MAC attribute */ +/* 80, 100 unused */ #define NFSEXP_NOHIDE 0x0200 #define NFSEXP_NOSUBTREECHECK 0x0400 #define NFSEXP_NOAUTHNLM 0x0800 diff --git a/support/nfs/exports.c b/support/nfs/exports.c index c96500f..52346dc 100644 --- a/support/nfs/exports.c +++ b/support/nfs/exports.c @@ -245,6 +245,8 @@ putexportent(struct exportent *ep) fprintf(fp, "%ssync,", (ep->e_flags & NFSEXP_ASYNC)? "a" : ""); fprintf(fp, "%swdelay,", (ep->e_flags & NFSEXP_GATHERED_WRITES)? "" : "no_"); + fprintf(fp, "%ssecurity_label,", (ep->e_flags & NFSEXP_SECURITY_LABEL)? + "" : "no"); fprintf(fp, "%shide,", (ep->e_flags & NFSEXP_NOHIDE)? "no" : ""); fprintf(fp, "%scrossmnt,", (ep->e_flags & NFSEXP_CROSSMOUNT)? @@ -539,6 +541,10 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr) setflags(NFSEXP_GATHERED_WRITES, active, ep); else if (!strcmp(opt, "no_wdelay")) clearflags(NFSEXP_GATHERED_WRITES, active, ep); + else if (strcmp(opt, "security_label") == 0) + ep->e_flags |= NFSEXP_SECURITY_LABEL; + else if (strcmp(opt, "nosecurity_label") == 0) + ep->e_flags &= ~NFSEXP_SECURITY_LABEL; else if (strcmp(opt, "root_squash") == 0) setflags(NFSEXP_ROOTSQUASH, active, ep); else if (!strcmp(opt, "no_root_squash")) |
