We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5cf76df commit 93d4414Copy full SHA for 93d4414
process.c
@@ -4759,7 +4759,16 @@ rb_posix_spawn(struct rb_execarg *eargp)
4759
// posix_spawn only returns fork/vfork/clone failures.
4760
// If it failed but errno == 0, then it must be an "exec" failure.
4761
if (errno == 0) {
4762
- eaccess(abspath, X_OK);
+ if (!eaccess(abspath, X_OK)) {
4763
+ // abspath is executable
4764
+ struct stat file_stat;
4765
+ if (stat(abspath, &file_stat)) {
4766
+ rb_sys_fail(abspath);
4767
+ }
4768
+ if (S_ISDIR(file_stat.st_mode)) {
4769
+ errno = EISDIR;
4770
4771
4772
}
4773
rb_sys_fail(abspath);
4774
0 commit comments