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.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index 0836cc838b0c..69ecf0934b02 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -73,6 +73,7 @@ struct key;
73struct seq_file; 73struct seq_file;
74struct user_struct; 74struct user_struct;
75struct signal_struct; 75struct signal_struct;
76struct cred;
76 77
77struct key_type; 78struct key_type;
78struct key_owner; 79struct key_owner;
@@ -181,7 +182,7 @@ struct key {
181extern struct key *key_alloc(struct key_type *type, 182extern struct key *key_alloc(struct key_type *type,
182 const char *desc, 183 const char *desc,
183 uid_t uid, gid_t gid, 184 uid_t uid, gid_t gid,
184 struct task_struct *ctx, 185 const struct cred *cred,
185 key_perm_t perm, 186 key_perm_t perm,
186 unsigned long flags); 187 unsigned long flags);
187 188
@@ -249,7 +250,7 @@ extern int key_unlink(struct key *keyring,
249 struct key *key); 250 struct key *key);
250 251
251extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, 252extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid,
252 struct task_struct *ctx, 253 const struct cred *cred,
253 unsigned long flags, 254 unsigned long flags,
254 struct key *dest); 255 struct key *dest);
255 256
@@ -276,22 +277,12 @@ extern ctl_table key_sysctls[];
276/* 277/*
277 * the userspace interface 278 * the userspace interface
278 */ 279 */
279extern void switch_uid_keyring(struct user_struct *new_user); 280extern int install_thread_keyring_to_cred(struct cred *cred);
280extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
281extern void exit_keys(struct task_struct *tsk);
282extern int suid_keys(struct task_struct *tsk);
283extern int exec_keys(struct task_struct *tsk); 281extern int exec_keys(struct task_struct *tsk);
284extern void key_fsuid_changed(struct task_struct *tsk); 282extern void key_fsuid_changed(struct task_struct *tsk);
285extern void key_fsgid_changed(struct task_struct *tsk); 283extern void key_fsgid_changed(struct task_struct *tsk);
286extern void key_init(void); 284extern void key_init(void);
287 285
288#define __install_session_keyring(keyring) \
289({ \
290 struct key *old_session = current->cred->tgcred->session_keyring; \
291 current->cred->tgcred->session_keyring = keyring; \
292 old_session; \
293})
294
295#else /* CONFIG_KEYS */ 286#else /* CONFIG_KEYS */
296 287
297#define key_validate(k) 0 288#define key_validate(k) 0
@@ -303,11 +294,6 @@ extern void key_init(void);
303#define make_key_ref(k, p) NULL 294#define make_key_ref(k, p) NULL
304#define key_ref_to_ptr(k) NULL 295#define key_ref_to_ptr(k) NULL
305#define is_key_possessed(k) 0 296#define is_key_possessed(k) 0
306#define switch_uid_keyring(u) do { } while(0)
307#define __install_session_keyring(k) ({ NULL; })
308#define copy_keys(f,t) 0
309#define exit_keys(t) do { } while(0)
310#define suid_keys(t) do { } while(0)
311#define exec_keys(t) do { } while(0) 297#define exec_keys(t) do { } while(0)
312#define key_fsuid_changed(t) do { } while(0) 298#define key_fsuid_changed(t) do { } while(0)
313#define key_fsgid_changed(t) do { } while(0) 299#define key_fsgid_changed(t) do { } while(0)