Last modified: 2013-10-23 18:17:39 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35885, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33885 - if another convert.exe is on the PATH, the webserver blocks installation
if another convert.exe is on the PATH, the webserver blocks installation
Status: NEW
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.18.x
PC Windows XP
: Low major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-22 20:48 UTC by drorpo
Modified: 2013-10-23 18:17 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description drorpo 2012-01-22 20:48:32 UTC
1) i have a file called convert.exe on my system's PATH.
it's a popular name for an executable in the path. even MS have one.

2) if my convert.exe program is being run, it brings up GUI.

3) Installer.php is running the command "convert.exe -version" to check whether imagemagick is on the path.
$names = array( wfIsWindows() ? 'convert.exe' : 'convert' );


4) my convert.exe was activated, but the GUI is not visible since it's running under apache. 

5) apache/php is waiting forever for the program to execute 
(why php max_execution_time was not in effect? i don't know!)

6) results: 
 a) any browser trying to run the installer hangs forever
 b) several CMD.EXE and CONVERT.EXE processes may be running in the background endlessly.




how to recreate (why? this is pretty obvious) -
rename a GUI program -> convert.exe, put it in the PATH, and run the installer.


how to fix:
ask the user for full path for convert.exe
don't assume "convert.exe -version" belongs just to imagemagick !!!
or any other command line with a common name as "convert", for that matter.
au contraire -- imagemagick on windows doesn't necessarily adds itself to the PATH

thanks
Comment 1 drorpo 2012-01-22 20:49:48 UTC
workaround:
find your convert.exe and rename it during installation.
the installer might find the correct path anyway.
after it's finished, i think it's safe to rename back your own file.
Comment 2 Antoine "hashar" Musso (WMF) 2012-02-01 11:03:58 UTC
The installer detects convert.exe in includes/installer/Installer.php with envCheckGraphics(). That one will look at some common paths and PATH environment paths (with locateExecutableInDefaultPaths()).

One possibility would be to sneak a specific lookup using whatever default path is used ( C:\Program Files\ImageMagick\bin\convert.exe )?

I thought about adding a timeout but wfShellExec() does not support it since it uses PHP pass_thru() internally. PHP exec() does support a timeout option, but that was removed by us with r31044 since it « corrupted white spaces ».
Comment 3 Antoine "hashar" Musso (WMF) 2012-02-01 11:05:43 UTC
Reducing severity to major. This bug does not block development nor crash / destroy any data.
Comment 4 Max Semenik 2012-02-01 11:17:20 UTC
Well, we could read exe's header and determine if it's a console or GUI app:)
Comment 5 Liangent 2012-02-01 12:08:45 UTC
(In reply to comment #4)
> Well, we could read exe's header and determine if it's a console or GUI app:)

A console app can be interactive too.
Comment 6 drorpo 2012-02-01 15:35:55 UTC
i think the simplest solution might be
 
 1) either look for imagemagick folder in the standard directories,
or 
 2) ask the user to provide the path.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links