[Wireshark-bugs] [Bug 15710] extcap: Python scripts are not executed on Windows

2019-04-21 Thread bugzilla-daemon
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15710

--- Comment #4 from Gerrit Code Review  ---
Change 32934 had a related patch set uploaded by Peter Wu:
extcap: skip execution of scripts if a wrapper exists on Windows

https://code.wireshark.org/review/32934

-- 
You are receiving this mail because:
You are watching all bug changes.___
Sent via:Wireshark-bugs mailing list 
Archives:https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
 mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

[Wireshark-bugs] [Bug 15710] extcap: Python scripts are not executed on Windows

2019-04-19 Thread bugzilla-daemon
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15710

--- Comment #3 from Gerrit Code Review  ---
Change 32901 had a related patch set uploaded by Peter Wu:
Add direct support for running Python extcap programs on Windows

https://code.wireshark.org/review/32901

-- 
You are receiving this mail because:
You are watching all bug changes.___
Sent via:Wireshark-bugs mailing list 
Archives:https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
 mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

[Wireshark-bugs] [Bug 15710] extcap: Python scripts are not executed on Windows

2019-04-19 Thread bugzilla-daemon
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15710

--- Comment #2 from Peter Wu  ---
Good point about PATHEXT, let's assume if an extension is present, the
interpreter should be correctly installed.

Here I found "ftype" and "assoc" commands which can be helpful:
https://stackoverflow.com/questions/1934675/how-to-execute-python-scripts-in-windows

Documentation in MSDN is a bit sad, the ASSOCF type points to the wrong page.
The shlwapi.h header does have the definitions though. AssocQueryString docs:
https://docs.microsoft.com/en-us/windows/desktop/api/shlwapi/nf-shlwapi-assocquerystringw

There are two potentially useful types, ASSOCSTR_COMMAND and
ASSOCSTR_EXECUTABLE. For ".py", these expand to respectively:

"C:\Windows\py.exe" "%L" %*
C:\Windows.py.exe

When used with unknown extensions and ASSOCF_NONE, it would expand to
respectively:

C:\Windows\system32\rundll32.exe
C:\Windows\System32\shell32.dll,OpenAs_RunDLL %1
C:\Windows\system32\shell32.dll

Use of ASSOCF_INIT_IGNOREUNKNOWN will make the function fail instead.

When used with .com, .exe, .bat, or .cmd, it will be:

"%1" $*
%1

>From what I have read, the Command string is interpreted by Internet Explorer,
but I have not found canonical documentation from MS. The executable value
seems good enough, it would work for .js, .pl, .py, .pyw, etc.

-- 
You are receiving this mail because:
You are watching all bug changes.___
Sent via:Wireshark-bugs mailing list 
Archives:https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
 mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

[Wireshark-bugs] [Bug 15710] extcap: Python scripts are not executed on Windows

2019-04-19 Thread bugzilla-daemon
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15710

--- Comment #1 from Tomasz Mon  ---
(In reply to Peter Wu from comment #0)
> Use of AssocQueryString to lookup the program associated with an extension
> could work, but I am worried that on systems without Python installed (or a
> different default), it could end up opening a text editor for example. So
> some kind of whitelist would be needed.

If you don't have Python installed or if it's not associated to execute .py
files, then the .py won't appear in PATHEXT.

> In that case, what do you think about special casing Python support? If the
> extension is .py, lookup the Python interpreter (maybe in PATH for
> simplicity?) and use it. This does mean that if the user wants to use Lua,
> Perl or any other scripting language, then they would have to create a
> similar patch for Wireshark to support it out-of-the-box without a batch
> script.

I don't like the special case idea. The PATHEXT exists for a reason, we just
need to use it.

-- 
You are receiving this mail because:
You are watching all bug changes.___
Sent via:Wireshark-bugs mailing list 
Archives:https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
 mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe