[patch] userquota=<file> syntax in fstab is broken

Kostik Belousov kostikbel at gmail.com
Thu May 4 10:25:55 UTC 2006


Man page for fstab describes syntax of the form
userquota=<file> and groupquota=<file> that allows to specify
alternative quota files. This feature is supported by quota*(8)
group of commands, but putting such option into the fstab
cause complain from kernel, since this options shall be trimmed
from mount option list.

Rev. 1.75 of sbin/mount/mount.c does this for userquota/groupquota
_without_ "=<file>". Patch below fixes the problem for specified
syntax as well.

Please, apply.

Index: sbin/mount/mount.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/sbin/mount/mount.c,v
retrieving revision 1.83
diff -u -r1.83 mount.c
--- sbin/mount/mount.c	3 Mar 2006 02:46:15 -0000	1.83
+++ sbin/mount/mount.c	4 May 2006 10:24:25 -0000
@@ -120,6 +120,9 @@
 	0
 };
 
+static const char userquotaeq[] = "userquota=";
+static const char groupquotaeq[] = "groupquota=";
+
 static int
 use_mountprog(const char *vfstype)
 {
@@ -634,8 +637,12 @@
 				continue;
 			} else if (strcmp(p, "userquota") == 0) {
 				continue;
+			} else if (strncmp(p, userquotaeq, sizeof(userquotaeq) - 1) == 0) {
+				continue;
 			} else if (strcmp(p, "groupquota") == 0) {
 				continue;
+			} else if (strncmp(p, groupquotaeq, sizeof(groupquotaeq) - 1) == 0) {
+				continue;
 			} else if (*p == '-') {
 				argv[argc++] = p;
 				p = strchr(p, '=');

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060504/2b98989a/attachment.pgp


More information about the freebsd-current mailing list