blob: 582c78157da658026d25050ec9b41927e5a8ea53 (
plain)
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
|
.TH SETCAP 8 "2020-01-07"
.SH NAME
setcap \- set file capabilities
.SH SYNOPSIS
\fBsetcap\fP [\-q] [\-n <rootid>] [\-v] {\fIcapabilities|\-|\-r} filename\fP [ ... \fIcapabilitiesN\fP \fIfileN\fP ]
.SH DESCRIPTION
In the absence of the
.B \-v
(verify) option
.B setcap
sets the capabilities of each specified
.I filename
to the
.I capabilities
specified. The optional
.B \-n <rootid>
argument can be used to set the file capability for use only in a
user namespace with this rootid owner. The
.B \-v
option is used to verify that the specified capabilities are currently
associated with the file. If \-v and \-n are supplied, the
.B \-n <rootid>
argument is also verified.
.PP
The
.I capabilities
are specified in the form described in
.BR cap_from_text (3).
.PP
The special capability string,
.BR '\-' ,
can be used to indicate that capabilities are read from the standard
input. In such cases, the capability set is terminated with a blank
line.
.PP
The special capability string,
.BR '\-r' ,
is used to remove a capability set from a file. Note, setting an empty
capability set is
.B not the same
as removing it. An empty set can be used to guarantee a file is not
executed with privilege in spite of the fact that the prevailing
ambient+inheritable sets would otherwise bestow capabilities on
executed binaries.
.PP
The
.B \-q
flag is used to make the program less verbose in its output.
.SH "EXIT CODE"
The
.B setcap
program will exit with a 0 exit code if successful. On failure, the
exit code is 1.
.SH "REPORTING BUGS"
Please report bugs via:
.TP
https://bugzilla.kernel.org/buglist.cgi?component=libcap&list_id=1047723&product=Tools&resolution=---
.SH "SEE ALSO"
.BR cap_from_text (3),
.BR cap_get_file (3),
.BR capabilities (7),
.BR user_namespaces (7),
.BR getcap (8)
|