2

I have an AIX 7.2 machine. I am trying to run a Java program on it. It gives me this error: NOFOLLOW_LINKS is not supported on this platform. It is because I am using this call in the program:

Files.setAttribute(path, "unix:uid", entityMd.getUid(), LinkOption.NOFOLLOW_LINKS);

Files is coming from nio library:

import java.nio.file.Files;
import java.nio.file.LinkOption;

So, is it not there by design? I tried to play around and created symlinks in aix as well as linux machine like this:

ln -s a b

On Linux:

When I did stat b, it gave me this output:

File: ‘b’ -> ‘a’
  Size: 1           Blocks: 0          IO Block: 4096   symbolic link
Device: 801h/2049d  Inode: 10880702    Links: 1
Access: (0777/lrwxrwxrwx)  Uid: ( 1000/ankitshubham)   Gid: ( 1000/ankitshubham)
Access: 2019-03-05 17:38:38.812875999 +0530
Modify: 2019-03-05 17:38:35.820875999 +0530
Change: 2019-03-05 17:38:35.820875999 +0530
 Birth: -

On doing a touch on either of a or b, it showed that only stat of a changed.

On AIX

When I did istat b, it gave me this output:

Inode 82949 on device 10/8      File
Protection: rw-r--r--   
Owner: 0(root)          Group: 0(system)
Link count:   1         Length 0 bytes

Last updated:   Tue Mar  5 04:31:57 CST 2019
Last modified:  Tue Mar  5 04:31:57 CST 2019
Last accessed:  Tue Mar  5 04:31:57 CST 2019

Note that it shows File as the type and not something like Symlink.

Also, on doing a touch on either of a or b, it showed that stats of both a and b changed. This made me think that maybe there is nothing like NOFOLLOW_LINKS in AIX by design and that it is not a shortcoming of JAVA that it is not able to support NOFOLLOW_LINKS on AIX. Am I correct?

  • 1
    That's not because AIX isn't supporting symlinks, but because it's not supporting the O_NOFOLLOW flag of open(2) and java decides to give up (though the AT_SYMLINK_NOFOLLOW flag of fchownat(2) is supported, and it could probably use that instead). Unfortunately I don't have an AIX system here, so I cannot help you further. – Uncle Billy Mar 5 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.