Patch to fix quota panic from Mike Karels:

allow Q_SYNC regardless of "target" uid, we allow it with -1;
fix bug that caused all ops to refer to user quotas, not group.

Submitted by:	Mike Karels
This commit is contained in:
David Greenman 1995-03-10 22:06:39 +00:00
parent f8a0b2dd88
commit 57677027ac
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6992

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)ufs_vfsops.c 8.4 (Berkeley) 4/16/94 * @(#)ufs_vfsops.c 8.4 (Berkeley) 4/16/94
* $Id: ufs_vfsops.c,v 1.2 1994/08/02 07:55:01 davidg Exp $ * $Id: ufs_vfsops.c,v 1.3 1994/10/08 06:57:28 phk Exp $
*/ */
#include <sys/param.h> #include <sys/param.h>
@ -113,8 +113,9 @@ ufs_quotactl(mp, cmds, uid, arg, p)
cmd = cmds >> SUBCMDSHIFT; cmd = cmds >> SUBCMDSHIFT;
switch (cmd) { switch (cmd) {
case Q_GETQUOTA:
case Q_SYNC: case Q_SYNC:
break;
case Q_GETQUOTA:
if (uid == p->p_cred->p_ruid) if (uid == p->p_cred->p_ruid)
break; break;
/* fall through */ /* fall through */
@ -123,7 +124,7 @@ ufs_quotactl(mp, cmds, uid, arg, p)
return (error); return (error);
} }
type = cmd & SUBCMDMASK; type = cmds & SUBCMDMASK;
if ((u_int)type >= MAXQUOTAS) if ((u_int)type >= MAXQUOTAS)
return (EINVAL); return (EINVAL);