Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
73d0bb77
Commit
73d0bb77
authored
Jun 25, 2021
by
Qian Hong
Committed by
Alexandre Julliard
Jun 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Forbid deleting files with an open mapping.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
73161220
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
file.c
dlls/ntdll/tests/file.c
+4
-4
fd.c
server/fd.c
+11
-0
No files found.
dlls/ntdll/tests/file.c
View file @
73d0bb77
...
...
@@ -3329,14 +3329,14 @@ todo_wine
fdi
.
DoDeleteFile
=
TRUE
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
&
fdi
,
sizeof
(
fdi
),
FileDispositionInformation
);
todo_wine
ok
(
res
==
STATUS_CANNOT_DELETE
,
"got %#x
\n
"
,
res
);
ok
(
res
==
STATUS_CANNOT_DELETE
,
"got %#x
\n
"
,
res
);
res
=
GetFileAttributesA
(
buffer
);
ok
(
res
!=
INVALID_FILE_ATTRIBUTES
,
"expected file to exist
\n
"
);
CloseHandle
(
mapping
);
CloseHandle
(
handle
);
res
=
DeleteFileA
(
buffer
);
todo_wine
ok
(
res
,
"got error %u
\n
"
,
GetLastError
()
);
ok
(
res
,
"got error %u
\n
"
,
GetLastError
()
);
GetTempFileNameA
(
tmp_path
,
"dis"
,
0
,
buffer
);
handle
=
CreateFileA
(
buffer
,
GENERIC_READ
|
GENERIC_WRITE
|
DELETE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
...
...
@@ -3373,14 +3373,14 @@ todo_wine
fdi
.
DoDeleteFile
=
TRUE
;
res
=
pNtSetInformationFile
(
handle
,
&
io
,
&
fdi
,
sizeof
(
fdi
),
FileDispositionInformation
);
todo_wine
ok
(
res
==
STATUS_CANNOT_DELETE
,
"got %#x
\n
"
,
res
);
ok
(
res
==
STATUS_CANNOT_DELETE
,
"got %#x
\n
"
,
res
);
res
=
GetFileAttributesA
(
buffer
);
ok
(
res
!=
INVALID_FILE_ATTRIBUTES
,
"expected file to exist
\n
"
);
UnmapViewOfFile
(
view
);
CloseHandle
(
handle
);
res
=
DeleteFileA
(
buffer
);
todo_wine
ok
(
res
,
"got error %u
\n
"
,
GetLastError
()
);
ok
(
res
,
"got error %u
\n
"
,
GetLastError
()
);
GetTempFileNameA
(
tmp_path
,
"dis"
,
0
,
buffer
);
handle
=
CreateFileA
(
buffer
,
GENERIC_READ
|
GENERIC_WRITE
|
DELETE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
0
);
...
...
server/fd.c
View file @
73d0bb77
...
...
@@ -2452,6 +2452,17 @@ static void set_fd_disposition( struct fd *fd, int unlink )
if
(
unlink
)
{
struct
fd
*
fd_ptr
;
LIST_FOR_EACH_ENTRY
(
fd_ptr
,
&
fd
->
inode
->
open
,
struct
fd
,
inode_entry
)
{
if
(
fd_ptr
->
access
&
FILE_MAPPING_ACCESS
)
{
set_error
(
STATUS_CANNOT_DELETE
);
return
;
}
}
if
(
fstat
(
fd
->
unix_fd
,
&
st
)
==
-
1
)
{
file_set_error
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment