1KEYCTL_LINK(3)            Linux Key Management Calls            KEYCTL_LINK(3)
2
3
4

NAME

6       keyctl_link - Link a key to a keyring keyctl_unlink - Unlink a key from
7       a keyring
8

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

LINKING

54       This is a library function that can  be  found  in  libkeyutils.   When
55       linking, -lkeyutils should be specified to the linker.
56

SEE ALSO

58       keyctl(1),
59       add_key(2),
60       keyctl(2),
61       request_key(2),
62       keyctl(3),
63       request-key(8)
64
65
66
67Linux                             4 May 2006                    KEYCTL_LINK(3)
Impressum