summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/include/paths.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-07 06:51:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-07-07 06:51:05 -0700
commita10a8241f40f24d965e6fdd866d1ee07da4cb4f0 (patch)
treeee2aa4780b1508c7ea599a2d37ec628e95a381d1 /winsup/cygwin/include/paths.h
parent1e0f183f2146d0be7802db02a85e15cb84f20aca (diff)
downloadcygnal-a10a8241f40f24d965e6fdd866d1ee07da4cb4f0.tar.gz
cygnal-a10a8241f40f24d965e6fdd866d1ee07da4cb4f0.tar.bz2
cygnal-a10a8241f40f24d965e6fdd866d1ee07da4cb4f0.zip
Use COMSPEC env var, not hard-coded CMD.EXE path.
It is with some reluctance I make this change, due to the security implications of relying on environment variables. But we can't have a hard-coded path. * winsup/cygwin/include/paths.h (_PATH_CMDEXE): Macro removed. * winsup/cygwin/spawn.cc (av::setup): Use COMSPEC environment variable instead of hard-coded path. If missing, bail with errno set to EOPNOTSUPP. * winsup/cygwin/syscalls.cc (system): Use COMSPEC environment variable. If missing, return -1. (getusershell): Eliminate static array of shell names. If shell_index is zero, return value of COMSPEC env var, if it exists, and increment shell_index to 1. (popen): Use COMSPEC and if that is missing, set errno to EOPNOTSUPP and return NULL.
Diffstat (limited to 'winsup/cygwin/include/paths.h')
-rw-r--r--winsup/cygwin/include/paths.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/winsup/cygwin/include/paths.h b/winsup/cygwin/include/paths.h
index cf25056d8..8dc9594fc 100644
--- a/winsup/cygwin/include/paths.h
+++ b/winsup/cygwin/include/paths.h
@@ -29,5 +29,4 @@ details. */
#define _PATH_VARTMP "/var/tmp/"
#define _PATH_VI "/bin/vi"
#define _PATH_WTMP "/var/log/wtmp"
-#define _PATH_CMDEXE "C:/Windows/System32/cmd.exe"
#endif /* _PATHS_H_ */