Add PIE compilation flags
[platform/upstream/keyutils.git] / keyctl_chown.3
1 .\"
2 .\" Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
3 .\" Written by David Howells (dhowells@redhat.com)
4 .\"
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License
7 .\" as published by the Free Software Foundation; either version
8 .\" 2 of the License, or (at your option) any later version.
9 .\"
10 .TH KEYCTL_CHOWN 3 "4 May 2006" Linux "Linux Key Management Calls"
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
12 .SH NAME
13 keyctl_chown \- Change the ownership of a key
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 .SH SYNOPSIS
16 .nf
17 .B #include <keyutils.h>
18 .sp
19 .BI "long keyctl_chown(key_serial_t " key ", uid_t " uid ", gid_t " gid ");"
20 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
21 .SH DESCRIPTION
22 .BR keyctl_chown ()
23 changes the user and group ownership details of a key.
24 .P
25 A setting of
26 .B -1
27 on either
28 .I uid
29 or
30 .I gid
31 will cause that setting to be ignored.
32 .P
33 A process that does not have the
34 .B SysAdmin
35 capability may not change a key's UID or set the key's GID to a value that
36 does not match the process's GID or one of its group list.
37 .P
38 The caller must have
39 .B setattr
40 permission on a key to be able change its ownership.
41 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
42 .SH RETURN VALUE
43 On success
44 .BR keyctl_chown ()
45 returns
46 .B 0 .
47 On error, the value
48 .B -1
49 will be returned and errno will have been set to an appropriate error.
50 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
51 .SH ERRORS
52 .TP
53 .B ENOKEY
54 The specified key does not exist.
55 .TP
56 .B EKEYEXPIRED
57 The specified key has expired.
58 .TP
59 .B EKEYREVOKED
60 The specified key has been revoked.
61 .TP
62 .B EDQUOT
63 Changing the UID to the one specified would run that UID out of quota.
64 .TP
65 .B EACCES
66 The key exists, but does not grant
67 .B setattr
68 permission to the calling process.
69 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
70 .SH LINKING
71 This is a library function that can be found in
72 .IR libkeyutils .
73 When linking,
74 .B -lkeyutils
75 should be specified to the linker.
76 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
77 .SH SEE ALSO
78 .BR keyctl (1),
79 .br
80 .BR add_key (2),
81 .br
82 .BR keyctl (2),
83 .br
84 .BR request_key (2),
85 .br
86 .BR keyctl (3),
87 .br
88 .BR request-key (8)