[PATCH] Cygwin: Fix access to block devices below /proc/sys.
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Dec 1 19:36:58 GMT 2020
On Dec 1 19:48, Christian Franke wrote:
> Corinna Vinschen wrote:
> > On Dec 1 16:59, Christian Franke wrote:
> > > Corinna Vinschen wrote:
> > > > \Device\Mup is a character device and thus the devices below are not
> > > > accessible for directory enumeration. I assume it's the same for DFS.
> > > Here I see \Device\Mup as a block device on two systems (cygwin1.dll 3.1.7):
> > >
> > > $ ls -l /proc/sys/Device/Mup
> > > brwxrwx--x 1 Administrators SYSTEM 0, 250 Dec 1 16:50 /proc/sys/Device/Mup
> > Huh?
> >
> > $ ls -l /proc/sys/Device/Mup
> > crwxrwx--x 1 Administrators SYSTEM 0, 250 Dec 1 17:04 /proc/sys/Device/Mup
> >
> > This is what I'd expect. Can you debug why this is a block device
> > on your systems?
> >
>
> NtQueryVolumeInformationFile() returns {DeviceType = 0x14, Characteristics =
> 0x20010}
>
> fhandler_procsys::exists(...):
> ...
> status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, &attr, &io,
> FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT);
> ...
> if (NT_SUCCESS (status))
> {
> FILE_FS_DEVICE_INFORMATION ffdi;
> ...
> /* Check for the device type. */
> status = NtQueryVolumeInformationFile (h, &io, &ffdi, sizeof ffdi,
> FileFsDeviceInformation);
> ...
> if (NT_SUCCESS (status))
> {
> if (ffdi.DeviceType == FILE_DEVICE_NETWORK_FILE_SYSTEM)
> file_type = virt_blk; <<===============
> ...
Uh... ok, that's what had changed with commit 80e35a211f69 as of
this morning :}
Corinna
More information about the Cygwin-patches
mailing list