aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/key.h
diff options
context:
space:
mode:
authorArun Raghavan <arunsr@cse.iitk.ac.in>2008-04-29 04:01:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:16 -0400
commit6b79ccb5144f9ffb4d4596c23e7570238dd12abc (patch)
treee674339e9f86c3607304496792b417b0ed66de6f /include/linux/key.h
parentda91d2ef9fe4fd84cc0a8a729201d38e40ac9f2e (diff)
keys: allow clients to set key perms in key_create_or_update()
The key_create_or_update() function provided by the keyring code has a default set of permissions that are always applied to the key when created. This might not be desirable to all clients. Here's a patch that adds a "perm" parameter to the function to address this, which can be set to KEY_PERM_UNDEF to revert to the current behaviour. Signed-off-by: Arun Raghavan <arunsr@cse.iitk.ac.in> Signed-off-by: David Howells <dhowells@redhat.com> Cc: Satyam Sharma <ssatyam@cse.iitk.ac.in> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index 163f864b6bd4..8b0bd3393abc 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -67,6 +67,8 @@ struct key;
67#define KEY_OTH_SETATTR 0x00000020 67#define KEY_OTH_SETATTR 0x00000020
68#define KEY_OTH_ALL 0x0000003f 68#define KEY_OTH_ALL 0x0000003f
69 69
70#define KEY_PERM_UNDEF 0xffffffff
71
70struct seq_file; 72struct seq_file;
71struct user_struct; 73struct user_struct;
72struct signal_struct; 74struct signal_struct;
@@ -232,6 +234,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring,
232 const char *description, 234 const char *description,
233 const void *payload, 235 const void *payload,
234 size_t plen, 236 size_t plen,
237 key_perm_t perm,
235 unsigned long flags); 238 unsigned long flags);
236 239
237extern int key_update(key_ref_t key, 240extern int key_update(key_ref_t key,