summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Dufour <cedric.dufour@idiap.ch>2014-01-24 20:57:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-22 13:32:26 -0800
commitad96de0aba42b6b51592f94774aec6186784bf4c (patch)
treed07211a4f4c1c63b31e0d6d90d80bca47efc12c7
parentf71d15f0f5c6a2ef55f3424bcaee1e9c467b905e (diff)
staging: lustre: fix quotactl permission denied (LU-4530)
commit 8b9e418c013e8b671fc10108ab14243f0657bffd upstream. The changes introduced in commit 4b1a25f06b30b203 ("fix build when CONFIG_UIDGID_STRICT_TYPE_CHECKS is on") got the UID check the wrong way around, leading to "Permission denied" when a regular user attempts to retrieve his quota (lfs quota -u ...) but allowing him to retrieve other users quota. Full details at: https://jira.hpdd.intel.com/browse/LU-4530 Cc: Peng Tao <tao.peng@emc.com> Signed-off-by: Cédric Dufour <cedric.dufour@idiap.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c
index 09844be5eec4..b369dff44756 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1086,7 +1086,7 @@ static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
break;
case Q_GETQUOTA:
if (((type == USRQUOTA &&
- uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
+ !uid_eq(current_euid(), make_kuid(&init_user_ns, id))) ||
(type == GRPQUOTA &&
!in_egroup_p(make_kgid(&init_user_ns, id)))) &&
(!cfs_capable(CFS_CAP_SYS_ADMIN) ||