Disallow more than one signal= specification in an injection expression
Specifying several signal= specifications in an injection expressions makes no sense. * filter_qualify.c (parse_inject_token): Disallow second signal= specification. * strace.1.in: Document it. * tests/qual_inject-syntax.test: Check it.
This commit is contained in:
parent
fe1ab2a53a
commit
ed9faa2e27
@ -140,6 +140,8 @@ parse_inject_token(const char *const token, struct inject_opts *const fopts,
|
||||
fopts->data.flags |= INJECT_F_RETVAL;
|
||||
} else if (!fault_tokens_only
|
||||
&& (val = STR_STRIP_PREFIX(token, "signal=")) != token) {
|
||||
if (fopts->data.flags & INJECT_F_SIGNAL)
|
||||
return false;
|
||||
intval = sigstr_to_uint(val);
|
||||
if (intval < 1 || intval > NSIG_BYTES * 8)
|
||||
return false;
|
||||
|
@ -654,8 +654,9 @@ An injection expression can contain only one
|
||||
.BR error =
|
||||
or
|
||||
.BR retval =
|
||||
specification.
|
||||
If an injection expression contains multiple
|
||||
specification, and only one
|
||||
.BR signal =
|
||||
specification. If an injection expression contains multiple
|
||||
.BR when =
|
||||
specifications, the last one takes precedence.
|
||||
|
||||
|
@ -103,6 +103,8 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \
|
||||
chdir:retval=-1 \
|
||||
chdir:signal=0 \
|
||||
chdir:signal=129 \
|
||||
chdir:signal=1:signal=2 \
|
||||
chdir:signal=1:retval=0:signal=2 \
|
||||
chdir:retval=0:retval=1 \
|
||||
chdir:error=1:error=2 \
|
||||
chdir:retval=0:error=1 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user