NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52724: ntfs driver doen't allow ':' in file names.



On 11/13/2017 5:05, trebol4444%gmx.com@localhost wrote:
In a POSIX environment, all unicode characters except '/' and '\0' must be allowed in file names of a ntfs file system.

The ntfs driver of NetBSD uses ':' for representing ntfs attributes, making impossible to properly read any file with ':' in its name.
How-To-Repeat:
Write a file with ':' in its name using a POSIX OS without this problem, and try to read it in NetBSD with the kernel's ntfs driver.

Which POSIX OS lets you do that? While Windows NT used to have a POSIX subsystem (https://en.wikipedia.org/wiki/Microsoft_POSIX_subsystem), that was discontinued long ago.

While perhaps technically correct that NTFS filenames can contain ":", in practice, the vast majority of files on an NTFS filesystem will have been written by some version of Windows, and the Win32 subsystem does not allow ":" in filenames. Even the replacement for the POSIX subsystem, the Windows Subsystem for Linux, doesn't actually store ":" on disk; if you create a file with a ":" in the name, the actual on-disk name has the ":" escaped as "#003A". So I would say that if you actually have an NTFS filesystem with a file that has ":" in the name, you'd have a lot of trouble reading it on an actual Windows machine.

In Windows, ":" in filenames are used for Alternate Data Streams (https://blogs.technet.microsoft.com/askcore/2013/03/24/alternate-data-streams-in-ntfs/). E.g., you can "echo text > somefile.txt:somestream" and "more < somefile.txt:somestream". And alternate data streams are just another attribute of a file in NTFS. I don't know whether NetBSD's ntfs implementation allows accessing ADSes, but it sounds like it might if it's treating ":"s as special. In which case, I don't think it should be changed to some other character, since that would make it work differently than an actual Windows machine.

Home | Main Index | Thread Index | Old Index