about summary refs log tree commit diff
path: root/src/test/run-pass/command-exec.rs
AgeCommit message (Collapse)AuthorLines
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-14std: Synchronize access to global env during `exec`Alex Crichton-0/+36
This commit, after reverting #55359, applies a different fix for #46775 while also fixing #55775. The basic idea was to go back to pre-#55359 libstd, and then fix #46775 in a way that doesn't expose #55775. The issue described in #46775 boils down to two problems: * First, the global environment is reset during `exec` but, but if the `exec` call fails then the global environment was a dangling pointer into free'd memory as the block of memory was deallocated when `Command` is dropped. This is fixed in this commit by installing a `Drop` stack object which ensures that the `environ` pointer is preserved on a failing `exec`. * Second, the global environment was accessed in an unsynchronized fashion during `exec`. This was fixed by ensuring that the Rust-specific environment lock is acquired for these system-level operations. Thanks to Alex Gaynor for pioneering the solution here! Closes #55775 Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-11-14Revert "Fixes #46775 -- don't mutate the process's environment in Command::exec"Alex Crichton-12/+0
This reverts commit 36fe3b605a7a7143a14565272140ba1b43c1b041.
2018-11-01Fixes #46775 -- don't mutate the process's environment in Command::execAlex Gaynor-0/+12
Instead, pass the environment to execvpe, so the kernel can apply it directly to the new process. This avoids a use-after-free in the case where exec'ing the new process fails for any reason, as well as a race condition if there are other threads alive during the exec.
2018-09-21Allow various lints as part of ui-ifying `src/test/run-pass` suite.Felix S. Klock II-0/+1
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-0/+1
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2017-10-17test: Update Emscripten failures/passingAlex Crichton-1/+2
All tests should now have annotation for *why* they're ignored on emscripten. A few tests no longer need such an annotation as well! Closes #41299
2016-10-18Fix some pretty printing testsVadim Petrochenkov-2/+1
2016-08-10[emscripten] Ignore testsJan-Erik Rediger-0/+1
Most of these rely on spawning processes, which is not possible in Emscripten.
2016-02-10std: Implement CommandExt::execAlex Crichton-0/+72
This commit implements the `exec` function proposed in [RFC 1359][rfc] which is a function on the `CommandExt` trait to execute all parts of a `Command::spawn` without the `fork` on Unix. More details on the function itself can be found in the comments in the commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1359 cc #31398