jpayne@68
|
1 .\"
|
jpayne@68
|
2 .\" Copyright (C) 2019 Red Hat, Inc. All Rights Reserved.
|
jpayne@68
|
3 .\" Written by David Howells (dhowells@redhat.com)
|
jpayne@68
|
4 .\"
|
jpayne@68
|
5 .\" This program is free software; you can redistribute it and/or
|
jpayne@68
|
6 .\" modify it under the terms of the GNU General Public License
|
jpayne@68
|
7 .\" as published by the Free Software Foundation; either version
|
jpayne@68
|
8 .\" 2 of the License, or (at your option) any later version.
|
jpayne@68
|
9 .\"
|
jpayne@68
|
10 .TH KEYCTL_MOVE 3 "29 May 2019" Linux "Linux Key Management Calls"
|
jpayne@68
|
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
12 .SH NAME
|
jpayne@68
|
13 keyctl_move \- Move a key between keyrings
|
jpayne@68
|
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
15 .SH SYNOPSIS
|
jpayne@68
|
16 .nf
|
jpayne@68
|
17 .B #include <keyutils.h>
|
jpayne@68
|
18 .sp
|
jpayne@68
|
19 .BI "long keyctl_move(key_serial_t " key ", key_serial_t " from_keyring ","
|
jpayne@68
|
20 .br
|
jpayne@68
|
21 .BI " key_serial_t " to_keyring ", unsigned int " flags ");"
|
jpayne@68
|
22 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
23 .SH DESCRIPTION
|
jpayne@68
|
24 .BR keyctl_move ()
|
jpayne@68
|
25 atomically unlinks
|
jpayne@68
|
26 .I key
|
jpayne@68
|
27 from
|
jpayne@68
|
28 .I from_keyring
|
jpayne@68
|
29 and links it into
|
jpayne@68
|
30 .I to_keyring
|
jpayne@68
|
31 in a single operation. Depending on the flags set, a link to any matching key
|
jpayne@68
|
32 in to_keyring may get displaced.
|
jpayne@68
|
33 .P
|
jpayne@68
|
34 .I flags
|
jpayne@68
|
35 is a bitwise-OR of zero or more of the following flags:
|
jpayne@68
|
36 .P
|
jpayne@68
|
37 .TP
|
jpayne@68
|
38 .B KEYCTL_MOVE_EXCL
|
jpayne@68
|
39 If there's a matching key in to_keyring, don't displace it but rather return
|
jpayne@68
|
40 an error.
|
jpayne@68
|
41 .P
|
jpayne@68
|
42 The caller must have
|
jpayne@68
|
43 .B write
|
jpayne@68
|
44 permission on both keyring to be able create or remove links in them.
|
jpayne@68
|
45 .P
|
jpayne@68
|
46 The caller must have
|
jpayne@68
|
47 .B link
|
jpayne@68
|
48 permission on a key to be able to create a new link to it.
|
jpayne@68
|
49 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
50 .SH RETURN VALUE
|
jpayne@68
|
51 On success
|
jpayne@68
|
52 .BR keyctl_move ()
|
jpayne@68
|
53 return
|
jpayne@68
|
54 .BR 0 .
|
jpayne@68
|
55 On error, the value
|
jpayne@68
|
56 .B -1
|
jpayne@68
|
57 will be returned and
|
jpayne@68
|
58 .I errno
|
jpayne@68
|
59 will have been set to an appropriate error.
|
jpayne@68
|
60 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
61 .SH ERRORS
|
jpayne@68
|
62 .TP
|
jpayne@68
|
63 .B ENOKEY
|
jpayne@68
|
64 The key or one of the keyrings specified are invalid.
|
jpayne@68
|
65 .TP
|
jpayne@68
|
66 .B ENOKEY
|
jpayne@68
|
67 A key with the same type and description is present in to_keyring and
|
jpayne@68
|
68 KEYCTL_MOVE_EXCL is set.
|
jpayne@68
|
69 .TP
|
jpayne@68
|
70 .B EKEYEXPIRED
|
jpayne@68
|
71 The key or one of the keyrings specified have expired.
|
jpayne@68
|
72 .TP
|
jpayne@68
|
73 .B EKEYREVOKED
|
jpayne@68
|
74 The key or one of the keyrings specified have been revoked.
|
jpayne@68
|
75 .TP
|
jpayne@68
|
76 .B EACCES
|
jpayne@68
|
77 The key exists, but is not
|
jpayne@68
|
78 .B linkable
|
jpayne@68
|
79 by the calling process.
|
jpayne@68
|
80 .TP
|
jpayne@68
|
81 .B EACCES
|
jpayne@68
|
82 The keyrings exist, but are not
|
jpayne@68
|
83 .B writable
|
jpayne@68
|
84 by the calling process.
|
jpayne@68
|
85 .TP
|
jpayne@68
|
86 .B ENOMEM
|
jpayne@68
|
87 Insufficient memory to effect the changes.
|
jpayne@68
|
88 .TP
|
jpayne@68
|
89 .B EDQUOT
|
jpayne@68
|
90 Expanding to_keyring would exceed the keyring owner's quota.
|
jpayne@68
|
91 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
92 .SH LINKING
|
jpayne@68
|
93 This is a library function that can be found in
|
jpayne@68
|
94 .IR libkeyutils .
|
jpayne@68
|
95 When linking,
|
jpayne@68
|
96 .B \-lkeyutils
|
jpayne@68
|
97 should be specified to the linker.
|
jpayne@68
|
98 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
jpayne@68
|
99 .SH SEE ALSO
|
jpayne@68
|
100 .ad l
|
jpayne@68
|
101 .nh
|
jpayne@68
|
102 .BR keyctl (1),
|
jpayne@68
|
103 .BR add_key (2),
|
jpayne@68
|
104 .BR keyctl (2),
|
jpayne@68
|
105 .BR request_key (2),
|
jpayne@68
|
106 .BR keyctl (3),
|
jpayne@68
|
107 .BR keyrings (7),
|
jpayne@68
|
108 .BR keyutils (7)
|
jpayne@68
|
109
|