diff options
| author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
| commit | 4854c7b27f0975a2b629f35ea3996d2968eb7c4f (patch) | |
| tree | 4102bdb70289764a2058aff0f907b13d7cf0e0d1 /include/linux/key.h | |
| parent | 3cbd5b32cb625f5c0f1b1476d154fac873dd49ce (diff) | |
| parent | fcc18e83e1f6fd9fa6b333735bf0fcd530655511 (diff) | |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/key.h')
| -rw-r--r-- | include/linux/key.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/include/linux/key.h b/include/linux/key.h index cbf464ad9589..e81ebf910d0b 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -205,6 +205,11 @@ struct key_type { | |||
| 205 | /* match a key against a description */ | 205 | /* match a key against a description */ |
| 206 | int (*match)(const struct key *key, const void *desc); | 206 | int (*match)(const struct key *key, const void *desc); |
| 207 | 207 | ||
| 208 | /* clear some of the data from a key on revokation (optional) | ||
| 209 | * - the key's semaphore will be write-locked by the caller | ||
| 210 | */ | ||
| 211 | void (*revoke)(struct key *key); | ||
| 212 | |||
| 208 | /* clear the data from a key (optional) */ | 213 | /* clear the data from a key (optional) */ |
| 209 | void (*destroy)(struct key *key); | 214 | void (*destroy)(struct key *key); |
| 210 | 215 | ||
| @@ -241,8 +246,9 @@ extern void unregister_key_type(struct key_type *ktype); | |||
| 241 | 246 | ||
| 242 | extern struct key *key_alloc(struct key_type *type, | 247 | extern struct key *key_alloc(struct key_type *type, |
| 243 | const char *desc, | 248 | const char *desc, |
| 244 | uid_t uid, gid_t gid, key_perm_t perm, | 249 | uid_t uid, gid_t gid, |
| 245 | int not_in_quota); | 250 | struct task_struct *ctx, |
| 251 | key_perm_t perm, int not_in_quota); | ||
| 246 | extern int key_payload_reserve(struct key *key, size_t datalen); | 252 | extern int key_payload_reserve(struct key *key, size_t datalen); |
| 247 | extern int key_instantiate_and_link(struct key *key, | 253 | extern int key_instantiate_and_link(struct key *key, |
| 248 | const void *data, | 254 | const void *data, |
| @@ -292,7 +298,9 @@ extern int key_unlink(struct key *keyring, | |||
| 292 | struct key *key); | 298 | struct key *key); |
| 293 | 299 | ||
| 294 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, | 300 | extern struct key *keyring_alloc(const char *description, uid_t uid, gid_t gid, |
| 295 | int not_in_quota, struct key *dest); | 301 | struct task_struct *ctx, |
| 302 | int not_in_quota, | ||
| 303 | struct key *dest); | ||
| 296 | 304 | ||
| 297 | extern int keyring_clear(struct key *keyring); | 305 | extern int keyring_clear(struct key *keyring); |
| 298 | 306 | ||
| @@ -313,7 +321,8 @@ extern void keyring_replace_payload(struct key *key, void *replacement); | |||
| 313 | * the userspace interface | 321 | * the userspace interface |
| 314 | */ | 322 | */ |
| 315 | extern struct key root_user_keyring, root_session_keyring; | 323 | extern struct key root_user_keyring, root_session_keyring; |
| 316 | extern int alloc_uid_keyring(struct user_struct *user); | 324 | extern int alloc_uid_keyring(struct user_struct *user, |
| 325 | struct task_struct *ctx); | ||
| 317 | extern void switch_uid_keyring(struct user_struct *new_user); | 326 | extern void switch_uid_keyring(struct user_struct *new_user); |
| 318 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); | 327 | extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk); |
| 319 | extern int copy_thread_group_keys(struct task_struct *tsk); | 328 | extern int copy_thread_group_keys(struct task_struct *tsk); |
| @@ -342,7 +351,7 @@ extern void key_init(void); | |||
| 342 | #define make_key_ref(k) ({ NULL; }) | 351 | #define make_key_ref(k) ({ NULL; }) |
| 343 | #define key_ref_to_ptr(k) ({ NULL; }) | 352 | #define key_ref_to_ptr(k) ({ NULL; }) |
| 344 | #define is_key_possessed(k) 0 | 353 | #define is_key_possessed(k) 0 |
| 345 | #define alloc_uid_keyring(u) 0 | 354 | #define alloc_uid_keyring(u,c) 0 |
| 346 | #define switch_uid_keyring(u) do { } while(0) | 355 | #define switch_uid_keyring(u) do { } while(0) |
| 347 | #define __install_session_keyring(t, k) ({ NULL; }) | 356 | #define __install_session_keyring(t, k) ({ NULL; }) |
| 348 | #define copy_keys(f,t) 0 | 357 | #define copy_keys(f,t) 0 |
| @@ -355,6 +364,10 @@ extern void key_init(void); | |||
| 355 | #define key_fsgid_changed(t) do { } while(0) | 364 | #define key_fsgid_changed(t) do { } while(0) |
| 356 | #define key_init() do { } while(0) | 365 | #define key_init() do { } while(0) |
| 357 | 366 | ||
| 367 | /* Initial keyrings */ | ||
| 368 | extern struct key root_user_keyring; | ||
| 369 | extern struct key root_session_keyring; | ||
| 370 | |||
| 358 | #endif /* CONFIG_KEYS */ | 371 | #endif /* CONFIG_KEYS */ |
| 359 | #endif /* __KERNEL__ */ | 372 | #endif /* __KERNEL__ */ |
| 360 | #endif /* _LINUX_KEY_H */ | 373 | #endif /* _LINUX_KEY_H */ |
