1KEYCTL_LINK(3) Linux Key Management Calls KEYCTL_LINK(3)
2
3
4
6 keyctl_link - Link a key to a keyring keyctl_unlink - Unlink a key from
7 a keyring
8
10 #include <keyutils.h>
11
12 long keyctl_link(key_serial_t key, key_serial_t keyring);
13
14 long keyctl_unlink(key_serial_t key, key_serial_t keyring);
15
17 keyctl_link() creates a link from keyring to key, displacing any link
18 to another key of the same type and description in that keyring if one
19 exists.
20
21 keyctl_unlink() removes the link from keyring to key if it exists.
22
23 The caller must have write permission on a keyring to be able create or
24 remove links in it.
25
26 The caller must have link permission on a key to be able to create a
27 link to it.
28
30 On success keyctl_link() and keyctl_unlink() return 0. On error, the
31 value -1 will be returned and errno will have been set to an appropriā
32 ate error.
33
35 ENOKEY The key or the keyring specified are invalid.
36
37 EKEYEXPIRED
38 The key or the keyring specified have expired.
39
40 EKEYREVOKED
41 The key or the keyring specified have been revoked.
42
43 EACCES The keyring exists, but is not writable by the calling process.
44
45 For keyctl_link() only:
46
47 ENOMEM Insufficient memory to expand the keyring
48
49 EDQUOT Expanding the keyring would exceed the keyring owner's quota.
50
51 EACCES The key exists, but is not linkable by the calling process.
52
54 This is a library function that can be found in libkeyutils. When
55 linking, -lkeyutils should be specified to the linker.
56
58 keyctl(1),
59 add_key(2),
60 keyctl(2),
61 request_key(2),
62 keyctl_get_keyring_ID(3),
63 keyctl_join_session_keyring(3),
64 keyctl_update(3),
65 keyctl_revoke(3),
66 keyctl_chown(3),
67 keyctl_setperm(3),
68 keyctl_describe(3),
69 keyctl_clear(3),
70 keyctl_search(3),
71 keyctl_read(3),
72 keyctl_instantiate(3),
73 keyctl_negate(3),
74 keyctl_set_reqkey_keyring(3),
75 keyctl_set_timeout(3),
76 keyctl_assume_authority(3),
77 keyctl_describe_alloc(3),
78 keyctl_read_alloc(3),
79 request-key(8)
80
81
82
83Linux 4 May 2006 KEYCTL_LINK(3)