we have a dfs server where the results of automation run are stored. for some weird reason of late the permissions of different folder created by same process and same user have started varying.
the directory is created using Files mkdir .to ensure same permission I tried to set permission using setfacl .
setfacl is working fine when i run this from unix machine on dfs server directories however I need this to be working from java process running on windows os.
from cygwin the setfacl works fine as well.
however when ran through Java it is not able to set the permission
here is the difference when ran from cygwin and java process
CygWin
setfacl.exe --set user::---,group::rwx,other::--x acl.txt
output:-----rwx--x 1 user group 0 Nov 18 21:43 acl.txt
correct
Java
String commandLine ="C:/tools/cygwin/bin/setfacl.exe --set user::--
-,group::rwx,other::--x" +" " + dir.getAbsolutePath();
List<String> commandList = Arrays.asList(commandLine.split(" "));
ProcessBuilder processBuilderCommand = new ProcessBuilder(commandList);
Process process = processBuilderCommand.start();
process.waitFor();
output:-
drwxrwx---+ 1 useradmin group 0 Nov 18 21:52 acl
incorrect
Notice the difference in user got changed to administrator not sure if thats the reason for discrepancy
the trouble is java is not setting the permission which I am trying to set from the processbuilder using setfacl
getfacl has different outputs for java and shell.
java:- (incorrect)
$ getfacl acl
# file: acl
# owner: Administrators
# group: group
user::rwx
group::---
group:Authenticated Users:rwx
group:SYSTEM:rwx
group:Users:r-x
mask:rwx
other:---
default:user::rwx
default:group::---
default:group:Authenticated Users:rwx
default:group:SYSTEM:rwx
default:group:Users:r-x
default:mask:rwx
default:other:---
Cygwin
$ getfacl acl
# file: acl
# owner: Administrators
# group: group
user::---
group::rwx
other:--x