From d44dfb5d692e3c38d987ca775af156909295c7b3 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 25 Apr 1996 11:04:15 +0000 Subject: permit quotas to work on mfs; problem reported by rdante@pnet.net --- usr.sbin/edquota/edquota.c | 5 +++-- usr.sbin/quot/quot.c | 6 ++++-- usr.sbin/quotaon/quotaon.c | 15 +++++++++++---- usr.sbin/repquota/repquota.c | 5 +++-- 4 files changed, 21 insertions(+), 10 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c index 454ac052562..a78afda4325 100644 --- a/usr.sbin/edquota/edquota.c +++ b/usr.sbin/edquota/edquota.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: edquota.c,v 1.5 1996/04/21 23:40:32 deraadt Exp $"; +static char *rcsid = "$Id: edquota.c,v 1.6 1996/04/25 11:04:08 deraadt Exp $"; #endif /* not lint */ /* @@ -223,7 +223,8 @@ getprivs(id, quotatype) qcmd = QCMD(Q_GETQUOTA, quotatype); while (fs = getfsent()) { if (strcmp(fs->fs_vfstype, "ffs") && - strcmp(fs->fs_vfstype, "ufs")) + strcmp(fs->fs_vfstype, "ufs") && + strcmp(fs->fs_vfstype, "mfs")) continue; if (!hasquota(fs, quotatype, &qfpathname)) continue; diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 2c0b6f583f0..63b442b761d 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -30,7 +30,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: quot.c,v 1.2 1995/11/06 21:40:54 deraadt Exp $"; +static char rcsid[] = "$Id: quot.c,v 1.3 1996/04/25 11:04:11 deraadt Exp $"; #endif /* not lint */ #include @@ -567,7 +567,9 @@ int main(argc,argv) if (all) { cnt = getmntinfo(&mp,MNT_NOWAIT); for (; --cnt >= 0; mp++) { - if (!strncmp(mp->f_fstypename, MOUNT_FFS, MFSNAMELEN)) { + if (!strncmp(mp->f_fstypename, MOUNT_FFS, MFSNAMELEN) || + !strncmp(mp->f_fstypename, MOUNT_MFS, MFSNAMELEN) || + !strncmp(mp->f_fstypename, "ufs", MFSNAMELEN)) { if (nm = strrchr(mp->f_mntfromname,'/')) { sprintf(dev,"/dev/r%s",nm + 1); nm = dev; diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c index bb0fdc0aeb0..5dd2769331c 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.5 1996/04/21 23:41:36 deraadt Exp $"; +static char *rcsid = "$Id: quotaon.c,v 1.6 1996/04/25 11:04:13 deraadt Exp $"; #endif /* not lint */ /* @@ -117,7 +117,8 @@ main(argc, argv) if (strcmp(fs->fs_type, FSTAB_RW)) continue; if (strcmp(fs->fs_vfstype, "ffs") && - strcmp(fs->fs_vfstype, "ufs")) + strcmp(fs->fs_vfstype, "ufs") && + strcmp(fs->fs_vfstype, "mfs")) continue; if (aflag) { if (gflag && hasquota(fs, GRPQUOTA, &qfnp)) @@ -236,6 +237,7 @@ hasquota(fs, type, qfnamep) /* * Verify file system is mounted and not readonly. + * MFS is special -- it puts "mfs:" in the kernel's mount table */ readonly(fs) register struct fstab *fs; @@ -245,8 +247,13 @@ readonly(fs) if (statfs(fs->fs_file, &fsbuf) < 0 || strcmp(fsbuf.f_mntonname, fs->fs_file) || strcmp(fsbuf.f_mntfromname, fs->fs_spec)) { - printf("%s: not mounted\n", fs->fs_file); - return (1); + if (strcmp(fs->fs_file, "mfs") || + memcmp(fsbuf.f_mntfromname, "mfs:", sizeof("mfs:")-1)) + ; + else { + printf("%s: not mounted\n", fs->fs_file); + return (1); + } } if (fsbuf.f_flags & MNT_RDONLY) { printf("%s: mounted read-only\n", fs->fs_file); diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c index ec07841efe4..7db5c19acb6 100644 --- a/usr.sbin/repquota/repquota.c +++ b/usr.sbin/repquota/repquota.c @@ -42,7 +42,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)repquota.c 8.1 (Berkeley) 6/6/93";*/ -static char *rcsid = "$Id: repquota.c,v 1.5 1996/04/21 23:41:45 deraadt Exp $"; +static char *rcsid = "$Id: repquota.c,v 1.6 1996/04/25 11:04:14 deraadt Exp $"; #endif /* not lint */ /* @@ -133,7 +133,8 @@ main(argc, argv) setfsent(); while ((fs = getfsent()) != NULL) { if (strcmp(fs->fs_vfstype, "ffs") && - strcmp(fs->fs_vfstype, "ufs")) + strcmp(fs->fs_vfstype, "ufs") && + strcmp(fs->fs_vfstype, "mfs")) continue; if (aflag) { if (gflag && hasquota(fs, GRPQUOTA, &qfnp)) -- cgit v1.2.3