summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib/wcstold.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-07 07:14:58 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-11-16 19:34:53 -0800
commit36c9f25d9c8d6061213d229c7274025c49538380 (patch)
tree1bb1274f2f3edb07ef3fae2798881db4786c759c /newlib/libc/stdlib/wcstold.c
parent515616d259089315f440ce5d80f201da4819ee1d (diff)
downloadcygnal-36c9f25d9c8d6061213d229c7274025c49538380.tar.gz
cygnal-36c9f25d9c8d6061213d229c7274025c49538380.tar.bz2
cygnal-36c9f25d9c8d6061213d229c7274025c49538380.zip
More secure way of obtaining command interpreter.
Instead of relying on the COMSPEC environment variable, what we can do is assume that the program is called "cmd.exe", and then look for it in the directory reported by the GetSystemDirectoryA Win32 function in kernel32.dll. * winsup/cygwin/path.h (get_cmd_exe_path): New function declared. * winsup/cygwin/spawn.cc (av::setup): Use get_cmd_exe_path instead of getenv("COMSPEC"). (cmd_exe_path): New static variable. (init_cmd_exe_path): New static function. (get_cmd_exe_path): New function. * winsup/cygwin/syscalls.cc (system, getusershell, popen): Use get_cmd_exe_path instead of getenv("COMSPEC").
Diffstat (limited to 'newlib/libc/stdlib/wcstold.c')
0 files changed, 0 insertions, 0 deletions