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

From: Kostik Belousov <kostikbel_at_gmail.com>
Date: Thu, 4 May 2006 13:25:46 +0300
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
_at__at_ -120,6 +120,9 _at__at_
 	0
 };
 
+static const char userquotaeq[] = "userquota=";
+static const char groupquotaeq[] = "groupquota=";
+
 static int
 use_mountprog(const char *vfstype)
 {
_at__at_ -634,8 +637,12 _at__at_
 				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, '=');


Received on Thu May 04 2006 - 08:25:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:55 UTC