1KEYCTL_LINK(3) Linux Key Management Calls KEYCTL_LINK(3)
2
3
4
6 keyctl_link, keyctl_unlink - link/unlink a key to/from a keyring
7
9 #include <keyutils.h>
10
11 long keyctl_link(key_serial_t key, key_serial_t keyring);
12
13 long keyctl_unlink(key_serial_t key, key_serial_t keyring);
14
16 keyctl_link() creates a link from keyring to key, displacing any link
17 to another key of the same type and description in that keyring if one
18 exists.
19
20 keyctl_unlink() removes the link from keyring to key if it exists.
21
22 The caller must have write permission on a keyring to be able create or
23 remove links in it.
24
25 The caller must have link permission on a key to be able to create a
26 link to it.
27
29 On success keyctl_link() and keyctl_unlink() return 0. On error, the
30 value -1 will be returned and errno will have been set to an appropriā
31 ate error.
32
34 ENOKEY The key or the keyring specified are invalid.
35
36 EKEYEXPIRED
37 The key or the keyring specified have expired.
38
39 EKEYREVOKED
40 The key or the keyring specified have been revoked.
41
42 EACCES The keyring exists, but is not writable by the calling process.
43
44 For keyctl_link() only:
45
46 ENOMEM Insufficient memory to expand the keyring
47
48 EDQUOT Expanding the keyring would exceed the keyring owner's quota.
49
50 EACCES The key exists, but is not linkable by the calling process.
51
53 This is a library function that can be found in libkeyutils. When
54 linking, -lkeyutils should be specified to the linker.
55
57 keyctl(1), add_key(2), keyctl(2), request_key(2), keyctl(3),
58 keyrings(7), keyutils(7)
59
60
61
62
63Linux 4 May 2006 KEYCTL_LINK(3)