Bug #50271 [Asn->Csd]: Windows hard coding of CMD / COMMAND.COM rather than envvar(COMSPEC)

From: Date: Tue, 13 Sep 2016 23:50:27 +0000
Subject: Bug #50271 [Asn->Csd]: Windows hard coding of CMD / COMMAND.COM rather than envvar(COMSPEC)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204013@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=50271&edit=1

 ID:                 50271
 Updated by:         ab@php.net
 Reported by:        RQuadling at GMail dot com
 Summary:            Windows hard coding of CMD / COMMAND.COM rather than
                     envvar(COMSPEC)
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            Program Execution
 Operating System:   win32 only - Windows XP SP3
 PHP Version:        5.3SVN-2009-11-23 (SVN)
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

This is fixed at least in PHP 7, didn't check earlier.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2010-03-26 14:35:39] rquadling@php.net

The following patch has been added/updated:

Patch Name: proc_open_COMSPEC.patch
Revision:   1269610539
URL:        http://bugs.php.net/patch-display.php?bug=50271&patch=proc_open_COMSPEC.patch&revision=1269610539

------------------------------------------------------------------------
[2010-03-26 14:05:26] rquadling@php.net

The following patch has been added/updated:

Patch Name: TSRM_Win32_COMSPEC.patch
Revision:   1269608726
URL:        http://bugs.php.net/patch-display.php?bug=50271&patch=TSRM_Win32_COMSPEC.patch&revision=1269608726

------------------------------------------------------------------------
[2009-11-23 13:31:13] jani@php.net

FYI: In the future when a bug is clearly windows only, use os prefix 'win32 only -' to
preserve my sanity..

------------------------------------------------------------------------
[2009-11-23 13:15:31] RQuadling at GMail dot com

Description:
------------
In http://lxr.php.net/source/TSRM/tsrm_win32.c#52,
the shell to execute is hardcoded.

This should be retrieved via GetEnvironmentVariable('COMSPEC', ...);

As such, any program called cmd.exe (or command.com for older, and now unsupported by PHP, versions
of windows) in a directory accessible via the PATH _before_ the actual location of
cmd.exe/command.com will be loaded for the shell.

The environment variable "COMSPEC" (now known as "ComSpec", but is case
insensitive for Windows) by default includes the path.

Whilst this is not a series bug, it does mean PHP conforms to other languages and applications that
can invoke a console shell via COMSPEC, rather than using a hard-coded name.


Considering that PHP doesn't support older versions of windows any longer, the whole test on
GetVersion() is also redundant.







------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=50271&edit=1


Thread (6 messages)

« previous php.bugs (#204013) next »