aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/key.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-06-26 03:24:50 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 12:58:18 -0400
commit7e047ef5fe2d52e83020e856b1bf2556a6a2ce98 (patch)
tree97656e2c56a27be9d1da451dde627b693b8643f2 /include/linux/key.h
parentf116629d03655adaf7832b93b03c99391d09d4a7 (diff)
[PATCH] keys: sort out key quota system
Add the ability for key creation to overrun the user's quota in some circumstances - notably when a session keyring is created and assigned to a process that didn't previously have one. This means it's still possible to log in, should PAM require the creation of a new session keyring, and fix an overburdened key quota. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index e81ebf910d0b..e693e729bc92 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -248,7 +248,14 @@ extern struct key *key_alloc(struct key_type *type,
248 const char *desc, 248 const char *desc,
249 uid_t uid, gid_t gid, 249 uid_t uid, gid_t gid,
250 struct task_struct *ctx, 250 struct task_struct *ctx,
251 key_perm_t perm, int not_in_quota); 251 key_perm_t perm,
252 unsigned long flags);
253
254
255#define KEY_ALLOC_IN_QUOTA 0x0000 /* add to quota, reject if would overrun */
256#define KEY_ALLOC_QUOTA_OVERRUN 0x0001 /* add to quota, permit even if overrun */
257#define KEY_ALLOC_NOT_IN_QUOTA 0x0002 /* not in quota */
258
252extern int key_payload_reserve(struct key *key, size_t datalen); 259extern int key_payload_reserve(struct key *key, size_t datalen);
253extern int key_instantiate_and_link(struct key *key, 260extern int key_instantiate_and_link(struct key *key,
254 const void *data, 261 const void *data,
@@ -285,7 +292,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring,
285 const char *description, 292 const char *description,
286 const void *payload, 293 const void *payload,
287 size_t plen, 294 size_t plen,
288 int not_in_quota); 295 unsigned long flags);
289 296
290extern int key_update(key_ref_t key, 297extern int key_update(key_ref_t key,
291 const void *payload, 298 const void *payload,
@@ -299,7 +306,7 @@ extern int key_unlink(struct key *keyring,
299 306
300extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 307extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
301 struct task_struct *ctx, 308 struct task_struct *ctx,
302 int not_in_quota, 309 unsigned long flags,
303 struct key *dest); 310 struct key *dest);
304 311
305extern int keyring_clear(struct key *keyring); 312extern int keyring_clear(struct key *keyring);