mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8317687: (fs) FileStore.supportsFileAttributeView("posix") incorrectly returns 'true' for FAT32 volume on macOS
Reviewed-by: alanb
This commit is contained in:
parent
eb7d972d8a
commit
1a7fd5d419
3 changed files with 35 additions and 6 deletions
|
@ -25,9 +25,10 @@
|
|||
|
||||
package sun.nio.fs;
|
||||
|
||||
import java.nio.file.attribute.FileAttributeView;
|
||||
import java.nio.file.attribute.UserDefinedFileAttributeView;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.attribute.FileAttributeView;
|
||||
import java.nio.file.attribute.PosixFileAttributeView;
|
||||
import java.nio.file.attribute.UserDefinedFileAttributeView;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
|
@ -100,6 +101,10 @@ class BsdFileStore
|
|||
UnixPath dir = new UnixPath(file().getFileSystem(), entry().dir());
|
||||
return isExtendedAttributesEnabled(dir);
|
||||
}
|
||||
// POSIX attributes not supported on FAT32
|
||||
if (type == PosixFileAttributeView.class &&
|
||||
entry().fstype().equals("msdos"))
|
||||
return false;
|
||||
return super.supportsFileAttributeView(type);
|
||||
}
|
||||
|
||||
|
@ -107,6 +112,9 @@ class BsdFileStore
|
|||
public boolean supportsFileAttributeView(String name) {
|
||||
if (name.equals("user"))
|
||||
return supportsFileAttributeView(UserDefinedFileAttributeView.class);
|
||||
// UNIX attributes not supported on FAT32
|
||||
if (name.equals("unix") && entry().fstype().equals("msdos"))
|
||||
return false;
|
||||
return super.supportsFileAttributeView(name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue