* according to STR specification.
*/
void
-qualify_syscall_tokens(const char *const str, struct number_set *const set,
- const char *const name)
+qualify_syscall_tokens(const char *const str, struct number_set *const set)
{
/* Clear all sets. */
clear_number_set_array(set, SUPPORTED_PERSONALITIES);
token = strtok_r(NULL, ",", &saveptr)) {
done = qualify_syscall(token, set);
if (!done)
- error_msg_and_die("invalid %s '%s'", name, token);
+ error_msg_and_die("invalid system call '%s'", token);
}
free(copy);
if (!done)
- error_msg_and_die("invalid %s '%s'", name, str);
+ error_msg_and_die("invalid system call '%s'", str);
}
/*
void qualify_tokens(const char *str, struct number_set *set,
string_to_uint_func func, const char *name);
-void qualify_syscall_tokens(const char *str, struct number_set *set,
- const char *name);
+void qualify_syscall_tokens(const char *str, struct number_set *set);
#endif /* !STRACE_FILTER_H */
{
if (!trace_set)
trace_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
- qualify_syscall_tokens(str, trace_set, "system call");
+ qualify_syscall_tokens(str, trace_set);
}
static void
{
if (!abbrev_set)
abbrev_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
- qualify_syscall_tokens(str, abbrev_set, "system call");
+ qualify_syscall_tokens(str, abbrev_set);
}
static void
{
if (!verbose_set)
verbose_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
- qualify_syscall_tokens(str, verbose_set, "system call");
+ qualify_syscall_tokens(str, verbose_set);
}
static void
{
if (!raw_set)
raw_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
- qualify_syscall_tokens(str, raw_set, "system call");
+ qualify_syscall_tokens(str, raw_set);
}
static void
struct number_set *tmp_set =
alloc_number_set_array(SUPPORTED_PERSONALITIES);
- qualify_syscall_tokens(name, tmp_set, description);
+ qualify_syscall_tokens(name, tmp_set);
free(copy);
#
# Check -e fault= syntax.
#
-# Copyright (c) 2016-2017 Dmitry V. Levin <ldv@altlinux.org>
+# Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
"strace -e fault=$* failed to handle an argument error properly"
}
-for arg in '' , ,, ,,, : :: ::: \! \!, \!: \
+for arg in , ,, ,,, \! \!, \!: \
invalid_syscall_name \
invalid_syscall_name:when=3 \
-1 \!-1 \
-2:when=5 \
32767 \!32767 \
32767:when=6 \
- chdir:42 \!chdir:42 \
+ file,nonsense \
+ \!desc,nonsense \
+ chdir,nonsense \
+ \!chdir,nonsense \
+ 1,nonsense \
+ \!1,nonsense \
+ ; do
+ $STRACE -e fault="$arg" true 2> "$LOG" &&
+ fail_with "$arg"
+ LC_ALL=C grep -F "invalid system call '" < "$LOG" > /dev/null ||
+ fail_with "$arg"
+done
+
+for arg in '' : :: ::: chdir:42 \!chdir:42 \
chdir:42:when=7 \
chdir:invalid \
chdir:invalid:when=8 \
chdir:when=65536:error=30 \
chdir:when=1+65536 \
chdir:when=1+65536:error=31 \
- file,nonsense \
- \!desc,nonsense \
- chdir,nonsense \
- \!chdir,nonsense \
- 1,nonsense \
- \!1,nonsense \
chdir:retval=0 \
chdir:signal=1 \
chdir:error=1:error=2 \