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 1f0c181 commit 0e09ba3Copy full SHA for 0e09ba3
process.c
@@ -4757,7 +4757,16 @@ rb_posix_spawn(struct rb_execarg *eargp)
4757
// posix_spawn only returns fork/vfork/clone failures.
4758
// If it failed but errno == 0, then it must be an "exec" failure.
4759
if (errno == 0) {
4760
- eaccess(abspath, X_OK);
+ if (!eaccess(abspath, X_OK)) {
4761
+ // abspath is executable
4762
+ struct stat file_stat;
4763
+ if (stat(abspath, &file_stat)) {
4764
+ rb_sys_fail(abspath);
4765
+ }
4766
+ if (S_ISDIR(file_stat.st_mode)) {
4767
+ errno = EISDIR;
4768
4769
4770
}
4771
rb_sys_fail(abspath);
4772
0 commit comments