aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2008-10-24 05:28:32 -0700
committerAndrew G. Morgan <morgan@kernel.org>2008-10-24 05:28:32 -0700
commit248361e809d6f2e64fb63d792ad1b3cb6d4d9bf6 (patch)
treec30429b49a0bd6bc705de3eefa0584816cde9f6d
parent21d9c180fdf5c97e823b608090da3f465233a9d4 (diff)
downloadlibcap-248361e809d6f2e64fb63d792ad1b3cb6d4d9bf6.tar.gz
Documentation for setcap reconciled with application.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--doc/setcap.828
-rw-r--r--progs/setcap.c2
2 files changed, 25 insertions, 5 deletions
diff --git a/doc/setcap.8 b/doc/setcap.8
index 885b8f4..f78a42e 100644
--- a/doc/setcap.8
+++ b/doc/setcap.8
@@ -1,28 +1,48 @@
.\"
.\" $Id: setcap.8,v 1.1.1.1 1999/04/17 22:16:31 morgan Exp $
.\"
-.TH SETCAP 8 "26th April 1997"
+.TH SETCAP 8 "24th October 2008"
.SH NAME
setcap \- set file capabilities
.SH SYNOPSIS
-\fBsetcap\fP (\fIcapabilities|-|-r) filename\fP [ ... \fIcapabilitiesN\fP \fIfileN\fP ]
+\fBsetcap\fP [-q] [-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
+.B -v
+option is used to verify that the specified capabilities are currently
+associated with the file.
+.PP
+The
.I capabilities
are specified in the form described in
.IR cap_from_text (3).
.PP
-The special filename, '\-',
+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 option, '-r', can be used to remove a capability set from a file.
+The special capability string,
+.BR '-r' ,
+is used to remove a capability set from a file.
+.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 "SEE ALSO"
.IR cap_from_text (3),
.IR cap_set_file (3),
diff --git a/progs/setcap.c b/progs/setcap.c
index 168b4aa..0215fc4 100644
--- a/progs/setcap.c
+++ b/progs/setcap.c
@@ -181,5 +181,5 @@ int main(int argc, char **argv)
}
}
- return 0;
+ exit(0);
}