From 6b79ccb5144f9ffb4d4596c23e7570238dd12abc Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 29 Apr 2008 01:01:28 -0700 Subject: 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 Signed-off-by: David Howells Cc: Satyam Sharma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/key.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') 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; #define KEY_OTH_SETATTR 0x00000020 #define KEY_OTH_ALL 0x0000003f +#define KEY_PERM_UNDEF 0xffffffff + struct seq_file; struct user_struct; struct signal_struct; @@ -232,6 +234,7 @@ extern key_ref_t key_create_or_update(key_ref_t keyring, const char *description, const void *payload, size_t plen, + key_perm_t perm, unsigned long flags); extern int key_update(key_ref_t key, -- cgit v1.2.2