Fix posix_spawn launching sh script
This commit is contained in:
@@ -85,6 +85,11 @@ pub fn fexec_impl(
|
||||
pread_all(&image_file, 0, &mut header_bytes)?;
|
||||
let header = Header::from_bytes(&header_bytes);
|
||||
|
||||
if header.e_ident[..4] != [0x7F, 0x45, 0x4C, 0x46] {
|
||||
// Not an ELF, according to posix_spawn() just throw error here
|
||||
return Err(Error::new(ENOEXEC));
|
||||
}
|
||||
|
||||
let grants_fd = if let Some(interp) = interp_override.as_ref() {
|
||||
FdGuard::new(interp.grants_fd).to_upper()?
|
||||
} else {
|
||||
|
||||
@@ -1332,7 +1332,7 @@ impl Pal for Sys {
|
||||
// .map(|s| str::from_utf8(s).unwrap_or("???"))
|
||||
// .collect::<Vec<_>>()
|
||||
// .as_slice(),
|
||||
// cwd.as_bytes()
|
||||
// cwd.as_str()
|
||||
// );
|
||||
|
||||
new_file_table.call_wo(
|
||||
|
||||
Reference in New Issue
Block a user