mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 14:08:22 +00:00
[USETUP] When opening the target file for dropping readonly mode only use required access.
This avoids the open failing on certain file systems where GENERIC_WRITE access would be denied
for a readonly file.
This is an addendum to 82f44a2
.
CORE-14158
This commit is contained in:
parent
280d7a9775
commit
cc8ccc6eb8
1 changed files with 3 additions and 6 deletions
|
@ -355,9 +355,9 @@ SetupCopyFile(
|
||||||
{
|
{
|
||||||
FILE_BASIC_INFORMATION FileBasicInfo;
|
FILE_BASIC_INFORMATION FileBasicInfo;
|
||||||
|
|
||||||
/* Reattempt to open it */
|
/* Reattempt to open it with limited access */
|
||||||
Status = NtCreateFile(&FileHandleDest,
|
Status = NtCreateFile(&FileHandleDest,
|
||||||
GENERIC_WRITE | SYNCHRONIZE,
|
FILE_WRITE_ATTRIBUTES | SYNCHRONIZE,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -369,10 +369,7 @@ SetupCopyFile(
|
||||||
FILE_SYNCHRONOUS_IO_NONALERT,
|
FILE_SYNCHRONOUS_IO_NONALERT,
|
||||||
NULL,
|
NULL,
|
||||||
0);
|
0);
|
||||||
/* Fail for real if we cannot open it that way
|
/* Fail for real if we cannot open it that way */
|
||||||
* XXX: actually, we should try to refine access rights
|
|
||||||
* to only have write_attributes, should be enough
|
|
||||||
*/
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
|
DPRINT1("NtCreateFile failed: %x, %wZ\n", Status, &FileName);
|
||||||
|
|
Loading…
Reference in a new issue