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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
While -r option implies -t, it should not literally have the effect
of -t option, e.g. -rr should not increment tflag twice.
* strace.c (init): In the getopt loop, do not increment tflag for each
occurrence of -r option. After the getopt loop, if rflag is set, set
tflag to 1. Issue a warning that -tt has no effect with -r.
* print_timeval.c (print_timeval_item): New function.
(print_timeval_pair): Use it as a print_function in print_array call.
* tests/futimesat.c (main): Update to test new behaviour.
* tests/utimes.c (main): Likewise.
* defs.h [ALPHA] (timeval32_t): New type.
[ALPHA] (print_timeval32_t): New prototype.
* print_timeval.c [ALPHA] (timeval32_t): Remove.
[ALPHA] (print_timeval32_t): Remove static keyword.
* printrusage.c [ALPHA] (printrusage32): Use timeval32_t instead
of local definition of struct timeval32. Use print_timeval32_t.
After commit v4.14-136-g151d1d1 that removed the last object common
for timespec and timeval parsers there is no need to keep them all
in a single file.
* print_timespec.c: New file.
* print_timeval.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* print_time.c: Move all timespec related code to print_timespec.c.
Move all timeval related code to print_timeval.c.
Do not assume that some syscalls do not generate syscall-exit-stops.
When syscalls fail for any reason they may generate syscall-exit-stops.
The solution is to wait for an actual exit reported by PTRACE_EVENT_EXIT
and print the end of unfinished exiting syscall properly.
* exit.c: Remove.
* Makefile.am (strace_SOURCES): Remove exit.c.
* linux/dummy.h (sys_exit): Alias to printargs_d.
* strace.c (ptrace_setoptions): Add PTRACE_O_TRACEEXIT bit.
(print_event_exit): New function.
(trace): Use it in case of PTRACE_EVENT_EXIT.
* syscall.c (trace_syscall_entering): Remove special handling
of SEN_exit.
As printargs is invoked as a generic syscall decoder only and
it is not supposed to print anything on exiting, change printargs
to return RVAL_DECODED so it would not be called on exiting at all.
* util.c (printargs): Print args unconditionally, return RVAL_DECODED.
There is little use in injections of faults into syscalls made by strace.
* syscall.c (trace_syscall_entering): Clear QUAL_FAULT bit from
tcp->qual_flg when tcp->flags has TCB_HIDE_LOG bit set.
A simultaneous use of -p option and tracing of a command available
since commit v4.11-183-gfa8c286 introduces a race condition because
the flags whether the first exec has happened are global.
Fix the race by moving hide_log_until_execve and hide_log_until_execve
global variables to TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
in struct tcb.flags, correspondingly.
* defs.h (TCB_HIDE_LOG, TCB_SKIP_DETACH_ON_FIRST_EXEC, hide_log):
New macros.
(hide_log_until_execve): Remove prototype.
* strace.c (skip_one_b_execve, hide_log_until_execve): Remove.
(startup_child): Set TCB_HIDE_LOG and TCB_SKIP_DETACH_ON_FIRST_EXEC bits
in the allocated tcb structure.
(init): Remove initialization of hide_log_until_execve and
skip_one_b_execve.
(print_stopped): Use hide_log() instead of hide_log_until_execve.
(trace): Check and clear TCB_SKIP_DETACH_ON_FIRST_EXEC flag instead
of skip_one_b_execve.
* syscall.c (trace_syscall_entering): Clear TCB_HIDE_LOG flag instead of
hide_log_until_execve.
(trace_syscall_entering, trace_syscall_exiting): Check hide_log()
instead of hide_log_until_execve.
Make expressions like fault=SYSCALL1,SYSCALL2:error=EPERM work
as documented, i.e. fail both SYSCALL1 and SYSCALL2 with EPERM.
* syscall.c (parse_fault_expression): Remove const qualifier from
"name" and "token: variables, as well as from the return value.
(qual_fault): Remove const qualifier from "name" variables.
Split "name" into comma delimited tokens and pass each token
to individual qual_syscall_ex call.
(qualify): For QUAL_FAULT options, pass the whole option value
to their qualify methods without prior splitting into comma
delimited tokens.
* tests/fault_injection.test: Check it.
* tests/fault_syntax.test: Check empty syscall sets.
* maint/ioctls_sym.sh: Skip asm/core_*.h. Filter out from
asm-generic/ioctls.h those macros that are defined using unavailable
struct termios2 on alpha and powerpc.
* maint/ioctls_sym.sh: Remove pre-include linux/kvm.h workarounds.
Skip linux/kvm.h on those architectures that have no asm/kvm.h file.
Introduce post-process workarounds, add post-process workarounds
for linux/kvm.h.
Kernel code does this when compares it with -1 (apart from comparing it with
PR_SET_PTRACER_ANY, which is also -1) in security/yama/yama_lsm.c.
* prctl.c (SYS_FUNC(prctl)) <PR_SET_PTRACER>: Cast arg2 to int before
comparing it with -1.
The prctl syscall does not use compat on x32/n32, so argument types
are in fact kernel_ulong_t.
* prctl.c (print_prctl_args): Use getarg_ull, print as "%#llx" instead
of "%#lx".
(SYS_FUNC(prctl)): Use getarg_ull to store call arguments in arg2, arg3,
arg4, arg5 variables of type unsigned long long. Use them in printing
routines.
(SYS_FUNC(arch_prctl)): Use getarg_ull to store call argument in addr
variable of type unsigned long long. Print it as "%#llx" instead of
"%#lx".
This is done in order to fix build error on old distributions where
struct blkpg_ioctl_arg declaration is broken:
In file included from block.c:35:
/usr/include/linux/blkpg.h:36: error: expected ':', ',', ';', '}' or '__attribute__' before '*' token
block.c: In function 'print_blkpg_req':
block.c:113: error: 'struct_blkpg_ioctl_arg' has no member named 'data'
(from SLE10)
* block.c: Include <linux/ioctl.h> instead of <linux/blkpg.h>.
(BLKPG, BLKPG_DEVNAMELTH, BLKPG_VOLNAMELTH): New macros.
(struct_blkpg_ioctl_arg, struct_blkpg_partition): New definitions,
copied from blkpg_ioctl_arg and blkpg_partition structures defined
in <linux/blkpg.h>.
Since UAPI header declares them under CONFIG_CHECKPOINT_RESTORE
and they would never be defined in user space.
* xlat/archvals.in: Add numeric values to ARCH_MAP_VDSO_* constants.
There are no users of prctl function in prctl.c, and all the rest
is provided by <linux/prctl.h> anyway.
* prctl.c: Include <linux/prctl.h> instead of <sys/prctl.h>.
* prctl.c (SYS_FUNC(prctl)): Use printstr_ex with QUOTE_0_TERMINATED
instead of printstr to print the argument of PR_SET_NAME and PR_GET_NAME
operations.
* util.c (printstr_ex): Simplify handling of size == 0 case.
Do not artificially decrement size when QUOTE_0_TERMINATED bit is set.
Ensure that str[size] byte is non-zero if it hasn't been fetched.
When user_style has QUOTE_0_TERMINATED bit set, printstr_ex prints
the fetched string as a NUL-terminated.
After this change, the string is being fetched as a NUL-terminated, too.
* util.c (printstr_ex): Use umovestr instead of umoven
if QUOTE_0_TERMINATED bit is set.
* xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_TOUCH introduced
by linux kernel commit v4.9-rc4~7^2~422.
* xlat/v4l2_input_types.in: Add V4L2_CAP_TOUCH introduced
by linux kernel commit v4.9-rc4~7^2~422.
Fix the following build error on SLE 11 SP4:
btrfs.c: In function 'btrfs_test_dev_replace_ioctl':
btrfs.c:1570: error: unknown field 'start' specified in initializer
* tests/btrfs.c (btrfs_test_dev_replace_ioctl): Move initialization
of struct btrfs_ioctl_dev_replace_args.start.srcdevid out of the
designated initializer.
Do not assume that the string returned by signame starts with "SIG"
prefix, this is not always the case.
* syscall.c (qual_signal): Skip signame return value
when it does not have "SIG" prefix.