Fix posix_spawn launching sh script

This commit is contained in:
Wildan M
2026-06-23 12:22:31 +07:00
parent aa16f69fed
commit b5e764d967
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -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 {
+1 -1
View File
@@ -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(