Commit Graph

13 Commits

Author SHA1 Message Date
4ddbfcfb3c Print struct iovec as a regular structure
* io.c (print_iovec): Print names of iov_base and iov_len fields.
* tests/aio.c (main): Update expected output.
* tests/inet-cmsg.c (main): Likewise.
* tests/mmsg.c (main): Likewise.
* tests/msg_name.c (test_msg_name): Likewise.
* tests/preadv-pwritev.c (main): Likewise.
* tests/preadv2-pwritev2.c (main): Likewise.
* tests/preadv.c (main): Likewise.
* tests/pwritev.c (main): Likewise.
* tests/readv.c (main): Likewise.
* tests/recvmsg.c (main): Likewise.
* tests/vmsplice.c (main): Likewise.
* tests/scm_rights-fd.test: Likewise.
* tests/uio.expected: Likewise.
2016-07-13 23:45:20 +00:00
08c0960ad5 msghdr.c: when printing struct struct cmsghdr.cmsg_data, also print its name
* msghdr.c (print_scm_rights, print_scm_creds, print_scm_security,
print_cmsg_ip_pktinfo, print_cmsg_ip_ttl, print_cmsg_ip_tos,
print_cmsg_ip_checksum, print_cmsg_ip_opts, print_cmsg_ip_recverr,
print_cmsg_ip_origdstaddr): Print "cmsg_data=" before its contents.
* tests/inet-cmsg.c (print_pktinfo, print_ttl, print_tos, print_opts,
print_origdstaddr): Update expected output.
* tests/scm_rights-fd.test: Likewise.
2016-06-30 22:02:09 +00:00
26f90afc68 net.c: print struct msghdr as a regular structure
* net.c (print_msghdr): Print msg_name, msg_namelen, msg_iov,
and msg_iovlen fields like other regular fields.
* tests/inet-cmsg.c (main): Update expected output.
* tests/mmsg.c (main): Likewise.
* tests/recvmsg.c (main): Likewise.
* tests/scm_rights-fd.test: Likewise.
2016-06-26 23:57:39 +00:00
00ba20aae1 net.c: when printing struct msghdr.msg_control, also print its name
* net.c (printcmsghdr): Skip control messages of zero length.
Always print "msg_control=" before the control message.
(do_msghdr): Print control message before its length, not after.
* tests/inet-cmsg.c (main): Update expected output.
* tests/scm_rights-fd.test: Likewise.
2016-06-26 23:57:18 +00:00
JayRJoshi
c4e36dc14e tests/scm_rights-fd.test: fix pathname regex
Pathname containing >, }, or non-printable characters was resulting
in failing of the test.

* tests/scm_rights-fd.test: Fix pathname regex and simplify things.
2016-03-23 19:13:13 +00:00
3fdcdd47c6 scm_rights-fd.test: rewrite without fork
* tests/scm_rights.c (main): Rewrite without fork.
Place all objects passed to sendmsg and recvmsg at the end
of memory pages followed by inaccessible pages.
* tests/scm_rights-fd.test: Update.
2016-01-12 16:06:58 +00:00
38a34c9349 Add copyright headers to some files which lack them
Before this change, all files that exist since 20th century had
copyright headers, while most files that appeared later didn't.  This
change fixes the inconsistency by adding missing copyright headers.

It doesn't mean that copyright headers became maintained.  In my view,
git history provides much better information on this subject and is much
more accurate than copyright headers.
2015-12-17 17:56:48 +00:00
8f54664d68 tests: factor out common shell code to functions
Factor out shell code used in several tests to common functions.

* tests/fanotify_mark.expected: New file.
* tests/ioctl.expected: New file.
* tests/net-fd.expected: New file.
* tests/net.expected: New file.
* tests/statfs.expected: New file.
* tests/sun_path.expected: New file.
* tests/uio.expected: New file.
* tests/ipc.sh: New file.
* tests/Makefile.am (EXTRA_DIST): Add them.
* tests/init.sh (dump_log_and_fail_with, run_prog,
run_prog_skip_if_failed, run_strace, run_strace_merge,
match_awk, match_diff, match_grep): New functions.
* tests/*.test: Use them.
2015-03-18 02:29:36 +00:00
c7235992dc printfd: quote pathnames
Change printfd() behaviour in show_fd_path mode to quote pathnames
the same way printpathn() does.

* util.c (printfd): Print non-socket paths using print_quoted_string.
* tests/scm_rights-fd.test: Test it.
* tests/scm_rights.c: Update.
2015-01-26 19:05:40 +00:00
b85a7f3b95 Impove struct cmsghdr decoding
Print all cmsghdr structures in msg_control array,
not just the first one.
Change output format to be consistent with other parts of strace
where structures and arrays are printed.
Implement decoder for SCM_SECURITY message type.

* net.c (print_scm_rights, print_scm_creds, print_scm_security):
New functions.
(printcmsghdr): Use them.  Iterate over all members of the array.
* xlat/scmvals.in: Add SCM_SECURITY.
* tests/scm_rights.c (main): Pass one more descriptor to the receiver.
Set SO_PASSCRED on the receiver part.  Reserve enough space to receive
SCM_CREDENTIALS and SCM_RIGHTS.
* tests/scm_rights-fd.test: Update.
2015-01-24 15:54:33 +00:00
3ec5c0492c tests: cleanup checks for basic programs
* tests/init.sh: Check for cat and rm.
* tests/getdents.test: Check for awk.
* tests/ptrace_setoptions.test: Check for grep.
* tests/net-fd.test: Do not check for rm.
* tests/net.test: Likewise.
* tests/scm_rights-fd.test: Likewise.
* tests/stat.test: Likewise.
* tests/uio.test: Likewise.
2014-09-23 01:51:05 +00:00
e25fb4fd8e tests: fix SCM_RIGHTS test for big-endian systems
* tests/scm_rights.c (main): Send zero integer to avoid issues with
endianness.
* tests/scm_rights-fd.test: Update grep patterns.
2014-05-30 15:18:00 +00:00
f23b097fc5 Decode file descriptors passed via SCM_RIGHTS control messages
* net.c (printcmsghdr): Print descriptors from SCM_RIGHTS control
messages using printfd.
* tests/scm_rights.c: New file.
* tests/scm_rights-fd.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add scm_rights.
(TESTS): Add scm_rights-fd.test.
* tests/.gitignore: Add scm_rights and uio.
2014-05-30 00:20:53 +00:00