aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index cbf464ad9589..8c275d12ef63 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -241,8 +241,9 @@ extern void unregister_key_type(struct key_type *ktype);
241 241
242extern struct key *key_alloc(struct key_type *type, 242extern struct key *key_alloc(struct key_type *type,
243 const char *desc, 243 const char *desc,
244 uid_t uid, gid_t gid, key_perm_t perm, 244 uid_t uid, gid_t gid,
245 int not_in_quota); 245 struct task_struct *ctx,
246 key_perm_t perm, int not_in_quota);
246extern int key_payload_reserve(struct key *key, size_t datalen); 247extern int key_payload_reserve(struct key *key, size_t datalen);
247extern int key_instantiate_and_link(struct key *key, 248extern int key_instantiate_and_link(struct key *key,
248 const void *data, 249 const void *data,
@@ -292,7 +293,9 @@ extern int key_unlink(struct key *keyring,
292 struct key *key); 293 struct key *key);
293 294
294extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 295extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
295 int not_in_quota, struct key *dest); 296 struct task_struct *ctx,
297 int not_in_quota,
298 struct key *dest);
296 299
297extern int keyring_clear(struct key *keyring); 300extern int keyring_clear(struct key *keyring);
298 301
@@ -313,7 +316,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement);
313 * the userspace interface 316 * the userspace interface
314 */ 317 */
315extern struct key root_user_keyring, root_session_keyring; 318extern struct key root_user_keyring, root_session_keyring;
316extern int alloc_uid_keyring(struct user_struct *user); 319extern int alloc_uid_keyring(struct user_struct *user,
320 struct task_struct *ctx);
317extern void switch_uid_keyring(struct user_struct *new_user); 321extern void switch_uid_keyring(struct user_struct *new_user);
318extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); 322extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
319extern int copy_thread_group_keys(struct task_struct *tsk); 323extern int copy_thread_group_keys(struct task_struct *tsk);
@@ -342,7 +346,7 @@ extern void key_init(void);
342#define make_key_ref(k) ({ NULL; }) 346#define make_key_ref(k) ({ NULL; })
343#define key_ref_to_ptr(k) ({ NULL; }) 347#define key_ref_to_ptr(k) ({ NULL; })
344#define is_key_possessed(k) 0 348#define is_key_possessed(k) 0
345#define alloc_uid_keyring(u) 0 349#define alloc_uid_keyring(u,c) 0
346#define switch_uid_keyring(u) do { } while(0) 350#define switch_uid_keyring(u) do { } while(0)
347#define __install_session_keyring(t, k) ({ NULL; }) 351#define __install_session_keyring(t, k) ({ NULL; })
348#define copy_keys(f,t) 0 352#define copy_keys(f,t) 0
@@ -355,6 +359,10 @@ extern void key_init(void);
355#define key_fsgid_changed(t) do { } while(0) 359#define key_fsgid_changed(t) do { } while(0)
356#define key_init() do { } while(0) 360#define key_init() do { } while(0)
357 361
362/* Initial keyrings */
363extern struct key root_user_keyring;
364extern struct key root_session_keyring;
365
358#endif /* CONFIG_KEYS */ 366#endif /* CONFIG_KEYS */
359#endif /* __KERNEL__ */ 367#endif /* __KERNEL__ */
360#endif /* _LINUX_KEY_H */ 368#endif /* _LINUX_KEY_H */