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:
Дмитрий Левин 2017-08-28 23:38:43 +00:00
parent fe1ab2a53a
commit ed9faa2e27
3 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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 \