comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/man/man3/keyctl_setperm.3 @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 68:5028fdace37b
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_SETPERM 3 "4 May 2006" Linux "Linux Key Management Calls"
11 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
12 .SH NAME
13 keyctl_setperm \- change the permissions mask on a key
14 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 .SH SYNOPSIS
16 .nf
17 .B #include <keyutils.h>
18 .sp
19 .BI "long keyctl_setperm(key_serial_t " key ", key_perm_t " perm ");"
20 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
21 .SH DESCRIPTION
22 .BR keyctl_setperm ()
23 changes the permissions mask on a key.
24 .P
25 A process that does not have the
26 .B SysAdmin
27 capability may not change the permissions mask on a key that doesn't have the
28 same UID as the caller.
29 .P
30 The caller must have
31 .B setattr
32 permission on a key to be able change its permissions mask.
33 .P
34 The permissions mask is a bitwise-OR of the following flags:
35 .TP
36 .B KEY_xxx_VIEW
37 Grant permission to view the attributes of a key.
38 .TP
39 .B KEY_xxx_READ
40 Grant permission to read the payload of a key or to list a keyring.
41 .TP
42 .B KEY_xxx_WRITE
43 Grant permission to modify the payload of a key or to add or remove links
44 to/from a keyring.
45 .TP
46 .B KEY_xxx_SEARCH
47 Grant permission to find a key or to search a keyring.
48 .TP
49 .B KEY_xxx_LINK
50 Grant permission to make links to a key.
51 .TP
52 .B KEY_xxx_SETATTR
53 Grant permission to change the ownership and permissions attributes of a key.
54 .TP
55 .B KEY_xxx_ALL
56 Grant all the above.
57 .P
58 The
59 .RB ' xxx '
60 in the above should be replaced by one of:
61 .TP
62 .B POS
63 Grant the permission to a process that possesses the key (has it attached
64 searchably to one of the process's keyrings).
65 .TP
66 .B USR
67 Grant the permission to a process with the same UID as the key.
68 .TP
69 .B GRP
70 Grant the permission to a process with the same GID as the key, or with a
71 match for the key's GID amongst that process's Groups list.
72 .TP
73 .B OTH
74 Grant the permission to any other process.
75 .P
76 Examples include:
77 .BR KEY_POS_VIEW ", " KEY_USR_READ ", " KEY_GRP_SEARCH " and " KEY_OTH_ALL .
78 .P
79 User, group and other grants are exclusive: if a process qualifies in
80 the 'user' category, it will not qualify in the 'groups' category; and if a
81 process qualifies in either 'user' or 'groups' then it will not qualify in
82 the 'other' category.
83 .P
84 Possessor grants are cumulative with the grants from the 'user', 'groups'
85 and 'other' categories.
86 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
87 .SH RETURN VALUE
88 On success
89 .BR keyctl_setperm ()
90 returns
91 .B 0 .
92 On error, the value
93 .B -1
94 will be returned and
95 .I errno
96 will have been set to an appropriate error.
97 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
98 .SH ERRORS
99 .TP
100 .B ENOKEY
101 The specified key does not exist.
102 .TP
103 .B EKEYEXPIRED
104 The specified key has expired.
105 .TP
106 .B EKEYREVOKED
107 The specified key has been revoked.
108 .TP
109 .B EACCES
110 The named key exists, but does not grant
111 .B setattr
112 permission to the calling process.
113 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
114 .SH LINKING
115 This is a library function that can be found in
116 .IR libkeyutils .
117 When linking,
118 .B \-lkeyutils
119 should be specified to the linker.
120 .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
121 .SH SEE ALSO
122 .ad l
123 .nh
124 .BR keyctl (1),
125 .BR add_key (2),
126 .BR keyctl (2),
127 .BR request_key (2),
128 .BR keyctl (3),
129 .BR keyrings (7),
130 .BR keyutils (7)