* [PATCH] Keys: Fix key quota management on key allocation
@ 2006-02-17 14:49 David Howells
0 siblings, 0 replies; only message in thread
From: David Howells @ 2006-02-17 14:49 UTC (permalink / raw)
To: torvalds, akpm; +Cc: keyrings, linux-kernel
The attached patch makes key quota detection generate an error if either quota
is exceeded rather than only if both quotas are exceeded.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 keys-quota-2616rc3.diff
security/keys/key.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -uNrp linux-2.6.16-rc3/security/keys/key.c linux-2.6.16-rc3-key-quota/security/keys/key.c
--- linux-2.6.16-rc3/security/keys/key.c 2006-02-15 11:17:01.000000000 +0000
+++ linux-2.6.16-rc3-key-quota/security/keys/key.c 2006-02-17 14:26:27.000000000 +0000
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-02-17 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-17 14:49 [PATCH] Keys: Fix key quota management on key allocation David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome