From: David Howells Make key quota detection generate an error if either quota is exceeded rather than only if both quotas are exceeded. Signed-off-by: David Howells Signed-off-by: Andrew Morton --- security/keys/key.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN security/keys/key.c~keys-fix-key-quota-management-on-key-allocation security/keys/key.c --- devel/security/keys/key.c~keys-fix-key-quota-management-on-key-allocation 2006-02-18 02:20:35.000000000 -0800 +++ devel-akpm/security/keys/key.c 2006-02-18 02:20:35.000000000 -0800 @@ -1,6 +1,6 @@ /* key.c: basic authentication token and access key management * - * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. + * Copyright (C) 2004-6 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * * This program is free software; you can redistribute it and/or @@ -271,7 +271,7 @@ struct key *key_alloc(struct key_type *t * its description */ if (!not_in_quota) { spin_lock(&user->lock); - if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS && + if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS || user->qnbytes + quotalen >= KEYQUOTA_MAX_BYTES ) goto no_quota; _