fix(native): close-from in spawned programs covers what is open at the spawn

This commit is contained in:
Kurt Himebauch committed 2026-11-09 12:26:36 -05:00
1 parent d6363d3b48
commit c8757e7a94
2 files changed
+118 -13

No files matched your search

+3
View File
@@ -878,10 +878,13 @@ static int ddnatv_posix_spawn(pid_t *pid, const char *path,
return ret;
}
static void apply_closefrom(posix_spawn_file_actions_t *actions);
int posix_spawn(pid_t *pid, const char *path,
const posix_spawn_file_actions_t *file_actions,
const posix_spawnattr_t *attrp,
char *const argv[], char *const envp[]) {
if (file_actions) apply_closefrom((posix_spawn_file_actions_t *)file_actions);
posix_spawnattr_t sanitized;
return ddnatv_posix_spawn(pid, path, file_actions, spawn_attr_for_android(attrp, &sanitized), argv, envp, 0);
}