Skip to content

Commit

Permalink
Remove broken execvpe implementation
Browse files Browse the repository at this point in the history
It was broken when enabled, and currently the libc definition is only
available for windows. This will be re-added when a new libc is released
that supports it across all available platforms
  • Loading branch information
Susurrus committed Jul 17, 2017
1 parent 55f7060 commit 4cb46ad
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ exclude = [
"test/**/*"
]

[features]
execvpe = []

[dependencies]
libc = "0.2.25"
bitflags = "0.9"
Expand Down
22 changes: 0 additions & 22 deletions src/unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,9 +944,6 @@ mod linux {
use {Errno, Result, NixPath};
use super::{Uid, Gid};

#[cfg(feature = "execvpe")]
use std::ffi::CString;

pub fn pivot_root<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
new_root: &P1, put_old: &P2) -> Result<()> {
let res = try!(try!(new_root.with_nix_path(|new_root| {
Expand Down Expand Up @@ -991,23 +988,4 @@ mod linux {

Errno::result(res).map(drop)
}

#[inline]
#[cfg(feature = "execvpe")]
pub fn execvpe(filename: &CString, args: &[CString], env: &[CString]) -> Result<()> {
use std::ptr;
use libc::c_char;

let mut args_p: Vec<*const c_char> = args.iter().map(|s| s.as_ptr()).collect();
args_p.push(ptr::null());

let mut env_p: Vec<*const c_char> = env.iter().map(|s| s.as_ptr()).collect();
env_p.push(ptr::null());

unsafe {
super::ffi::execvpe(filename.as_ptr(), args_p.as_ptr(), env_p.as_ptr())
};

Err(Error::Sys(Errno::last()))
}
}
4 changes: 0 additions & 4 deletions test/test_unistd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,3 @@ fn test_lseek64() {
}

execve_test_factory!(test_execve, execve, b"/bin/sh", b"/system/bin/sh");

#[cfg(any(target_os = "linux", target_os = "android"))]
#[cfg(feature = "execvpe")]
execve_test_factory!(test_execvpe, execvpe, b"sh", b"sh");

0 comments on commit 4cb46ad

Please sign in to comment.