Subject: Semantic problem in quotaon ?
To: None <current-users@NetBSD.ORG>
From: Joao Carlos Mendes Luis <jonny@gaia.coppe.ufrj.br>
List: current-users
Date: 02/18/1996 15:19:09
Hi all,

  I have been using SunOS for a time, and noted a behaviour in NetBSD
that differs slightly from it.  Maybe it's just a problem of inter-
pretation of the manuals, but seens to me that there's a "bug" in
quotaon.

  I cannot not turn quotas on or off in a file system which entry in
/etc/fstab does not have the quota option.  It's somewhat cosmetic,
but this does not allow me to turn quotas on the fly without editing
fstab, as in SunOS.  IMHO, the options in fstab exist ONLY to be used
by the -a option of quotaon, and should not be more restrictive.

  Looking into the sources, it seens that the code for manual file
system specification has been copied from the -a option.  Here are my
proposed patches to quotaon.c:


*** quotaon.c	Sun Feb 18 02:42:35 1996
--- /usr/src/usr.sbin/quotaon/quotaon.c	Mon Jun 13 19:04:14 1994
***************
*** 118,140 ****
  		if (aflag) {
  			if (gflag && hasquota(fs, GRPQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
  			if (uflag && hasquota(fs, USRQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
  			continue;
  		}
  		if ((argnum = oneof(fs->fs_file, argv, argc)) >= 0 ||
  		    (argnum = oneof(fs->fs_spec, argv, argc)) >= 0) {
  			done |= 1 << argnum;
! 			if (gflag)
  				errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
! 			if (uflag)
  				errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
  		}
--- 118,140 ----
  		if (aflag) {
  			if (gflag && hasquota(fs, GRPQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
  			if (uflag && hasquota(fs, USRQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
  			continue;
  		}
  		if ((argnum = oneof(fs->fs_file, argv, argc)) >= 0 ||
  		    (argnum = oneof(fs->fs_spec, argv, argc)) >= 0) {
  			done |= 1 << argnum;
! 			if (gflag && hasquota(fs, GRPQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
! 			if (uflag && hasquota(fs, USRQUOTA, &qfnp))
  				errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
  		}

					Jonny

--
Joao Carlos Mendes Luis			jonny@coe.ufrj.br
+55 21 290-4698 ( Job )			jonny@cisi.coppe.ufrj.br
Network Manager				UFRJ/COPPE/CISI
Universidade Federal do Rio de Janeiro	"Use the source, Luke"