From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org
Cc: keyrings@linux-nfs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Keys: Fix key quota management on key allocation
Date: Fri, 17 Feb 2006 14:49:33 +0000 [thread overview]
Message-ID: <8141.1140187773@warthog.cambridge.redhat.com> (raw)
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;
reply other threads:[~2006-02-17 14:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8141.1140187773@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=keyrings@linux-nfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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