Skip to content

Commit d3d5d40

Browse files
lazkajeremyd2019
authored andcommitted
popen: call /usr/bin/sh instead of /bin/sh
We mount /usr/bin to /bin, but in a chroot this is broken and we have no /bin, so try to use the real path. chroot is used by pacman to run install scripts when called with --root and this broke programs in install scripts calling popen() (install-info from texinfo for example) There are more paths hardcoded to /bin in cygwin which might also be broken in this scenario, so this maybe should be extended to all of them.
1 parent 2683e34 commit d3d5d40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

winsup/cygwin/syscalls.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4534,7 +4534,7 @@ popen (const char *command, const char *in_type)
45344534
fcntl (stdchild, F_SETFD, stdchild_state | FD_CLOEXEC);
45354535

45364536
/* Start a shell process to run the given command without forking. */
4537-
pid_t pid = ch_spawn.worker ("/bin/sh", argv, environ, _P_NOWAIT,
4537+
pid_t pid = ch_spawn.worker ("/usr/bin/sh", argv, environ, _P_NOWAIT,
45384538
__std[0], __std[1]);
45394539

45404540
/* Reinstate the close-on-exec state */

0 commit comments

Comments
 (0)