xadisk
  1. xadisk
  2. XADISK-157

InsufficientPermissionOnFileException sometimes missing [READ_DIRECTORY]

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: filesystem
    • Labels:
      None
    • Environment:

      Open JDK 1.6 and 1.7, Windows 7 and Linux (RedHat and Ubuntu)

      Description

      I often get InsufficientPermissionOnFileException on files where the real permissions in the file-system do not show any missing permissions.
      I ignore the error and consider the file non-readable with the following code:

      try {
      Session session = getSession();
      File file = getFile();
      return session.fileExists(file) && !session.fileExistsAndIsDirectory(file);
      } catch (final Exception e) {
      Warden.disregardAndReport(e);
      return false;
      }

      I am wondering what the causes may be for this issue.

      I have seen this happen in the following circumstances:

      • Checking existence of a directory the parent directory of which doesn't exist either (in code which creates neccessary parent directories as needed).
      • Checking existence of hard-linked files (here the cause is less clear).

      Stacktrace Fragment:

      org.xadisk.filesystem.exceptions.InsufficientPermissionOnFileException: Permission of type [READ_DIRECTORY] is needed over the file/directory with path [/var/lib/preprocessor/configversions/20131206T185427.534Z/sequences] for the i/o operation to succeed.
      at org.xadisk.filesystem.NativeSession.checkPermission(NativeSession.java:1157)
      at org.xadisk.filesystem.NativeSession.fileExists(NativeSession.java:407)
      at org.xadisk.filesystem.NativeSession.fileExists(NativeSession.java:391)

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Nitin Verma
            Reporter:
            gunnar_zarncke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: