1

I try to read a file from an NFS share that has been created by another user. The file's group permission though is set to a group which the executing user in a member of. Nevertheless I get a FileAccessExcpetion: Operation not permitted.

The access right of the file are:

-rw-rw---- 1 nobody data 544648 27. Dez 10:54 sample.pdf

The executing user is in group data:

id myuser
uid=35103(myuser) gid=35103(myuser) Gruppen=35103(myuser),55092(data),1408(othergroup)

When executing the java code

Files.newInputStream("/..../sample.pdf");

I get

java.nio.file.FileSystemException: /...../sample.pdf: Operation not permitted
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
schoenk
  • 824
  • 3
  • 13
  • 31
  • Does the output of Files.isReadable() evaluate to true when you give it the path to the file you're trying to open? That will determine if the JVM process can truly read the file. – Rob Lockwood-Blake Jan 11 '17 at 12:36
  • Does it work on the root volume and NOT the NFS share? When you connect to NFS there are permissions that override everything. – Johnny V Jan 11 '17 at 16:02

0 Answers0