From bd4473d64df793c1e35a874f0d4a5ce359127897 Mon Sep 17 00:00:00 2001 From: manu Date: Sun, 9 Sep 2012 04:27:49 +0000 Subject: [PATCH] Temporary fix for quotactl authorization: it must use the effective UID and not the real UID. Further work is required to move the check to the kauth listener instead of having it in UFS code. --- sys/ufs/ufs/ufs_quota.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c index 2b802434cf4b..b78f901c1340 100644 --- a/sys/ufs/ufs/ufs_quota.c +++ b/sys/ufs/ufs/ufs_quota.c @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota.c,v 1.111 2012/08/26 02:32:14 dholland Exp $ */ +/* $NetBSD: ufs_quota.c,v 1.112 2012/09/09 04:27:49 manu Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993, 1995 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.111 2012/08/26 02:32:14 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_quota.c,v 1.112 2012/09/09 04:27:49 manu Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -335,7 +335,7 @@ quota_handle_cmd_objtypestat(struct mount *mp, struct lwp *l, static int quota_get_auth(struct mount *mp, struct lwp *l, uid_t id) { /* The user can always query about his own quota. */ - if (id == kauth_cred_getuid(l->l_cred)) + if (id == kauth_cred_geteuid(l->l_cred)) return 0; return kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FS_QUOTA, KAUTH_REQ_SYSTEM_FS_QUOTA_GET, mp, KAUTH_ARG(id), NULL);