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!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
* cacheflush.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* system.c: Move inclusion of <asm/cachectl.h> to cacheflush.c.
[M68K, BFIN, SH]: Move to cacheflush.c.
* capability.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* system.c: Move inclusion of headers and macro definitions related
to capget and capset decoding to capability.c.
(print_cap_header, print_cap_data, sys_capget, sys_capset): Move
to capability.c.
* sysmips.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* system.c: Fix typo in the check for <linux/utsname.h>.
Move inclusions of <linux/utsname.h> and <asm/sysmips.h> to sysmips.c.
[MIPS]: Likewise.
Since parsers for setdomainname and sethostname syscalls are identical,
replace sys_setdomainname with an alias to sys_sethostname.
* linux/dummy.h (sys_setdomainname): Alias to sys_sethostname.
* linux/syscall.h (sys_setdomainname): Remove.
* process.c (sys_setdomainname): Remove.
Since parsers for getpeername and getsockname syscalls are identical,
replace sys_getpeername with an alias to sys_getsockname.
* linux/dummy.h (sys_getpeername): Alias to sys_getsockname.
* linux/syscall.h (sys_getpeername): Remove.
* net.c (sys_getpeername): Remove.
Since parsers for stime and time syscalls are identical,
replace sys_stime with an alias to sys_time.
* linux/dummy.h (sys_stime): Alias to sys_time.
* linux/syscall.h (sys_stime): Remove.
* time.c (sys_stime): Remove.
Special parsers for mkdir and mkdirat are redundant because
sys_chmod and sys_fchmodat implement the same decoding.
* file.c (decode_mkdir, sys_mkdir, sys_mkdirat): Remove.
* linux/dummy.h (sys_mkdir): Alias to sys_chmod.
(sys_mkdirat): Alias to sys_fchmodat.
* linux/syscall.h (sys_mkdir, sys_mkdirat): Remove.
* pathtrace.c (pathtrace_match): Do not check for sys_mkdirat.
For those socket descriptors that have no associated ip:port pairs
(or when this information is not available), -yy option prints
the same <socket:[INODE]> information as -y option, e.g.
$ strace -e sendto -yy ip l > /dev/null
sendto(3<socket:[23456789]>, ...
This change makes -yy output more informative: instead of just
printing "socket", the name of protocol behind the socket descriptor
will be printed, e.g.
sendto(3<NETLINK:[23456789]>, ...
* configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h.
* tests/net-yy-accept.awk: Update to support protocol names.
* tests/net-yy-connect.awk: Likewise.
* util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>.
(getfdproto): New function.
(printfd): Use it.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
MAXPATHLEN is defined to PATH_MAX, so replace the former with the latter.
* strace.c (startup_child): Replace MAXPATHLEN with PATH_MAX.
* util.c (printpathn, printpath): Likewise.
The freeze/thaw ones are simple, but the trim is an interesting struct.
* block.c (block_ioctl): Handle FIFREEZE/FITHAW/FITRIM.
* ioctl.c (ioctl_decode): Pass 'X' ioctls to block_ioctl.
Since <sys/uio.h> is standardized by POSIX and is present in all
available versions of glibc, it's safe to assume that any usable
libc implementation provides this header file.
* configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h.
* io.c: Include <sys/uio.h> unconditionally.
(tprint_iov_upto, tprint_iov, sys_readv, sys_writev,
print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define
unconditionally.
* net.c: Include <sys/uio.h> unconditionally.
* util.c: Include <sys/uio.h> unconditionally.
(dumpiov): Define unconditionally.
There are two important changes in here:
1. EWOULDBLOCK has been up to kernel 3.14 errorcode #246. Since hppa
folks had problems with EWOULDBLOCK != EAGAIN, this was changed in
kernel 3.14.
2. Starting with kernel 3.18, hppa folks changed some signal numbers in
such a way that we end up with SIGRTMIN == 32, which brings hppa in sync
with other linux ports.
Both were incompatible changes which basically broke hppa ABI, but since
they have been merged into the kernel, we have to follow.
The output format of the stack trace is supposed to be different
depending on whether symbol names are available in the build.
However, the check only verified the validity of the pointer, not of the
string pointed to (which could be empty).
This commit fixes the check so that the original output:
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
> /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
> /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
> /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
> /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
> /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
> /bin/busybox(+0x0) [0x62c60]
> /bin/busybox(+0x0) [0x4940]
> /bin/busybox(+0x0) [0x499c]
> /bin/busybox(+0x0) [0x4e08]
> /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
> /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]
becomes:
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x5e000
> /lib/libc-2.10.1.so(_IO_file_doallocate+0x8c) [0x68a38]
> /lib/libc-2.10.1.so(_IO_doallocbuf+0x6c) [0x78574]
> /lib/libc-2.10.1.so(_IO_file_overflow+0x184) [0x7763c]
> /lib/libc-2.10.1.so(_IO_file_xsputn+0x88) [0x76aac]
> /lib/libc-2.10.1.so(_IO_puts+0xc8) [0x6b64c]
> /bin/busybox() [0x62c60]
> /bin/busybox() [0x4940]
> /bin/busybox() [0x499c]
> /bin/busybox() [0x4e08]
> /lib/libc-2.10.1.so(__libc_init_first+0x30c) [0x1f84c]
> /lib/libc-2.10.1.so(__libc_start_main+0xd8) [0x1f9f8]
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Masatake YAMATO <yamato@redhat.com>
This patch is similar to what I did in commit
02f9f6b386741a52f58e1b31ad4e7fff60781ef8.
That commit was for sendmsg and recvmsg system calls.
This one is for sendmmsg and recvmmsg system calls.
* defs.h (dumpiov_in_mmsghdr): New declaration.
* net.c (extractmmsghdr): New function derived from printmmsghdr.
(printmmsghdr): Use it.
(dumpiov_in_mmsghdr): New function.
* syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_mmsghdr
for recvmmsg and sendmmsg syscalls.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
mmsghrd structure type is defined locally in printmmsghdr function.
However, more functions will refer the definition in modifications for
supporting "-e write=set" and "-e read=set" option for sendmmsg and
recvmmsg system calls.
After this change, the system definition of struct mmsghdr will be used
if configure reports it is available, falling back to the old local
definition.
* configure.ac (AC_CHECK_TYPES): Add struct mmsghdr.
* net.c [!HAVE_STRUCT_MMSGHDR] (struct mmsghdr): Define.
(printmmsghdr): Use previously defined struct mmsghdr.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This patch is an initial step for supporting "-e write=set" and
"-e read=set" option for sendmmsg and recvmmsg system calls.
Coverting a data of msghdr32 to msghdr is needed both for
{send,recv}msg and {send,recv}mmsg to decode parameters.
To share the copying code in both decoders, a separate
function named copy_from_msghdr32 is introduced.
* net.c [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]
(copy_from_msghdr32): New function.
(extractmsghdr) [SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4]: Use it.
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
While most of ioctl-related kernel headers are now exported by kernel's
headers_install, some are still modules_install only. The kernel's
headers installed into /usr/include/ are usually headers_install'ed and
therefore don't contain some internal headers we need. The solution is
to look for modules_install'ed headers for the running kernel, and fall
back to old behavior if they aren't found.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Introduce v4l2.c, a decoder for the arguments of the video-input subset
of the v4l2 ioctl's. This is a combination of
- previous work by Peter Zotov <whitequark@whitequark.org>, found at
https://gist.githubusercontent.com/whitequark/1263207/raw/strace-4.6-v4l2-ioctls.patch
- previous work by William Manley <will@williammanley.net>, found at
http://marc.info/?l=strace&m=139395588520675
- forward port, additions and fixes by Philippe De Muyter <phdm@macqel.be>
As v4l2 is a moving target, I have made v4l2.c compilable with ancient
linux kernels by testing the availability of some macros. It has been
succesfully compiled on linux 3.10, 3.1, 2.6.31 and 2.6.22, and
succesfully used on linux 3.10 with a camera device.
* configure.ac: Check for availabilty of V4L2_* enum constants.
* Makefile.am (strace_SOURCES): Add v4l2.c.
* defs.h (v4l2_ioctl): New prototype.
* ioctl.c (ioctl_decode): Use v4l2_ioctl.
* v4l2.c: New file.
* xlat/v4l2_*.in: New files.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Cc: Peter Zotov <whitequark@whitequark.org>
Cc: William Manley <will@williammanley.net>
For two ioctl entries with the same code, if one's name is a prefix
to another's name, keep the entry with a shorter name. Filter out
redundant ioctl entries at ioctlsort stage so that distributed
ioctlent.h.in files will be already filtered.
* linux/ioctlsort.c (is_not_prefix): New function.
(main): Use it.
* linux/ioctlent-filter.awk: Remove.
* Makefile.am (EXTRA_DIST): Remove linux/ioctlent-filter.awk.
($(ioctlent_h)): Don't use linux/ioctlent-filter.awk.
This fixes compilation with musl libc.
This approach was already used in process.c, so I assume it is safe.
* signal.c: Move [HAVE_LINUX_PTRACE_H] code out of [HAVE_SYS_REG_H] check.
* syscall.c: Likewise.
* util.c: Likewise.
Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
The decoding of SIOCSIFNAME is incorrect. It does not use
the ifr_index field to look things up, but ifr_newname.
* sock.c (sock_ioctl): Split out SIOCSIFNAME from SIOCGIFNAME and
display ifr_newname.
The ifr name fields of the ifreq structure might not be NUL terminated.
If the user makes an ioctl call where they aren't, then strace ends up
reading random content from its own stack. Limit the printf lengths.
* sock.c (sock_ioctl): Add explicit length limits to ifr_name printfs.
On Android, 32-bit arm and x86 use __kernel_mode_t (an unsigned short)
as their mode_t. The open(2) flags are actually an int, so high ones
like O_CLOEXEC get truncated if you coerce them to mode_t.
* defs.h (tprint_open_modes, sprint_open_modes): Change argument type
from mode_t to int.
* file.c (tprint_open_modes, sprint_open_modes): Likewise.
Signed-off-by: Elliott Hughes <enh@google.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
* defs.h (xlat_search): New prototype.
* util.c (xlat_bsearch_compare, xlat_search): New functions.
* file.c (sprintfstype): Use xlat_search for fsmagic lookup.
* xlat/fsmagic.in: Sort by value and mark as not NULL-terminated.
* tests/statfs.c: New file.
* tests/statfs.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add statfs.
(statfs_CFLAGS): Define.
(TESTS): Add statfs.test.
* tests/.gitignore: Add statfs.