https://bugs.winehq.org/show_bug.cgi?id=48266
Bug ID: 48266 Summary: Regression with redirecting stdout from native app Product: Wine Version: unspecified Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: eb1+wine@sil.org Distribution: ---
Created attachment 65932 --> https://bugs.winehq.org/attachment.cgi?id=65932 demo program
A Windows program calls a native Linux command and redirects stdout so that it can process the output. This used to work in older Wine versions, e.g. 1.6.2 but is not working in newer versions.
It seems that instead of writing to a pipe (that the Windows program could read) the output goes directly to Wine's stdout.
Use case: a Wine-aware program can use Linux commands to check if the data is stored on an encrypted drive/folder.
The attached program demonstrates the problem. When passing "1" as parameter it will call "/bin/ls -al", and redirect and read the output. When running with newer Wine versions it can clearly be seen that the program reads 0 bytes from the pipe.
When passing "2" as parameter it calls the Windows command "dir" and redirects and reads the output. This works correctly.
The demo executable and the source code is available at https://gist.github.com/ermshiperete/8de3905d364cee362a90cacc03e7c358.
A second Windows program, available at https://gist.github.com/ermshiperete/1e4cb1bc32e5175c369ec3d0d594cef8, can be used in `git bisect`. It executes "/bin/uname" and compares the redirected output with "Linux". Exit code is 0 if the program read "Linux", otherwise 1.