mirror of
https://github.com/rd235/cado
synced 2024-12-28 06:50:17 +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
|
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.
|
(in case of -s) the set of capabilities assigned to \fBcado.conf\fR itself.
|
||||||
.TP
|
.TP
|
||||||
\fB\-q
|
\fB\-f
|
||||||
.TQ
|
.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
|
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
|
set of requested cababilities and the set of allowed capabilities
|
||||||
.TP
|
.TP
|
||||||
@ -70,7 +70,7 @@ set of requested cababilities and the set of allowed capabilities
|
|||||||
\fB\-S
|
\fB\-S
|
||||||
.TQ
|
.TQ
|
||||||
\fB\-\-scado
|
\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.
|
appear in the user's scado file.
|
||||||
.TP
|
.TP
|
||||||
\fB\-h
|
\fB\-h
|
||||||
|
14
cado.c
14
cado.c
@ -53,10 +53,10 @@ static void printcapset(uint64_t capset, char *indent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* command line args management */
|
/* command line args management */
|
||||||
#define OPTSTRING "hqvsS"
|
#define OPTSTRING "hfvsS"
|
||||||
struct option long_options[]={
|
struct option long_options[]={
|
||||||
{"help", no_argument, NULL, 'h'},
|
{"help", no_argument, NULL, 'h'},
|
||||||
{"quiet", no_argument, NULL, 'q'},
|
{"force", no_argument, NULL, 'f'},
|
||||||
{"verbose", no_argument, NULL, 'v'},
|
{"verbose", no_argument, NULL, 'v'},
|
||||||
{"setcap", no_argument, NULL, 'v'},
|
{"setcap", no_argument, NULL, 'v'},
|
||||||
{"scado", no_argument, NULL, 'S'}
|
{"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,"usage: %s OPTIONS capability_list command [args]\n\n",progname);
|
||||||
fprintf(stderr,"Options:\n");
|
fprintf(stderr,"Options:\n");
|
||||||
fprintf(stderr," -h, --help display help message and exit\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," -v, --verbose generate extra output\n");
|
||||||
fprintf(stderr," -S, --scado check scado pre-authorization for scripts\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);
|
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 reqcaps;
|
||||||
uint64_t grantcap=0;
|
uint64_t grantcap=0;
|
||||||
int verbose=0;
|
int verbose=0;
|
||||||
int quiet=0;
|
int force=0;
|
||||||
int setcap=0;
|
int setcap=0;
|
||||||
int scado=0;
|
int scado=0;
|
||||||
int pam_check_required = 1;
|
int pam_check_required = 1;
|
||||||
@ -97,7 +97,7 @@ int main(int argc, char*argv[])
|
|||||||
break;
|
break;
|
||||||
case 'v': verbose=1;
|
case 'v': verbose=1;
|
||||||
break;
|
break;
|
||||||
case 'q': quiet=1;
|
case 'f': force=1;
|
||||||
break;
|
break;
|
||||||
case 's': setcap=1;
|
case 's': setcap=1;
|
||||||
break;
|
break;
|
||||||
@ -175,8 +175,8 @@ int main(int argc, char*argv[])
|
|||||||
printf("Unavailable ambient capabilities:\n");
|
printf("Unavailable ambient capabilities:\n");
|
||||||
printcapset(reqcaps & ~okcaps, " ");
|
printcapset(reqcaps & ~okcaps, " ");
|
||||||
}
|
}
|
||||||
/* if not in "quiet" mode, do not complaint */
|
/* if not in "force" mode, do not complaint */
|
||||||
if (!quiet) {
|
if (!force) {
|
||||||
fprintf(stderr,"%s: Permission denied\n",progname);
|
fprintf(stderr,"%s: Permission denied\n",progname);
|
||||||
exit(2);
|
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
|
.I path_of_the_executable_file : capability_list : sha256_digest_of_the_executable
|
||||||
.RE
|
.RE
|
||||||
.br
|
.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.
|
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
|
.RE
|
||||||
|
|
||||||
.PP
|
.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.
|
allow the activation of ping with cap_net_raw provided it has not been modified.
|
||||||
.RS 4
|
.RS 4
|
||||||
/bin/ping : cap_net_raw :
|
/bin/ping : cap_net_raw :
|
||||||
|
Loading…
Reference in New Issue
Block a user