Bug 14282 – executeShell should use sh and ignore the SHELL env variable

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2015-03-13T20:23:00Z
Last change time
2017-07-19T17:42:33Z
Keywords
pull
Assigned to
nobody
Creator
code
See also
https://issues.dlang.org/show_bug.cgi?id=15000

Comments

Comment #0 by code — 2015-03-13T20:23:41Z
It should call the sh binary to run on a POSIX compatible shell. The SHELL env variable can be set to whatever the caller of a tool uses, e.g. fish or zsh. http://linux.die.net/man/3/system http://pubs.opengroup.org/onlinepubs/009695399/functions/system.html
Comment #1 by code — 2015-03-13T20:29:19Z
Quote from http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html > One reviewer suggested that an implementation of system() might want to use an environment variable such as SHELL to determine which command interpreter to use. The supposed implementation would use the default command interpreter if the one specified by the environment variable was not available. This would allow a user, when using an application that prompts for command lines to be processed using system(), to specify a different command interpreter. Such an implementation is discouraged. If the alternate command interpreter did not follow the command line syntax specified in the Shell and Utilities volume of POSIX.1-2008, then changing SHELL would render system() non-conforming. This would affect applications that expected the specified behavior from system(), and since the Shell and Utilities volume of POSIX.1-2008 does not mention that SHELL affects system(), the application would not know that it needed to unset SHELL.
Comment #2 by code — 2015-03-13T20:34:51Z
Comment #3 by github-bugzilla — 2015-04-04T04:33:45Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a524a3571b18e440c4dd751fcf4e2d00b834fb22 fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable https://github.com/D-Programming-Language/phobos/commit/865f36fccea8c0d95e31624aea22902def150fa1 Merge pull request #3051 from MartinNowak/fix14282 fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable
Comment #4 by github-bugzilla — 2015-08-08T01:14:41Z
Comment #5 by github-bugzilla — 2015-08-10T08:31:47Z
Comment #6 by github-bugzilla — 2015-09-03T18:39:31Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5b2b1fb59450cfc32ecec3252f543a9f6f34c2a4 Revert "fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable" This reverts commit a524a3571b18e440c4dd751fcf4e2d00b834fb22.
Comment #7 by hsteoh — 2015-09-04T00:53:12Z
Comment #8 by github-bugzilla — 2015-10-04T18:20:46Z
Commit pushed to stable at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5b2b1fb59450cfc32ecec3252f543a9f6f34c2a4 Revert "fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable"
Comment #9 by markisaa — 2015-11-02T20:33:54Z
We really should have a means of specifying what shell we'd like to use at the call site. The fix for this issue ended up breaking some of my code without providing a nice path back to correctness (I'll write a fix up in a sec, it's just going to be more work than I expected). Put in an enhancement request along these lines: https://issues.dlang.org/show_bug.cgi?id=15276
Comment #10 by dlang-bugzilla — 2017-07-05T15:50:48Z
*** Issue 10580 has been marked as a duplicate of this issue. ***
Comment #11 by github-bugzilla — 2017-07-19T17:42:33Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a524a3571b18e440c4dd751fcf4e2d00b834fb22 fix Issue 14282 - executeShell should use sh and ignore the SHELL env variable https://github.com/dlang/phobos/commit/865f36fccea8c0d95e31624aea22902def150fa1 Merge pull request #3051 from MartinNowak/fix14282