util-linux/util-linux-2.11u-nfs-mount_acl.diff

86 lines
2.7 KiB
Diff

Adds the [no]acl NFS mount option that was added to the kernel. This
change has been discussed and accepted by Trond Myklebust
<trond.myklebust@fys.uio.no> and Olaf Kirch <okir@suse.de>.
-- Andreas Gruenbacher <agruen@suse.de>
================================================================================
--- util-linux-2.12q/mount/mount.8
+++ util-linux-2.12q/mount/mount.8
@@ -1335,7 +1335,8 @@
.BR ac ,
.BR tcp ,
.BR udp ,
-.BR lock .
+.BR lock ,
+.BR acl .
For details, see
.BR nfs (5).
--- util-linux-2.12q/mount/nfs.5
+++ util-linux-2.12q/mount/nfs.5
@@ -204,6 +204,15 @@
.I udp
Mount the NFS filesystem using the UDP protocol. This
is the default.
+.TP 1.5i
+.I noacl
+Assume no extended access control mechanisms like POSIX ACLs are used
+on the NFS filesystem, and depend on the file mode permission bits
+instead of using the ACCESS remote procedure call. The default is to
+use the ACCESS remote procedure call for making access decisions in
+NFS version 3. (On NFS version 2 filesystems this option has no effect.)
+This option also deactivates the GETACL and SETACL remote procedure calls
+which are otherwise used to manipulate ACLs.
.P
All of the non-value options have corresponding nooption forms.
For example, nointr means don't allow file operations to be
--- util-linux-2.12q/mount/nfs_mount4.h
+++ util-linux-2.12q/mount/nfs_mount4.h
@@ -51,4 +51,4 @@
#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
#define NFS_MOUNT_NONLM 0x0200 /* 3 */
#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
-
+#define NFS_MOUNT_NOACL 0x0800 /* 4 */
--- util-linux-2.12q/mount/nfsmount.c
+++ util-linux-2.12q/mount/nfsmount.c
@@ -216,7 +216,7 @@
struct stat statbuf;
char *s;
int port, mountport, proto, bg, soft, intr;
- int posix, nocto, noac, nolock, broken_suid;
+ int posix, nocto, noac, nolock, broken_suid, noacl;
int retry, tcp;
int mountprog, mountvers, nfsprog, nfsvers;
int retval;
@@ -316,6 +316,7 @@
nocto = 0;
nolock = 0;
broken_suid = 0;
+ noacl = 0;
noac = 0;
retry = 10000; /* 10000 minutes ~ 1 week */
tcp = 0;
@@ -427,6 +428,8 @@
printf(_("Warning: option nolock is not supported.\n"));
} else if (!strcmp(opt, "broken_suid")) {
broken_suid = val;
+ } else if (!strcmp(opt, "acl")) {
+ noacl = !val;
} else {
if (!sloppy) {
printf(_("unknown nfs mount option: "
@@ -452,8 +455,10 @@
data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
#endif
#if NFS_MOUNT_VERSION >= 4
- if (nfs_mount_version >= 4)
+ if (nfs_mount_version >= 4) {
data.flags |= (broken_suid ? NFS_MOUNT_BROKEN_SUID : 0);
+ data.flags |= (noacl ? NFS_MOUNT_NOACL : 0);
+ }
#endif
if (nfsvers > MAX_NFSPROT) {
fprintf(stderr, "NFSv%d not supported!\n", nfsvers);