Give default value of O_NOFOLLOW if it is not defined

Charles Lee littlee at linux.vnet.ibm.com
Wed Jan 11 01:00:03 PST 2012


On 01/04/2012 11:11 PM, Alan Bateman wrote:
> On 04/01/2012 14:44, Charles Lee wrote:
>>
>> I was thinking making the UnixNativeDispatcher.supportsAtSysCalls 
>> consistent. But maybe I am wrong. supportsAtSysCalls should only be 
>> judged by "at" functions....
>> There are some platforms which support "at" functions but do not 
>> support O_NOFOLLOWLINK flag...
>> You are inspiring me that maybe I should also use lstat some where 
>> and fail only when "NOFOLLOW_LINK meets link" :-)
> I don't know if there are platforms that support openat but not 
> O_NOFOLLOW.
>
>> :
>>
>> In the spec NOFOLLOW_LINKS means "Do not follow symbolic links". So 
>> if the platform support lstat, lchown etc, does that mean it support 
>> NOFOLLOW_LINKS? The spec says NOFOLLOW_LINKS like a behavior not a 
>> flag "O_NOFOLLOW".
>> It may be a stupid question, maybe someone has already ask that...
> I don't think the spec mentions O_NOFOLLOW anywhere but when 
> NOFOLLOW_LINKS is specified to a method that opens a file (like 
> Files.newByteChannel) then it adds the O_NOFOLLOW flag so that sym 
> links aren't followed. The lstat andl chown calls are used read the 
> file attributes or setting the file owner and sym links aren't 
> specified. Hopefully it is starting to become clear.
>
> -Alan
>
Hi Alan,

Sorry for the late reply. I found my self on a very long way to get the 
popular machine which is not support O_NOFOLLOW :-)

Please help to review the latest patch. It is at 
http://cr.openjdk.java.net/~littlee/OJDK-226/webrev.01/ 
<http://cr.openjdk.java.net/%7Elittlee/OJDK-226/webrev.01/>

Thank you very much.

-- 
Yours Charles



More information about the nio-dev mailing list