[Bug 43240] New: Java 8 believes the filesystem is read-only

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jun 25 15:45:08 CDT 2017


https://bugs.winehq.org/show_bug.cgi?id=43240

            Bug ID: 43240
           Summary: Java 8 believes the filesystem is read-only
           Product: Wine
           Version: 2.10
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: kernel32
          Assignee: wine-bugs at winehq.org
          Reporter: taho at dnsdeer.com
      Distribution: ---

Created attachment 58546
  --> https://bugs.winehq.org/attachment.cgi?id=58546
A Java sample program

Symptom:
Calls to java.nio.file.Files.isWritable() always return false, even though the
specified file is very definitely writable – the same Java program running
under Linux correctly returns true for the same file.

Software versions:
Arch Linux (x86-64)
Wine 2.10
Java 1.8.0_131-b11

Cause:
Files.isWritable ends up calling
sun.nio.fs.WindowsFileSystemProvider.checkAccess, which via
WindowsFileStore.create calls the WindowsFileStore constructor. In those
WindowsFileStore methods, the Win32 API function GetVolumePathName is called
and its result passed to GetVolumeInformation – which is where the bug is.

In my case, I'm passing in the filename "Z:\tmp\winebugtest\winebugtest.java",
where Z: is the Linux root directory. Because /tmp is a separate filesystem,
the call to GetVolumePathName returns "Z:\tmp\". So far so good. But when this
is passed to GetVolumeInformation, it figures there are too many backslashes
and returns an error. This results in a Java IOException which ends up causing
isWritable to return false.

If I create a T: drive pointing to /tmp (through winecfg) everything works
correctly – GetVolumePathName resolves "T:\winebugtest\winebugtest.java" to
"T:\", GetVolumeInformation is happy and Java gets the correct result.

The Wine implementation of GetVolumeInformation in kernel32/volume.c has the
comment "there must be exactly one backslash in the name, at the end". 

Microsoft's documentation, I think, disagrees:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx

I have attached the relevant portions of the logs (from WINEDEBUG='+relay') and
a sample program.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list