File: keyctl_link.3

package info (click to toggle)
keyutils 1.5.5-3%2Bdeb7u1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 772 kB
  • sloc: ansic: 2,842; sh: 2,674; makefile: 221
file content (108 lines) | stat: -rw-r--r-- 2,730 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\"
.\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
.\" Written by David Howells (dhowells@redhat.com)
.\"
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License
.\" as published by the Free Software Foundation; either version
.\" 2 of the License, or (at your option) any later version.
.\"
.TH KEYCTL_LINK 3 "4 May 2006" Linux "Linux Key Management Calls"
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH NAME
keyctl_link \- Link a key to a keyring
keyctl_unlink \- Unlink a key from a keyring
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH SYNOPSIS
.nf
.B #include <keyutils.h>
.sp
.BI "long keyctl_link(key_serial_t " key ", key_serial_t " keyring ");"
.sp
.BI "long keyctl_unlink(key_serial_t " key ", key_serial_t " keyring ");"
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH DESCRIPTION
.BR keyctl_link ()
creates a link from
.I keyring
to
.IR key ,
displacing any link to another key of the same type and description in that
keyring if one exists.
.P
.BR keyctl_unlink ()
removes the link from
.I keyring
to
.I key
if it exists.
.P
The caller must have
.B write
permission on a keyring to be able create or remove links in it.
.P
The caller must have
.B link
permission on a key to be able to create a link to it.
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH RETURN VALUE
On success
.BR keyctl_link ()
and
.BR keyctl_unlink ()
return
.BR 0 .
On error, the value
.B -1
will be returned and errno will have been set to an appropriate error.
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH ERRORS
.TP
.B ENOKEY
The key or the keyring specified are invalid.
.TP
.B EKEYEXPIRED
The key or the keyring specified have expired.
.TP
.B EKEYREVOKED
The key or the keyring specified have been revoked.
.TP
.B EACCES
The keyring exists, but is not
.B writable
by the calling process.
.P
For
.BR keyctl_link ()
only:
.TP
.B ENOMEM
Insufficient memory to expand the keyring
.TP
.B EDQUOT
Expanding the keyring would exceed the keyring owner's quota.
.TP
.B EACCES
The key exists, but is not
.B linkable
by the calling process.
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH LINKING
This is a library function that can be found in
.IR libkeyutils .
When linking,
.B -lkeyutils
should be specified to the linker.
.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.SH SEE ALSO
.BR keyctl (1),
.br
.BR add_key (2),
.br
.BR keyctl (2),
.br
.BR request_key (2),
.br
.BR keyctl (3),
.br
.BR request-key (8)