Sebastian Lackner : cmd: Fix sharing permissions of piped output files.
Alexandre Julliard
julliard at wine.codeweavers.com
Sat Jan 9 03:32:17 CST 2016
Module: wine
Branch: master
Commit: c634f34aae0d35d3fe9a687abd86e8c0832b7d17
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c634f34aae0d35d3fe9a687abd86e8c0832b7d17
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Thu Jan 7 08:01:38 2016 +0100
cmd: Fix sharing permissions of piped output files.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/cmd/tests/test_builtins.cmd.exp | 2 +-
programs/cmd/wcmdmain.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 811ba9f..7543b53 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -1207,7 +1207,7 @@ passed
--- a batch file can delete itself
file correctly deleted
--- a batch file can alter itself
- at todo_wine@bar
+bar
---------- Testing copy
Passed: Found expected dummy.file
Passed: Found expected dir1\file1
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index bf988f5..de92e0a 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1364,7 +1364,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
if (cmdList && (*cmdList)->pipeFile[0] != 0x00) {
WINE_TRACE("Input coming from %s\n", wine_dbgstr_w((*cmdList)->pipeFile));
h = CreateFileW((*cmdList)->pipeFile, GENERIC_READ,
- FILE_SHARE_READ, &sa, OPEN_EXISTING,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, &sa, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (h == INVALID_HANDLE_VALUE) {
WCMD_print_error ();
@@ -1425,8 +1425,8 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
} else {
WCHAR *param = WCMD_parameter(p, 0, NULL, FALSE, FALSE);
- h = CreateFileW(param, GENERIC_WRITE, 0, &sa, creationDisposition,
- FILE_ATTRIBUTE_NORMAL, NULL);
+ h = CreateFileW(param, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_DELETE,
+ &sa, creationDisposition, FILE_ATTRIBUTE_NORMAL, NULL);
if (h == INVALID_HANDLE_VALUE) {
WCMD_print_error ();
heap_free(cmd);
More information about the wine-cvs
mailing list