summaryrefslogtreecommitdiff
path: root/usr.sbin/quotaon
diff options
context:
space:
mode:
authordm <dm@cvs.openbsd.org>1997-06-04 04:18:38 +0000
committerdm <dm@cvs.openbsd.org>1997-06-04 04:18:38 +0000
commitff82558cbc439107b8f48a8cbca040506671d9ad (patch)
tree604f84203fc946a8f81026ea5a215f44e4db286b /usr.sbin/quotaon
parent2dbf463b1fa036f3f7c08d3efd19a69562b54936 (diff)
Dumped core.
Diffstat (limited to 'usr.sbin/quotaon')
-rw-r--r--usr.sbin/quotaon/quotaon.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c
index 8091b32ac7c..4579d6f5ec8 100644
--- a/usr.sbin/quotaon/quotaon.c
+++ b/usr.sbin/quotaon/quotaon.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)quotaon.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: quotaon.c,v 1.8 1997/01/17 07:14:19 millert Exp $";
+static char *rcsid = "$Id: quotaon.c,v 1.9 1997/06/04 04:18:37 dm Exp $";
#endif /* not lint */
/*
@@ -121,19 +121,23 @@ main(argc, argv)
strcmp(fs->fs_vfstype, "mfs"))
continue;
if (aflag) {
- if (gflag && hasquota(fs, GRPQUOTA, &qfnp))
+ if (gflag && hasquota(fs, GRPQUOTA, &qfnp, 0))
errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
- if (uflag && hasquota(fs, USRQUOTA, &qfnp))
+ if (uflag && hasquota(fs, USRQUOTA, &qfnp, 0))
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)
+ if (gflag) {
+ hasquota(fs, GRPQUOTA, &qfnp, 1);
errs += quotaonoff(fs, offmode, GRPQUOTA, qfnp);
- if (uflag)
+ }
+ if (uflag) {
+ hasquota(fs, USRQUOTA, &qfnp, 1);
errs += quotaonoff(fs, offmode, USRQUOTA, qfnp);
+ }
}
}
endfsent();
@@ -158,7 +162,6 @@ quotaonoff(fs, offmode, type, qfpathname)
int offmode, type;
char *qfpathname;
{
-
if (strcmp(fs->fs_file, "/") && readonly(fs))
return (1);
if (offmode) {
@@ -200,10 +203,11 @@ oneof(target, list, cnt)
/*
* Check to see if a particular quota is to be enabled.
*/
-hasquota(fs, type, qfnamep)
+hasquota(fs, type, qfnamep, force)
register struct fstab *fs;
int type;
char **qfnamep;
+ int force;
{
register char *opt;
char *cp;
@@ -224,7 +228,7 @@ hasquota(fs, type, qfnamep)
if (type == GRPQUOTA && strcmp(opt, grpname) == 0)
break;
}
- if (!opt)
+ if (!force && !opt)
return (0);
if (cp) {
*qfnamep = cp;