IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
* bpf_sock_filter.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/skf_ad.in: New file.
* defs.h (decode_sock_fprog, print_sock_fprog): New prototypes.
* fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer.
* net.c (print_getsockopt): Use decode_sock_fprog to print
socket filter programs for SO_GET_FILTER socket option.
(print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size
to print socket filter programs for SO_ATTACH_FILTER
and SO_ATTACH_REUSEPORT_CBPF socket options.
* NEWS: Mention this.
* net.c (print_linger): Rename to print_set_linger.
(print_setsockopt): Replace print_linger with print_set_linger.
(print_get_linger): New function that accepts arbitrary option length
to match the kernel behaviour.
(print_getsockopt): Replace print_linger with print_get_linger.
* NEWS: Mention this.
As the last argument of getsockopt syscall has read-write semantics,
print both user and kernel values when they differ.
* net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save
the length specified to the kernel. On error, print the length saved
on entering. When the saved length and the length returned by the
kernel differ, print both values.
* NEWS: Mention this.
* tests/net-icmp_filter.c (main): Update expected output.
Add support for printing control messages containing software and/or
hardware timestamps, which are typically enabled by NTP and PTP
implementations.
* print_timeval.c (print_struct_timeval_data_size): New mpers printer.
* print_timespec.c (print_struct_timespec_data_size,
print_struct_timespec_array_data_size): Likewise.
* msghdr.c (print_scm_timestamp, print_scm_timestampns,
print_scm_timestamping): New functions.
(cmsg_socket_printers): Add them.
* NEWS: Mention this change.
* tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h".
(test_scm_timestamp, test_scm_timestampns, test_scm_timestamping):
New functions.
(test_sol_socket): Use them.
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
This fixes generation of syscallent.i and subsequent scno.h files
on mips where syscallent.h checks macros defined in config.h.
* scno.am (syscallent.i): Add $(top_builddir)/config.h
to prerequisites, include it.
* NEWS: Mention this fix.
Reported-by: David Robins <dbrobins@i4031.net>
On alpha, struct old_sigaction.sa_flags has a 32-bit type.
On mips, only first word of old_sigaction.sa_mask is read.
On all architectures except alpha and mips that have old sigaction
syscall, struct old_sigaction has sa_restorer field that has to be
decoded.
* signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type
to unsigned int, add ATTRIBUTE_PACKED.
[MIPS]: Dhrink sa_mask array to 1 element.
[!ALPHA && !MIPS]: Define sa_restorer field unconditionally.
(struct old_sigaction32): Likewise.
(decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field
from old_sigaction32.sa_restorer unconditionally.
[!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag
is set.
* NEWS: Mention this change.
When traced command is terminated by a blocked signal, unblock
that signal to ensure strace termination with the same signal.
* strace.c (main): Unblock the signal raised for strace termination.
* NEWS: Mention this change.
While strace resets SIGCHLD handler to the default action so that
waitpid definitely works without losing track of children, tracees
should not inherit this change.
* strace.c (struct exec_params): Add child_sa field.
(init): When setting SIGCHLD handler to SIG_DFL, save the old handler.
(exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL
at startup.
* NEWS: Mention this change.
In interactive mode (-I2), those signals that were blocked at startup
will remain blocked for the whole period of strace execution.
* strace.c (empty_set): Rename to start_set. All users changed.
(init): Initialize start_set and blocked_set to the set of currently
blocked signals.
(startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK.
* NEWS: Mention this change.
Old ssetmask syscall takes an argument and returns a value of type int.
Old sgetmask syscall may return an error.
* signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument
and return value to unsigned int, print it using sprint_old_sigmask_val.
(SYS_FUNC(sgetmask)): Do not print the mask in case of syserror.
* tests/sxetmask.c: New file.
* tests/gen_tests.in (sxetmask): New entry.
* tests/pure_executables.list: Add sxetmask.
* tests/.gitignore: Likewise.
* NEWS: Mention this fix.
On some architectures old sigsuspend syscall takes the signal mask from
the 3rd argument, on some from the 1st. And, if it wasn't peculiar
enough, the signal mask is passed by value on all architectures except
mips where it's passed by reference.
* signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last
argument.
* linux/alpha/syscallent.h (sigsuspend): Set nargs to 1.
* linux/crisv10/syscallent.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* tests/sigsuspend.c: New file.
* tests/gen_tests.in (sigsuspend): New entry.
* tests/pure_executables.list: Add sigsuspend.
* tests/.gitignore: Likewise.
* NEWS: Mention this fix.
Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec
that handle nanoseconds and microseconds, respectively.
Always print raw values of time data fields, format string
representations of time as comments.
* defs.h (sprinttime): Change argument type from time_t to long long.
(sprinttime_nsec, sprinttime_usec): New prototypes.
* util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New
functions.
(sprinttime): Turn into a thin wrapper around sprinttime_ex.
* stat.h (struct strace_stat): Add has_nsec field.
* fetch_struct_stat.c (HAVE_NSEC): New macro.
(fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC.
* fetch_struct_stat64.c (HAVE_NSEC): New macro.
(fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC.
* print_struct_stat.c (print_struct_stat) <PRINT_ST_TIME>:
Print raw values of time fields, use sprinttime_nsec to format a string
representation of time, use tprints_comment to print it as a comment.
* statx.c (SYS_FUNC(statx)) <PRINT_FIELD_TIME>: Likewise.
* utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime
and struct utimbuf.modtime fields, use sprinttime to format a string
representation of time, use tprints_comment to print it as a comment.
* tests/tests.h (print_time_t_nsec): Add int argument.
* tests/print_time.c (print_time_t_ex): New function.
(print_time_t_nsec): Add int argument, turn into a thin wrapper around
print_time_t_ex.
* tests/utime.c (main): Update expected output.
* tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro.
[!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update
expected output.
* NEWS: Mention this timestamps representation improvement.
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
* qualify.c: Include <regex.h>.
(qualify_syscall_regex): New function.
(qualify_syscall): Use it.
* strace.1: Document -e trace=/regex option.
* NEWS: Mention -e trace=/regex option.
* tests/regex.test: New test.
* tests/Makefile.am (DECODER_TESTS): Add it.
* tests/options-syntax.test: Add checks for invaild regexp
and for regexp that doesn't match a syscall.
* v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h".
(struct_v4l2_clip): New typedef. Mpersify it.
(print_v4l2_clip): New function.
(print_v4l2_format_fmt): Use it. Add struct tcb argument. Implement
decoding of the remaining V4L2_BUF_TYPE_* types.
* xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED
introduced by linux kernel commit v2.5.46~39^2~23^2~4.
Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START,
V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by
linux kernel commit v3.17-rc1~112^2~217.
* xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS,
V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and
V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64.
* configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and
V4L2_BUF_TYPE_SDR_OUTPUT.
(AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and
struct v4l2_sdr_format.buffersize.
* NEWS: Mention this change.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
This saves up to 25% of ptrace syscalls in case of trace filtering.
* syscall.c (trace_syscall_exiting): Do not call gettimeofday
and get_regs for filtered syscalls.
* NEWS: Mention this change.
* tests/get_regs.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.
(as suggested in
https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html )
In order to move them to a different namespace than syscall names. This is
already a problem in case of ipc class which shadows ipc syscall.
Old behaviour is retained in order to preserve backwards compatibility.
* qualify.c (lookup_class) <syscall_class>: Add %-prefixed class definitions.
* strace.1 (.SS Filtering): Add information regarding %-prefixed class
syntax, declare legacy class syntax deprecated.
* tests/net.test: Update to use %-prefixed syscall class name.
* tests/netlink_protocol.test: Likewise.
* tests/qual_fault-exit_group.test: Likewise.
* tests/qual_syscall.test: Likewise.
* tests/scm_rights-fd.test: Likewise.
* tests/sigreturn.test: Likewise.
* tests/uio.test: Likewise.
* NEWS: Mention this change.
x32 is the only linux architecture where preadv2 and pwritev2 syscalls
take 5 arguments instead of 6.
* io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro.
(SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it.
* linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5.
* NEWS: Mention this fix.
* tests/preadv2-pwritev2.c (main): Fix invocation of preadv2
and pwritev2 syscalls on x32.
Implement read/write semantics of struct sched_attr.size argument
of sched_setattr syscall. Do not print members of struct sched_attr
besides sched_attr.size when the specified structure size is less than
the minimal size allowed by the kernel.
* sched.c (print_sched_attr): Fetch struct sched_attr.size and use it
as the structure size. Print struct sched_attr.size only when the
structure size is less than SCHED_ATTR_MIN_SIZE.
(SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size
argument. Print struct sched_attr.size returned by the kernel
on exiting syscall in case of E2BIG. Print the last syscall argument
on exiting syscall.
(SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size
argument.
* NEWS: Mention it.
* tests/sched_xetattr.c (main): Check it.
Introduce -e inject= as a general injection option,
limit -e fault= option to syscall fault injection.
Change default return code of syscall fault injection to ENOSYS.
* qualify.c (parse_inject_token): Add fault_tokens_only argument,
do not accept retval= and signal= tokens when fault_tokens_only
is set to true.
(parse_inject_expression): Add fault_tokens_only argument,
forward it to parse_inject_token.
(qualify_inject_common): New function.
(qualify_fault): Use it.
(qualify_inject): New function.
(qual_options): New entry.
* strace.1: Describe -e inject= option.
* NEWS: Mention -e inject= option.
* tests/qual_fault-syntax.test: Test that -e fault= option does not
support retval=, signal=, and multiple error= tokens.
* tests/qual_fault.c (DEFAULT_ERRNO): Set to ENOSYS unconditionally.
* tests/qual_inject-retval.test: Replace -e fault= option
with -e inject= option.
* tests/qual_inject-syntax.test: New test.
* tests/Makefile.am (MISC_TESTS): Add it.