You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On-disk directory named NUL is undeletable: rm -rf resolves the operand to the device and reports false success #1297
A real on-disk directory named NUL can be created but is afterwards undeletable through WinuxCmd: every applet resolves the operand NUL to the DOS device, so rm -rf exits 0 while the directory stays on disk (false success). MSYS rm -rf removes it.
Repro (cmd.exe, from the original audit)
winuxcmd.exe mkdir D:\tmp\pa\NUL :: exits 0, creates a REAL on-disk dir named NUL
winuxcmd.exe rm -rf D:\tmp\pa\NUL :: exits 0 ...
winuxcmd.exe ls D:\tmp\pa\NUL :: shows the NUL *device* (crw-), dir still on disk
mkdir NUL itself mirrors MSYS (also creates the real dir — fine), but afterwards ls/cd/rm -rf all act on the device and rm -rf reports success while the directory persists. Either refuse creation like the device namespace implies, or route removal through \\?\ so the entry is not stranded.
Provenance
Split out of #1283, whose bundled path/name audit listed this as finding 4. It is a defect independent of #1283's title subjects (find crash + D:name resolution, fixed in the winx cluster / PR for #1283). The winx cluster registered it as an observation only and did not independently re-verify it; the repro above is the original report's.
Activity
WIP fix(rm): do not let a device-named on-disk directory vanish from …
TEMP diagnostic: probe Win32 APIs on on-disk NUL directory (#1297)
TEMP diagnostic: use wctest::fail for the dump (framework is not gtes…
TEMP diagnostic v2: run rm.exe on control and NUL dirs, dump IO (#1297)
TEMP diagnostic v3: verbose and non-force rm runs on NUL dir (#1297)
TEMP debug: dump rm operand computation for the NUL path (#1297)
fix(native_path): do not let GetFullPathNameW collapse device-named l…
test(rm): remove TEMP diagnostic probes for #1297
Merge pull request #1392 from unixwin/fix/winx2