mirror of
https://github.com/rd235/cado
synced 2024-12-26 22:12:55 +01:00
'force' instead of 'quiet' mode and manpages fixes.
This commit is contained in:
parent
bfe686a1c5
commit
65b997bb9c
6
cado.1
6
cado.1
@ -56,9 +56,9 @@ accepts the following options:
|
||||
run in verbose mode. \fBcado\fR shows the set of allowed capabilities, requested cababilities, unavailable capabilities and
|
||||
(in case of -s) the set of capabilities assigned to \fBcado.conf\fR itself.
|
||||
.TP
|
||||
\fB\-q
|
||||
\fB\-f
|
||||
.TQ
|
||||
\fB\-\-quiet
|
||||
\fB\-\-force
|
||||
do not fail in case the user asks for unavailable capabilities, \fBcado.conf\fR in this case grants the intersection between the
|
||||
set of requested cababilities and the set of allowed capabilities
|
||||
.TP
|
||||
@ -70,7 +70,7 @@ set of requested cababilities and the set of allowed capabilities
|
||||
\fB\-S
|
||||
.TQ
|
||||
\fB\-\-scado
|
||||
launch \fBcado\fR with \fBscado\fR(1) support. \fRcommand\fI must be an absolute pathname and a specific authorization line must
|
||||
launch \fBcado\fR with \fBscado\fR(1) support. \fIcommand\fR must be an absolute pathname and a specific authorization line must
|
||||
appear in the user's scado file.
|
||||
.TP
|
||||
\fB\-h
|
||||
|
14
cado.c
14
cado.c
@ -53,10 +53,10 @@ static void printcapset(uint64_t capset, char *indent) {
|
||||
}
|
||||
|
||||
/* command line args management */
|
||||
#define OPTSTRING "hqvsS"
|
||||
#define OPTSTRING "hfvsS"
|
||||
struct option long_options[]={
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"quiet", no_argument, NULL, 'q'},
|
||||
{"force", no_argument, NULL, 'f'},
|
||||
{"verbose", no_argument, NULL, 'v'},
|
||||
{"setcap", no_argument, NULL, 'v'},
|
||||
{"scado", no_argument, NULL, 'S'}
|
||||
@ -67,7 +67,7 @@ void usage(char *progname) {
|
||||
fprintf(stderr,"usage: %s OPTIONS capability_list command [args]\n\n",progname);
|
||||
fprintf(stderr,"Options:\n");
|
||||
fprintf(stderr," -h, --help display help message and exit\n");
|
||||
fprintf(stderr," -q, --quiet do not display warnings, do what it is allowed\n");
|
||||
fprintf(stderr," -f, --force do not display warnings, do what it is allowed\n");
|
||||
fprintf(stderr," -v, --verbose generate extra output\n");
|
||||
fprintf(stderr," -S, --scado check scado pre-authorization for scripts\n");
|
||||
fprintf(stderr," -s, --setcap set the minimun caps for %s (root access)\n",progname);
|
||||
@ -82,7 +82,7 @@ int main(int argc, char*argv[])
|
||||
uint64_t reqcaps;
|
||||
uint64_t grantcap=0;
|
||||
int verbose=0;
|
||||
int quiet=0;
|
||||
int force=0;
|
||||
int setcap=0;
|
||||
int scado=0;
|
||||
int pam_check_required = 1;
|
||||
@ -97,7 +97,7 @@ int main(int argc, char*argv[])
|
||||
break;
|
||||
case 'v': verbose=1;
|
||||
break;
|
||||
case 'q': quiet=1;
|
||||
case 'f': force=1;
|
||||
break;
|
||||
case 's': setcap=1;
|
||||
break;
|
||||
@ -175,8 +175,8 @@ int main(int argc, char*argv[])
|
||||
printf("Unavailable ambient capabilities:\n");
|
||||
printcapset(reqcaps & ~okcaps, " ");
|
||||
}
|
||||
/* if not in "quiet" mode, do not complaint */
|
||||
if (!quiet) {
|
||||
/* if not in "force" mode, do not complaint */
|
||||
if (!force) {
|
||||
fprintf(stderr,"%s: Permission denied\n",progname);
|
||||
exit(2);
|
||||
}
|
||||
|
4
scado.1
4
scado.1
@ -40,7 +40,7 @@ or
|
||||
.I path_of_the_executable_file : capability_list : sha256_digest_of_the_executable
|
||||
.RE
|
||||
.br
|
||||
(See the EXAMPLES section at the end f the man page for more info. All the trailing part of a line following a # sign is a comment.).
|
||||
(See the EXAMPLES section at the end of the man page for more info. All the trailing part of a line following a # sign is a comment.).
|
||||
|
||||
The \fIpath_of_the_executable_file\fR must be absolute.
|
||||
|
||||
@ -120,7 +120,7 @@ Allow the activation of ping with cap_net_raw provided it has a specific SHA256
|
||||
.RE
|
||||
|
||||
.PP
|
||||
Compute the SAH256 digest of (the current version of) ping so,
|
||||
Compute the SHA256 digest of (the current version of) ping so,
|
||||
allow the activation of ping with cap_net_raw provided it has not been modified.
|
||||
.RS 4
|
||||
/bin/ping : cap_net_raw :
|
||||
|
Loading…
Reference in New Issue
Block a user