GitHub user joemeszaros opened a pull request:

    https://github.com/apache/nifi/pull/95

    NIFI-995: TestGetFile failed in case of NTFS partition in Linux

    I cloned the NiFi source code to local directory on a NTFS partition in 
Linux, and was surprised, when one of the standard test case failed on my box. 
The problem was with the last step of `TestGetFile.testAttributes()`, which 
checks, whether the file permission modification is working.
    
    The original implementation used `Files.setPosixFilePermissions()` method 
to set the file permission, and if no exception was raised 
(`verifyPermissions`), it made this file permission check.
    
    If you have a NTFS partition mounted in Linux, you are unable to change the 
permissions of your files, which is controlled globally with the `fmask` and 
`dmask` mount options. It means, that you are able to run `chmod` commands 
without any error, but it does not have any effect.
    
    From Java perspective, the `Files.setPosixFilePermissions()` was successful 
(no exception), but the file's permissions were not changed, and the last check 
failed.
    
    An extra check is needed and set `verifyPermissions` to true, only if the 
`Files.setPosixFilePermissions()` changed the permissions of `targetPath`.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ImpressTV/nifi NIFI-995

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nifi/pull/95.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #95
    
----
commit 46edb8ce4c6c6f837bb6e7b279d8642f96bbba47
Author: Joe <[email protected]>
Date:   2015-09-24T11:02:11Z

    NIFI-995: Fix for TestGetFile tests (only for NTFS)
    
    TestGetFile.testAttributes() failed in case of a NTFS partition in Linux, 
because Files.setPosixFilePermissions() did not have any effect on the files.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to