summaryrefslogtreecommitdiff
path: root/configure.ac
Commit message (Collapse)AuthorAgeFilesLines
* Implement --secontext[=full] option to display SELinux contextsldv/secontextRenaud Métrich2021-04-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is very useful when debugging SELinux issues, in particular, when a process runs in an unexpected context or didn't transition properly, or typically when a file being opened does not have the proper context. When --secontext=full is specified, strace will print the complete context (user, role, type and category) instead of just the type which is printed for --secontext option, as shown in the examples below: Without any "--secontext" options: ----------------------------------------------------------------------- 118104 16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416> 119820 16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys", O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> <0.000399> ----------------------------------------------------------------------- With "--secontext=full" option: ----------------------------------------------------------------------- 118104 [system_u:system_r:sshd_t:s0-s0:c0.c1023] 16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416> 119820 [system_u:system_r:sshd_t:s0-s0:c0.c1023] 16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys" [system_u:object_r:nfs_t:s0], O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> [system_u:object_r:nfs_t:s0] <0.000399> ----------------------------------------------------------------------- With "--secontext" option: ----------------------------------------------------------------------- 118104 [sshd_t] 16:52:11.141122 select(9, [4<TCP:[0.0.0.0:22]> 6<TCPv6:[[::]:22]>], NULL, NULL, NULL) = 1 (in [4]) <1.845416> 119820 [sshd_t] 16:52:13.133319 openat(AT_FDCWD, "/home/rmetrich/.ssh/authorized_keys" [nfs_t], O_RDONLY|O_NONBLOCK) = 11</home/rmetrich/.ssh/authorized_keys> [nfs_t] <0.000399> ----------------------------------------------------------------------- To implement this, a new "--with-libselinux" configure option has been introduced. It defaults to "check", which means automatic support on SELinux aware systems. Co-authored-by: Dmitry V. Levin <ldv@strace.io>
* tests: switch to use bundled <linux/perf_event.h>Dmitry V. Levin2021-02-231-27/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/perf_event.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_MEMBERS): Remove struct perf_event_attr. (AC_CHECK_HEADERS): Remove linux/perf_event.h. * tests/ioctl_perf-success.c: Include <linux/perf_event.h> unconditionally, assume it defines all its types and constants. * tests/ioctl_perf.c [!HAVE_LINUX_PERF_EVENT_H, !u64]: Remove. * tests/perf_event_open_nonverbose.cc [!HAVE_LINUX_PERF_EVENT_H]: Remove. * tests/perf_event_open.c: Likewise. Assume <linux/perf_event.h> defines all its types and constants.
* tests: switch to use bundled <linux/stat.h>Dmitry V. Levin2021-02-231-3/+0
| | | | | | | | * bundled/linux/include/uapi/linux/stat.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct statx. * tests/statx.c [!HAVE_STRUCT_STATX]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_osf.h>Dmitry V. Levin2021-02-221-3/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_osf.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/xt_osf.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_osf.h>. * src/xlat/nf_osf_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_osf.c: Include <linux/netfilter/nfnetlink_osf.h> instead of <linux/ip.h>, <linux/tcp.h>, and <linux/netfilter/xt_osf.h>. [!HAVE_LINUX_NETFILTER_XT_OSF_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_queue.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_queue.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_queue.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_queue.h>. * src/xlat/nf_queue_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_queue.c [!HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_log.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_log.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_log.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_log.h>. * src/xlat/nf_ulog_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_ulog.c [!HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_cttimeout.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cttimeout.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_cttimeout.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_cttimeout.h>. * src/xlat/nf_cttimeout_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_cttimeout.c [!HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_cthelper.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_cthelper.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_cthelper.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_cthelper.h>. * src/xlat/nf_cthelper_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_cthelper.c [!HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_conntrack.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_conntrack.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_conntrack.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_conntrack.h>. * src/xlat/nf_ctnetlink_exp_msg_types.in: Add #unconditional, remove fallback definitions. * src/xlat/nf_ctnetlink_msg_types.in: Likewise. * tests/nfnetlink_conntrack.c [!HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H]: Remove. * tests/nfnetlink_ctnetlink_exp.c: Likewise.
* netlink: switch to use bundled <linux/netfilter/nfnetlink_acct.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink_acct.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink_acct.h. * src/netlink.c: Include <linux/netfilter/nfnetlink_acct.h>. * src/xlat/nf_acct_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_acct.c [!HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H]: Remove.
* netlink: switch to use bundled <linux/netfilter/nfnetlink.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nfnetlink.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/linux/include/uapi/linux/netfilter/nfnetlink_compat.h: Likewise. * bundled/Makefile.am (EXTRA_DIST): Add them. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nfnetlink.h. * src/netlink.c: Include <linux/netfilter/nfnetlink.h>. [!HAVE_LINUX_NETFILTER_NFNETLINK_H]: Remove. * src/netlink_netfilter.c [!HAVE_LINUX_NETFILTER_NFNETLINK_H]: Remove. * tests/netlink_netfilter.c: Likewise. * tests/nfnetlink_nft_compat.c: Likewise. * tests/nfnetlink_nftables.c: Likewise. * src/xlat/netfilter_versions.in: Add #unconditional, remove fallback definitions. * src/xlat/nl_netfilter_msg_types.in: Likewise. * src/xlat/nl_netfilter_subsys_ids.in: Likewise.
* netlink: switch to use bundled <linux/netfilter/nf_tables_compat.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nf_tables_compat.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nf_tables_compat.h. * src/netlink.c: Include <linux/netfilter/nf_tables_compat.h>. * src/xlat/nf_nft_compat_msg_types.in: Remove fallback definitions, add #unconditional and #value_indexed. * tests/nfnetlink_nft_compat.c: Replace HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H with HAVE_LINUX_NETFILTER_NFNETLINK_H.
* netlink: switch to use bundled <linux/netfilter/nf_tables.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/nf_tables.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/nf_tables.h. * src/netlink.c: Include <linux/netfilter/nf_tables.h>. * src/xlat/nf_nftables_msg_types.in: Add #unconditional, remove fallback definitions. * tests/netlink_netfilter.c [!HAVE_LINUX_NETFILTER_NF_TABLES_H, !NFT_MSG_NEWTABLE]: Remove. * tests/nfnetlink_nftables.c: Replace HAVE_LINUX_NETFILTER_NF_TABLES_H with HAVE_LINUX_NETFILTER_NFNETLINK_H.
* netlink: switch to use bundled <linux/netfilter/ipset/ip_set.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netfilter/ipset/ip_set.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/netfilter/ipset/ip_set.h. * src/netlink.c: Include <linux/netfilter/ipset/ip_set.h>. * src/xlat/nf_ipset_msg_types.in: Add #unconditional, remove fallback definitions. * tests/nfnetlink_ipset.c [!HAVE_LINUX_NETFILTER_IPSET_IP_SET_H]: Remove.
* print_mq_attr: switch to use bundled <linux/mqueue.h>Dmitry V. Levin2021-02-221-1/+0
| | | | | | | | | | | | * bundled/linux/include/uapi/linux/mqueue.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/mqueue.h. * src/kernel_types.h [!HAVE___KERNEL_LONG_T] (__kernel_long_t): New type. [!HAVE___KERNEL_ULONG_T] (__kernel_ulong_t): Likewise. * src/print_mq_attr.c [HAVE_MQUEUE_H, !HAVE_LINUX_MQUEUE_H]: Remove. Include "kernel_types.h" and "kernel_fcntl.h". (printmqattr) [!(HAVE_MQUEUE_H || HAVE_LINUX_MQUEUE_H)]: Remove.
* clone: switch to use bundled <linux/sched.h>Dmitry V. Levin2021-02-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/sched.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/sched.h. (AC_CHECK_MEMBERS): Remove struct clone_args.cgroup. * src/clone.c: Include <linux/sched.h> instead of <sched.h>. [!CSIGNAL]: Remove. (struct strace_clone_args): Remove. (SYS_FUNC(clone3)): Replace struct strace_clone_args with struct clone_args. * src/xlat/clone3_flags.in: Add #unconditional, remove fallback definitions. * src/xlat/clone_flags.in: Likewise. * src/xlat/setns_types.in: Likewise. * src/xlat/unshare_flags.in: Likewise. * tests/clone-flags.c: Include <linux/sched.h> instead of "xlat/clone_flags.h". * tests/clone3.c: Include <linux/sched.h> unconditionally, do not include "xlat/clone_flags.h" and "xlat/clone3_flags.h", replace struct_clone_args with struct clone_args. (struct test_clone_args, struct_clone_args): Remove. * tests/pidns.c [!CLONE_NEWUSER, !CLONE_NEWPID]: Remove. * tests/fork--pidns-translation.c: Likewise.
* configure.ac: do not check for <linux/io_uring.h> and its typesDmitry V. Levin2021-02-211-9/+0
| | | | | | | | | * configure.ac (AC_CHECK_HEADERS): Remove linux/io_uring.h. (AC_CHECK_MEMBERS): Remove struct io_cqring_offsets.flags, struct io_uring_params.features, struct io_uring_params.wq_fd, and struct io_uring_params.resv. Complements: v5.11~54 "io_uring: switch to use bundled <linux/io_uring.h>"
* Switch to use bundled <mtd/ubi-user.h>Dmitry V. Levin2021-02-211-4/+0
| | | | | | | | | | | | | | | * bundled/linux/include/uapi/mtd/ubi-user.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct ubi_mkvol_req.flags and struct ubi_attach_req.max_beb_per1024. * src/ioctl.c [!HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024]: Remove. * src/ubi.c [!HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024, !HAVE_STRUCT_UBI_MKVOL_REQ_FLAGS, !UBI_IOCRPEB, !UBI_IOCSPEB, !UBI_IOCVOLCRBLK, !UBI_IOCVOLRMBLK]: Remove. * tests/ioctl_ubi.c: Likewise. * src/xlat/ubi_volume_flags.in: Add #unconditional, remove fallback definitions.
* Switch to use bundled <mtd/mtd-abi.h>Dmitry V. Levin2021-02-211-2/+0
| | | | | | | | | | | | | | | * bundled/linux/include/uapi/mtd/mtd-abi.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct mtd_write_req. * src/ioctl.c [!HAVE_STRUCT_MTD_WRITE_REQ]: Remove. * src/mtd.c: Likewise. * tests/ioctl.c: Likewise. * tests/ioctl_mtd.c: Likewise. * src/xlat/mtd_flags_options.in: Add #unconditional * src/xlat/mtd_nandecc_options.in: Add #unconditional and #value_indexed. * src/xlat/mtd_otp_options.in: Likewise. * src/xlat/mtd_type_options.in: Likewise.
* Switch to use bundled <linux/blktrace_api.h>Dmitry V. Levin2021-02-211-2/+0
| | | | | | | | | | * bundled/linux/include/uapi/linux/blktrace_api.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct blk_user_trace_setup. * src/block.c: Include <linux/blktrace_api.h>. (BLKTRACE_BDEV_SIZE, struct blk_user_trace_setup): Remove. * tests/ioctl_block.c [!HAVE_STRUCT_BLK_USER_TRACE_SETUP]: Remove.
* Switch to use bundled <linux/netconf.h>Dmitry V. Levin2021-02-211-2/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/netconf.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct netconfmsg. * src/netlink_route.c [!HAVE_STRUCT_NETCONFMSG]: Remove. * src/rtnl_netconf.c: Likewise. * tests/netlink_route.c: Likewise. * tests/nlattr_netconfmsg.c: Likewise. * src/xlat/rtnl_netconf_attrs.in: Add #unconditional, remove fallback definitions.
* Switch to use bundled <linux/if_addrlabel.h>Dmitry V. Levin2021-02-211-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/if_addrlabel.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct ifaddrlblmsg. * src/netlink_route.c [!HAVE_STRUCT_IFADDRLBLMSG]: Remove. * src/rtnl_addrlabel.c: Likewise. * tests/netlink_route.c: Likewise. * tests/nlattr_ifaddrlblmsg.c: Likewise. * src/xlat/rtnl_addrlabel_attrs.in: Add #unconditional, remove fallback definitions.
* Switch to use bundled <linux/dcbnl.h>Dmitry V. Levin2021-02-211-1/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/dcbnl.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct dcbmsg. * src/rtnl_dcb.c [!HAVE_STRUCT_DCBMSG]: Remove. * src/netlink_route.c: Likewise. * tests/netlink_route.c: Likewise. * tests/nlattr_dcbmsg.c: Likewise. * src/xlat/dcb_commands.in: Add #unconditional, remove fallback definitions. * src/xlat/rtnl_dcb_attrs.in: Likewise.
* Switch to use bundled <linux/pkt_sched.h>Dmitry V. Levin2021-02-211-3/+0
| | | | | | | | | | | * bundled/linux/include/uapi/linux/pkt_sched.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct tc_sizespec. * src/rtnl_tc.c [!HAVE_STRUCT_TC_SIZESPEC]: Remove. * tests/nlattr_tca_stab.c: Likewise. * src/xlat/rtnl_tca_stab_attrs.in: Add #unconditional, remove fallback definitions, #enum, and #include.
* Switch to use bundled <linux/gen_stats.h>Dmitry V. Levin2021-02-211-7/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/gen_stats.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct gnet_stats_basic, struct gnet_stats_queue, struct gnet_stats_rate_est, and struct gnet_stats_rate_est64. * src/rtnl_tc.c: Include <linux/gen_stats.h> unconditionally, assume it defines all its types and constants. * tests/nlattr_tc_stats.c: Likewise. * src/xlat/rtnl_tca_stats_attrs.in: Add #unconditional, remove fallback definitions, #enum, and #include.
* Switch to use bundled <linux/keyctl.h>Dmitry V. Levin2021-02-211-6/+0
| | | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/keyctl.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct keyctl_kdf_params, struct keyctl_pkey_params, and struct keyctl_pkey_query. * src/keyctl.c (struct keyctl_dh_params, struct keyctl_pkey_params, struct keyctl_pkey_query): Remove. * src/keyctl_kdf_params.h: Include <linux/keyctl.h>. (struct keyctl_kdf_params): Remove. * src/xlat/key_perms.in: Add comment. * src/xlat/key_reqkeys.in: Add #unconditional, remove fallback definitions. * src/xlat/key_spec.in: Likewise. * src/xlat/keyctl_caps0.in: Likewise. * src/xlat/keyctl_caps1.in: Likewise. * src/xlat/keyctl_commands.in: Likewise. * src/xlat/keyctl_move_flags.in: Likewise. * src/xlat/keyctl_pkey_ops.in: Likewise. * tests/keyctl.c: Assume <linux/keyctl.h> defines all its types and constants.
* Switch to use bundled <linux/ptp_clock.h>Dmitry V. Levin2021-02-201-4/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/ptp_clock.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct ptp_sys_offset. * src/ioctl.c (ioctl_decode) [!HAVE_STRUCT_PTP_SYS_OFFSET]: Remove. * src/ptp.c: Assume <linux/ptp_clock.h> is available and defined all its types and constants. * tests/ioctl_ptp.c: Likewise. * src/xlat/ptp_extts_flags.in: Add #unconditional, remove fallback definitions. * src/xlat/ptp_perout_flags.in: Likewise.
* Switch to use bundled <linux/fcntl.h>Dmitry V. Levin2021-02-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/fcntl.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_TYPES): Remove struct flock, struct flock64, struct __kernel_flock, struct __kernel_flock64, struct f_owner_ex, and struct __kernel_f_owner_ex. * src/f_owner_ex.h: Remove. * src/flock.h: Likewise. * src/Makefile.am (libstrace_a_SOURCES): Remove f_owner_ex.h and flock.h. * src/fcntl.c: Include <linux/fcntl.h> instead of "flock.h". (print_struct_flock64, printflock64, printflock): Replace struct_kernel_flock64 with struct flock64. * src/fetch_struct_flock.c: Include <linux/fcntl.h> instead of "flock.h". Replace struct_kernel_flock64 with struct flock64 and struct_kernel_flock with struct flock. * src/file_handle.c: Include <linux/fcntl.h>. * src/open.c: Likewise. * src/open_tree.c: Likewise. * src/statx.c: Likewise. * src/link.c: Include <linux/fcntl.h> instead of <fcntl.h>. * src/xlat/at_flags.in: Add #unconditional, remove fallback definitions. * src/xlat/f_owner_types.in: Likewise. * src/xlat/f_seals.in: Likewise. * src/xlat/fcntlcmds.in: Likewise. * src/xlat/name_to_handle_at_flags.in: Likewise. * src/xlat/open_tree_flags.in: Likewise. * src/xlat/fdflags.in: Add #unconditional. * src/xlat/lockfcmds.in: Likewise. * src/xlat/notifyflags.in: Likewise. * tests/fcntl-common.c: Include <linux/fcntl.h> instead of "flock.h", do not include "f_owner_ex.h", always define and invoke test_f_owner_ex, assume <linux/fcntl.h> defines all its types and constants, replace struct_kernel_flock64 with struct flock64, struct_kernel_flock with struct flock, and struct_kernel_f_owner_ex with struct f_owner_ex. * tests/fcntl.c (test_flock64_undecoded): Replace struct_kernel_flock64 with struct flock64. * tests/fcntl64.c (test_flock64_lk64): Likewise. * tests/openat2.c: Include <linux/fcntl.h>, assume it defines all its types and constants.
* Switch to use bundled <linux/seccomp.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/seccomp.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/seccomp.h. * src/bpf_seccomp_filter.c: Include <linux/seccomp.h> unconditionally, assume all its types and constants are defined. * src/disable_ptrace_request.c: Likewise. * src/filter_seccomp.c: Likewise. * src/prctl.c: Likewise. * src/seccomp.c: Likewise. * tests/prctl-seccomp-filter-v.c: Likewise. * tests/seccomp-filter-v.c: Likewise. * tests/seccomp-filter.c: Likewise. * tests/seccomp_get_action_avail.c: Likewise. * src/xlat/seccomp_filter_flags.in: Add #unconditional, remove fallback definitions. * src/xlat/seccomp_mode.in: Likewise. * src/xlat/seccomp_ops.in: Likewise. * src/xlat/seccomp_ret_action.in: Likewise.
* Switch to use bundled <linux/quota.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | | * bundled/linux/include/uapi/linux/quota.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/quota.h. * tests/quotactl.h: Include <linux/quota.h> unconditionally. * tests/quotactl-xfs.c: Assume <linux/quota.h> is available. * tests/quotactl.c: Likewise. [!Q_GETNEXTQUOTA]: Remove.
* Switch to use bundled <linux/securebits.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | * bundled/linux/include/uapi/linux/securebits.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/securebits.h. * src/prctl.c: Include <linux/securebits.h> unconditionally. * src/xlat/secbits.in: Add #unconditional, remove fallback definitions. * tests/prctl-securebits.c: Include <linux/securebits.h>.
* Switch to use bundled <linux/utsname.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | | * bundled/linux/include/uapi/linux/utsname.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/utsname.h. * src/hostname.c: Include <linux/utsname.h> unconditionally, assume __NEW_UTS_LEN is defined. * tests/sethostname.c: Likewise. * src/sysmips.c [MIPS]: Likewise.
* Switch to use bundled <linux/userfaultfd.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/userfaultfd.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/userfaultfd.h. * src/userfaultfd.c [!HAVE_LINUX_USERFAULTFD_H]: Remove. * src/ioctl.c: Likewise. * src/xlat/uffd_api_features.in: Add #unconditional, remove fallback definitions. * src/xlat/uffd_flags.in: Likewise. * src/xlat/uffd_api_flags.in: Add #unconditional. * src/xlat/uffd_copy_flags.in: Likewise. * src/xlat/uffd_register_ioctl_flags.in: Likewise. * src/xlat/uffd_register_mode_flags.in: Likewise. * src/xlat/uffd_zeropage_flags.in: Likewise. * tests/ioctl_uffdio.c: Include "kernel_fcntl.h" instead of <fcntl.h>. [!HAVE_LINUX_USERFAULTFD_H]: Remove.
* Switch to use bundled <linux/nsfs.h>Dmitry V. Levin2021-02-201-1/+0
| | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/nsfs.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/nsfs.h. * src/nsfs.h: Remove. * src/Makefile.am (libstrace_a_SOURCES): Remove nsfs.h. * src/nsfs.c: Include <linux/nsfs.h> instead of "nsfs.h". * src/pidns.c: Likewise. * tests/fork--pidns-translation.c: Likewise. * tests/ioctl_nsfs.c: Likewise. * tests/pidns.c: Likewise.
* Switch to use bundled <linux/memfd.h> and <asm-generic/hugetlb_encode.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/memfd.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/linux/include/uapi/asm-generic/hugetlb_encode.h: Likewise. * bundled/Makefile.am (EXTRA_DIST): Add them. * configure.ac (AC_CHECK_HEADERS): Remove linux/memfd.h. * src/memfd.c: Include <linux/memfd.h> unconditionally, assume it provides all necessary constants. * tests/memfd.c: Likewise. * src/xlat/memfd_create_flags.in: Add #unconditional, remove fallback definitions.
* Switch to use bundled <linux/kcmp.h>Dmitry V. Levin2021-02-191-5/+0
| | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/kcmp.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/kcmp.h. (AC_CHECK_TYPES): Remove struct kcmp_epoll_slot. * src/kcmp.c: Include <linux/kcmp.h>. (struct strace_kcmp_epoll_slot): Remove. (SYS_FUNC(kcmp)): Use struct kcmp_epoll_slot instead of struct strace_kcmp_epoll_slot. * src/xlat/kcmp_types.in: Add #unconditional, remove fallback definitions. * tests/kcmp.c: Include <linux/kcmp.h>, assume it defines all necessary types and constants.
* Switch to use bundled <linux/ip_vs.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | * bundled/linux/include/uapi/linux/ip_vs.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/ip_vs.h. * src/net.c: Include <linux/ip_vs.h> unconditionally.
* Switch to use bundled <linux/mmtimer.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | * bundled/linux/include/uapi/linux/mmtimer.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/mmtimer.h. * tests/ioctl.c: Assume <linux/mmtimer.h> is always available and defines all its constants.
* Switch to use bundled <linux/hiddev.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | * bundled/linux/include/uapi/linux/hiddev.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/hiddev.h. * tests/ioctl.c: Assume <linux/hiddev.h> is always available and defines all its constants.
* Switch to use bundled <linux/falloc.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | | | * bundled/linux/include/uapi/linux/falloc.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/falloc.h. * src/fallocate.c: Include <linux/falloc.h> unconditionally. * src/xlat/falloc_flags.in: Add #unconditional, remove fallback definitions. * tests/fallocate.c: Include <linux/falloc.h>.
* Switch to use bundled <linux/dqblk_xfs.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * bundled/linux/include/uapi/linux/dqblk_xfs.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/dqblk_xfs.h. * src/xfs_quota_stat.h: Remove. * src/Makefile.am (libstrace_a_SOURCES): Remove xfs_quota_stat.h. * src/fetch_struct_xfs_quotastat.c: Include <linux/dqblk_xfs.> instead of "xfs_quota_stat.h", use fs_quota_stat_t instead of struct xfs_dqstats. * src/quota.c: Include <linux/dqblk_xfs.> instead of "xfs_quota_stat.h", use fs_quota_stat_t instead of struct xfs_dqstats, and fs_disk_quota_t instead of struct xfs_dqblk. (struct xfs_dqblk, struct fs_qfilestatv, struct fs_quota_statv, XQM_CMD): Remove. (decode_cmd_data): Replace "XFS_???_QUOTA" with "FS_???_QUOTA", "XFS_QUOTA_???" with "FS_QUOTA_???". * src/xlat/xfs_dqblk_flags.in: Add #unconditional, remove fallback definitions, rename XFS_QUOTA_* to FS_QUOTA_*. * src/xlat/xfs_quota_flags.in: Add #unconditional, remove fallback definitions, rename XFS_*_QUOTA to FS_*_QUOTA. * tests/quotactl-xfs.c [!HAVE_LINUX_DQBLK_XFS_H, !Q_GETNEXTQUOTA, !Q_XGETQSTATV]: Remove. (main): Replace XFS_QUOTA_* with FS_QUOTA_* and XFS_*_QUOTA with FS_*_QUOTA in expected output.
* Switch to use bundled <linux/dm-ioctl.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/dm-ioctl.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/dm-ioctl.h. * src/dm.c: Assume all constants provided by <linux/dm-ioctl.h> are defined. [!HAVE_LINUX_DM_IOCTL_H, DM_VERSION_MAJOR != 4]: Remove. * src/ioctl.c (ioctl_decode) [!HAVE_LINUX_DM_IOCTL_H]: Remove. * src/xlat/dm_flags.in: Add #unconditional, remove fallback definitions. * tests/ioctl_dm.c [!HAVE_LINUX_DM_IOCTL_H]: Remove.
* Switch to use bundled <linux/bsg.h>Dmitry V. Levin2021-02-191-1/+0
| | | | | | | | | | | | | * bundled/linux/include/uapi/linux/bsg.h: New file, copied from headers_install'ed Linux kernel v5.11. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/bsg.h. * src/sg_io_v4.c [!HAVE_LINUX_BSG_H]: Remove. * src/xlat/bsg_flags.in: Add #unconditional, remove fallback definitions. * src/xlat/bsg_protocol.in: Add #unconditional and #value_indexed. * src/xlat/bsg_subprotocol.in: Likewise. * tests/ioctl_sg_io_v4.c: Likewise.
* build: fix build using bionic libcDmitry V. Levin2021-02-191-0/+7
| | | | | | | | | | | | | | | Apparently, bionic libc uses unconventional approach of patching Linux uapi header files to provide and use struct sockaddr_storage instead of struct __kernel_sockaddr_storage. * src/linux/generic/socket.h.in: New file. * src/Makefile.am (EXTRA_DIST): Add linux/generic/socket.h.in. (DISTCLEANFILES): Add linux/generic/linux/socket.h. * configure.ac (AC_CHECK_TYPES): Check for struct sockaddr_storage in <sys/socket.h>; if not found, install a proxy <linux/socket.h> file. * NEWS: Mention this. Resolves: https://github.com/strace/strace/issues/174
* configure.ac: fix <linux/signal.h> workaroundDmitry V. Levin2021-02-191-1/+1
| | | | | | | * configure.ac: Fix temporary CPPFLAGS when <linux/signal.h> workaround is enabled. Fixes: v5.11~73 "Move source files into src subdirectory"
* Update copyright headersDmitry V. Levin2021-02-161-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* Switch to use bundled <asm-generic/fcntl.h> and <asm/fcntl.h>Dmitry V. Levin2021-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux kernel commit v5.10-rc1~111^2~13 changed the value of O_NONBLOCK on hppa from 0200004 to 0200000, breaking the following build assertion: xlat/open_mode_flags.h:158:1: error: static assertion failed: "O_NONBLOCK != 0200004" Address this issue by switching to use bundled fcntl.h files where appropriate. * NEWS: Mention this. * bundled/linux/include/uapi/asm-generic/fcntl.h: New file, copied from Linux kernel v5.11. * bundled/linux/arch/alpha/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/arm/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/arm64/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/ia64/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/m68k/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/mips/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/parisc/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/powerpc/include/uapi/asm/fcntl.h: Likewise. * bundled/linux/arch/sparc/include/uapi/asm/fcntl.h: Likewise. * bundled/Makefile.am (EXTRA_DIST): Add them. (dist-hook): New rule. * configure.ac: Invoke AC_PROG_LN_S. * src/kernel_fcntl.h: New file. * src/Makefile.am (libstrace_a_SOURCES): Add kernel_fcntl.h. * src/open.c: Include "kernel_fcntl.h" instead of <asm/fcntl.h>, remove redefinitions of O_ACCMODE and O_LARGEFILE. * src/open_tree.c: Include "kernel_fcntl.h" instead of "xlat/open_mode_flags.h". * src/bjm.c: Include "kernel_fcntl.h" instead of <fcntl.h>. * src/epoll.c: Likewise. * src/inotify.c: Likewise. * src/pidfd_open.c: Likewise. * src/time.c: Likewise. * src/userfaultfd.c: Likewise. * src/eventfd.c: Include "kernel_fcntl.h" instead of <fcntl.h> and <sys/eventfd.h>. * src/signalfd.c: Include "kernel_fcntl.h" instead of <fcntl.h> and <sys/signalfd.h>. * src/xlat/open_mode_flags.in: Add #unconditional, remove fallback definitions. (O_ASYNC, O_RSYNC, O_NDELAY): Remove. * src/xlat/open_access_modes.in: remove fallback definitions. * src/xlat/efd_flags.in (EFD_CLOEXEC): Define unconditionally. * src/xlat/epollflags.in (EPOLL_CLOEXEC): Likewise. * src/xlat/inotify_init_flags.in (IN_CLOEXEC): Likewise. * src/xlat/sfd_flags.in (SFD_CLOEXEC): Likewise. * src/xlat/timerfdflags.in (TFD_CLOEXEC): Likewise. * tests/dup3.c: Include "kernel_fcntl.h" instead of <fcntl.h>, assume O_CLOEXEC is defined. (main) [__sparc__]: Remove special handling of O_NDELAY. * tests/mq_sendrecv.c: Include "kernel_fcntl.h" instead of <fcntl.h>. (main): Replace S_IRWXU with 0700. * tests/accept4.c: Include "kernel_fcntl.h" instead of <fcntl.h>, assume O_CLOEXEC is defined. * tests/epoll_create1.c: Likewise. * tests/eventfd.c: Likewise. * tests/inotify_init1.c: Likewise. * tests/signalfd4.c: Likewise. * tests/timerfd_xettime.c: Likewise. * tests/userfaultfd.c: Likewise. * tests/delete_module.c: Include "kernel_fcntl.h" instead of <fcntl.h>. * tests/pipe2.c: Likewise. * tests/open_tree.c: Include "kernel_fcntl.h", assume O_CLOEXEC is defined. * tests/pidfd_open.c: Include "kernel_fcntl.h".
* Remove src/types infrastructureDmitry V. Levin2021-02-131-1/+0
| | | | | | | | | | | | | All its former users have been converted to use bundled Linux uapi header files. * src/types/gen.sh: Remove. * src/types/find_last_type_fields.awk: Likewise. * Makefile.am (ACLOCAL_AMFLAGS): Remove "-I src/types". * bootstrap: Remove ./src/types/gen.sh invocation. * configure.ac: Remove st_CHECK_TYPES invocation. * src/Makefile.am: Do not include types/Makemodule.am. (EXTRA_DIST): Remove types/find_last_type_fields.awk and types/gen.sh.
* rtnl_mdb: switch to use bundled <linux/if_bridge.h>Dmitry V. Levin2021-02-131-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/types/rtnl_mdb.h: Remove. * bundled/linux/include/uapi/linux/if_bridge.h: New file, copied from headers_install'ed Linux kernel v5.11-rc6. * bundled/linux/include/uapi/linux/in6.h: Likewise. * bundled/linux/include/uapi/linux/libc-compat.h: Likewise. * bundled/Makefile.am (EXTRA_DIST): Add them. * configure.ac (AC_CHECK_MEMBERS): Remove struct br_mdb_entry.flags and struct br_mdb_entry.vid. * src/rtnl_mdb.c: Include <netinet/in.h> and <linux/if_bridge.h> instead of "types/rtnl_mdb.h". (decode_mdba_mdb_entry_info): Replace struct_br_mdb_entry with struct br_mdb_entry. (decode_br_port_msg): Replace struct_br_port_msg with struct br_port_msg. * src/xlat/mdb_flags.in: Add #unconditional. * src/xlat/mdb_states.in: Add #unconditional and #value_indexed. * src/xlat/multicast_router_types.in: Add #unconditional, remove fallback definitions. * src/xlat/rtnl_mdb_attrs.in: Likewise. * src/xlat/rtnl_mdba_mdb_attrs.in: Likewise. * src/xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise. * src/xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise. * src/xlat/rtnl_mdba_router_attrs.in: Likewise. * src/xlat/rtnl_mdba_router_pattr_attrs.in: Likewise. * tests/netlink_route.c: Do not include <netinet/in.h>, Assume all <linux/if_bridge.h> constants, structures and their fields are available. * tests/nlattr_br_port_msg.c: Compile unconditionally, do not include <netinet/in.h>, Assume all <linux/if_bridge.h> constants, structures and their fields are available. * tests/nlattr_mdba_mdb_entry.c: Likewise. * tests/nlattr_mdba_router_port.c: Likewise.
* rtnl_neigh: switch to use bundled <linux/neighbour.h>Dmitry V. Levin2021-02-111-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | * src/types/rtnl_neightbl.h: Remove. * bundled/linux/include/uapi/linux/neighbour.h: New file, copied from headers_install'ed Linux kernel v5.11-rc6. * bundled/Makefile.am (EXTRA_DIST): Add it. * configure.ac (AC_CHECK_HEADERS): Remove linux/neighbour.h. * src/rtnl_neigh.c: Include <linux/neighbour.h> instead of <linux/rtnetlink.h>. * src/rtnl_neightbl.c: Include <linux/neighbour.h> instead of "types/rtnl_neightbl.h". (decode_ndt_config): Replace struct_ndt_config with struct ndt_config. (decode_ndt_stats): Replace struct_ndt_stats with struct ndt_stats. * src/xlat/neighbor_cache_entry_flags.in: Add #unconditional. * src/xlat/neighbor_cache_entry_states.in: Likewise. * src/xlat/rtnl_neigh_attrs.in: Add #unconditional, remove fallback definitions. * tests/netlink_route.c Include <linux/neighbour.h> unconditionally. * tests/nlattr_ndmsg.c: Likewise. (NDA_PORT): Remove. * tests/nlattr_ndtmsg.c: Include <linux/neighbour.h> unconditionally, assume all <linux/neighbour.h> types are properly defined, remove fallback definitions for constants defined in <linux/neighbour.h>.