summaryrefslogtreecommitdiff
path: root/test/sys/test_ptrace.rs
AgeCommit message (Collapse)Author
2022-06-24Fix all formating problems to pass CI formating testCostin-Robert Sin
Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
2022-05-15Add ptrace::read_user and ptrace::write_userNikita Baksalyar
2021-12-26Fix typosRyan Zoeller
2021-11-27Avoid lock poisoning by using parking_lotRyan Zoeller
parking_lot provides synchronization primitives which aren't poisoned on panic. This makes it easier to determine which tests are failing, as a test failure no longer causes all subsequent tests using that mutex to fail.
2021-08-22Print function name and missing capability when skipping testsRyan Zoeller
2021-08-09Add PTRACE_INTERRUPTMika Vatanen
2021-07-07Collapse Error into ErrnoAlan Somers
Now that Nix's weird error types are eliminated, there's no reason not to simply use Errno as the Error type.
2021-07-07Overhaul Nix's error typesAlan Somers
For many of Nix's consumers it be convenient to easily convert a Nix error into a std::io::Error. That's currently not possible because of the InvalidPath, InvalidUtf8, and UnsupportedOperation types that have no equivalent in std::io::Error. However, very few of Nix's public APIs actually return those unusual errors. So a more useful API would be for Nix's standard error type to implement Into<std::io::Error>. This commit makes Error a simple NewType around Errno. For most functions it's a drop-in replacement. There are only three exceptions: * clearenv now returns a bespoke error type. It was the only Nix function whose error couldn't be cleanly mapped onto an Errno. * sys::signal::signal now returns Error(Errno::ENOTSUP) instead of Error::UnsupportedOperation when the user passes an incompatible argument to `handler`. * When a NixPath exceeds PATH_MAX, it will now return Error(Errno::ENAMETOOLONG) instead of Error::InvalidPath. In the latter two cases there is now some abiguity about whether the error code was generated by Nix or by the OS. But I think the ambiguity is worth it for the sake of being able to implement Into<io::Error>. This commit also introduces Error::Sys() as a migration aid. Previously that as an enum variant. Now it's a function, but it will work in many of the same contexts as the original. Fixes #1155
2021-02-15Fix test_ptrace_syscall() on x32наб
Based on https://github.com/nix-rust/nix/issues/1384#issuecomment-774708486
2020-12-06Switch all builds from Travis to CirrusAlan Somers
Travis has been super-slow lately (> 6 hours per build). Cirrus is much faster: about 20 minutes. Cirrus also has slightly better test coverage, mainly because it doesn't use SECCOMP. Also, * Fix the Redox CI build. The old Travis configuration didn't actually build for Redox, so we never noticed that Redox can't be built with a stable compiler. Thanks to @coolreader18 for finding this. * Disable the udp_offload tests on cross-tested platforms. These tests are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a lack of support in QEMU. These tests were skipped on Travis because its kernel was too old. * Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux kernel version as 4.19.112+, which the semver crate can't handle. * Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the file in /tmp gets deleted as soon as it's closed. Probably an overzealous temporary file cleaner. Use /var/tmp, because no temporary file cleaner should run in there. * Skip mount tests on Cirrus. They fail for an unknown reason. Issue #1351 * Skip the AF_ALG tests on Cirrus-CI Issue #1352
2020-09-20Mark nix::unistd::fork as unsafe.Vitaly _Vi Shukela
Fix tests. No change in documentation. Resolves #1030.
2020-07-03Add a missing require_capability! to a testAlan Somers
2020-05-31Convert the crate to edition 2018Alan Somers
2019-12-01Allow signal injection in ptrace::{syscall, detach}Francisco Giordano
2019-09-19Require CAP_SYS_PTRACE for certain testsAlan Somers
process_vm_readv requires it, and I'm not exactly sure which other things do too.
2019-09-03Replace most instances of mem::uninitialized with mem::MaybeUninitAlan Somers
Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Fixes #1096
2018-10-21Added ptrace support for BSDsxd009642
* Moved ptrace API into it's own module with cfg'ed modules exported for linux/android or BSDs. * Replicated current linux API for BSD * Added API functions to peek and poke memory to avoid needing to replicate deprecated linux API and remaining feature complete * Added helper function for `PTRACE_KILL` requests * Updated tests based on new API changes * Added addition kill calls to `test_ptrace_cont` as inferior death doesn't happen immediately on OSX which caused issues in the tests.
2018-10-15Eliminate compiler warnings, especially on non-Linux platformsAlan Somers
2017-12-20Remove match statements with one armBryant Mairs
2017-12-20Remove useless Err(_) match armsBryant Mairs
2017-12-02Upgrade to Bitflags 1.0Bryant Mairs
The libc_bitflags! macro was replaced with a non-recursive one supporting only public structs. I could not figure out how to make the old macro work with the upgrade, so I reworked part of the bitflags! macro directly to suit our needs, much as the original recursive macro was made. There are no uses of this macro for non-public structs, so this is not a problem for internal code.
2017-08-28Moved ptrace constants into enum types added minor functionality.xd009642
Used the libc_enum! macro to create enums for the ptrace event, request, and libc_bitflags for options constants defined in libc. Also, replicated functionality to move from c_int to PtraceEvent enum in PR #728 as it appears to be abandoned. Added utility function for detaching from tracee. Updated names and removed ptrace::ptrace namespace
2017-08-02Reword the comment.Marcin Mielniczuk
2017-07-31Extra docMarcin Mielniczuk
2017-07-31Add a line break.Marcin Mielniczuk
2017-07-31Possibly fix tests failing on qemu architectures.Marcin Mielniczuk
2017-07-31Add tests for ptrace::contMarcin Mielniczuk
2017-07-26Mark nix::sys::ptrace::ptrace as unsafe, add safe variants of source routines.Marcin Mielniczuk
These include: * PTRACE_TRACEME * PTRACE_CONT * PTRACE_ATTACH * PTRACE_SYSCALL
2017-07-21Get rid of the bulk importsMarcin Mielniczuk
2017-07-20Tidy up imports in test_ptrace.rsMarcin Mielniczuk
2017-07-20Fix testsMarcin Mielniczuk
2017-07-17Fix UnsupportedOperation when using ptrace_* functionsBryant Mairs
2017-07-08Enable ptrace on all Linux platformsGeoffrey Thomas
Nothing that nix currently binds is architecture-specific, and Android supports ptrace just as much as non-Android Linux.