Commit 721c445
authored
Fix invalid parameters in SetFileInformationByHandle (#95235)
* Add failing unit test for SetFileInformationByHandle (#95096)
* Fix invalid parameters in SetFileInformationByHandle (#95096)
According to MS-FSCC, "a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations"
This behavior is incorrect in the scope of .NET, since a call to File.SetLastAccessTime on a open file handle
will cause all future writes to not update the last write tim.
It also triggers STATUS_INVALID_PARAMETER on NFS, since the Windows driver doesn't seem to implement the -1 value (tracking of subsequent write operations)
Fixes #950961 parent 2f991a6 commit 721c445
File tree
2 files changed
+30
-10
lines changed- src/libraries
- System.Private.CoreLib/src/System/IO
- System.Runtime/tests/System.IO.FileSystem.Tests/File
2 files changed
+30
-10
lines changedLines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
94 | 114 | | |
95 | 115 | | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
99 | | - | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
102 | | - | |
| 122 | + | |
103 | 123 | | |
104 | 124 | | |
105 | 125 | | |
| |||
0 commit comments