Rahul Kumar
Rahul Kumar

Reputation: 59

permission set in UNIX folder are not transmitted correctly to NFS share

we have a NFS share where folder in unix are mounted over a NFS windows server. even after setting the permission to 775 on unix machine for some folder. The same does not reflect when files are created in that folder by some java process.

so we have a folder like /nobackup/stream on unix machine mounted on nfs server

permission on unix machine ls -ald /nobackup/stream rwxrwxr-x owner group

we have an automation process writing result logs and sub directories to stream folder for some weird reason the files are getting created with permission

rwxr-xr-x owner group

i.e write access to group is not present.

This is causing our automation to fail when at certain places a process running with group user privilege tries to update the files created with above permission

Initially the suspect was umask

so we set umask to 0002 in the perl process which starts automation that did not help

Files.mkdir is being used to write the file

here the posix permission is correct ,umask is correct still the new files are not getting created with correct permission

also note that automation runs under cygwin shell if thats causing the trouble

How can I ensure that file permission is always set correctly

Upvotes: 1

Views: 2234

Answers (1)

Mike Andrews
Mike Andrews

Reputation: 3206

The problem is that the automation is running in cygwin. Those files are still written by the Windows NFS client, which has no clue how to interpret the permissions set in cygwin.

You need to set the default permissions in the Windows NFS client. You can do this from the command line with nfsadmin. Something like:

nfsadmin client [ComputerName] fileaccess=664

Source: https://technet.microsoft.com/en-us/library/cc754304(v=ws.11).aspx

Upvotes: 1

Related Questions