Re: FilePermission Canonical path optimization

2015-02-09 Thread deven you
It sounds to me like we need additional means to protect the file permission without canocialization. I am looking forward to seeing the new proposal with appropriate solution for problem Peter raised. Thanks a lot! 2015-02-09 14:50 GMT+08:00 Wang Weijun : > > > On Feb 9, 2015, at 14:42, Peter

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
> On Feb 9, 2015, at 14:42, Peter Levart wrote: > > Hi Max, > > Of course you are aware that by trusting the symlinks, you potentially give > much more permission than you would hope to. Suppose that some code has > permission to read and write into a particular directory (for temporary > fi

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
> On Feb 9, 2015, at 13:27, deven you wrote: > > Hi Weijun, > > From my understanding, the new proposal will let implies method only depends > on the absolute path in policy file, correct? So it's user's responsibility > to ensure files who want to access is relative to the absolute path in s

Re: FilePermission Canonical path optimization

2015-02-08 Thread Peter Levart
On 02/09/2015 04:51 AM, Wang Weijun wrote: On Feb 9, 2015, at 11:22, deven you wrote: Hi Weijun, I see JDK-4141872 marked as Not an Issue, is there any further task continue, or there is any link else to track this problem to remove the canonical path? It was marked as Not an Issue, but we

Re: FilePermission Canonical path optimization

2015-02-08 Thread deven you
Hi Weijun, >From my understanding, the new proposal will let implies method only depends on the absolute path in policy file, correct? So it's user's responsibility to ensure files who want to access is relative to the absolute path in some policy file? I personal agree this proposal. Is there an

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
> On Feb 9, 2015, at 11:22, deven you wrote: > > Hi Weijun, > > I see JDK-4141872 marked as Not an Issue, is there any further task continue, > or there is any link else to track this problem to remove the canonical path? It was marked as Not an Issue, but we are reconsidering about it. > >

Re: FilePermission Canonical path optimization

2015-02-08 Thread deven you
Hi Weijun, I see JDK-4141872 marked as Not an Issue, is there any further task continue, or there is any link else to track this problem to remove the canonical path? It's a big improvement if canonical path can be totally removed but I can't fig

Re: FilePermission Canonical path optimization

2015-02-06 Thread Wang Weijun
Hi Deven Sorry for the noise, but in fact we are looking into removing the canonicalization step because of 4141872: FilePermission makes symlinks useless https://bugs.openjdk.java.net/browse/JDK-4141872 This will be a very big incompatible change and we are still doing a feasibility study.

Re: FilePermission Canonical path optimization

2015-02-05 Thread deven you
Hi All, I have updated the patch[1] according to above discussion. Please review it. Thanks a lot [1] http://cr.openjdk.java.net/~youdwei/ojdk-912/webrev.03/ 2015-02-03 16:04 GMT+08:00 Peter Levart : > Hi Deven, > > > On 02/03/2015 08:42 AM, deven you wrote: > >> Hi Sean, >> >> The performanc

Re: FilePermission Canonical path optimization

2015-02-03 Thread Peter Levart
Hi Deven, On 02/03/2015 08:42 AM, deven you wrote: Hi Sean, The performance degradation was reported by creating an object with always getting its canonical path and there is no degradation heard after we made the lazy load patch for the canonical path. I have asked related people to give me

Re: FilePermission Canonical path optimization

2015-02-02 Thread deven you
Hi Sean, The performance degradation was reported by creating an object with always getting its canonical path and there is no degradation heard after we made the lazy load patch for the canonical path. I have asked related people to give me an env to create this problem so that I can take a clo

Re: FilePermission Canonical path optimization

2014-12-18 Thread Peter Levart
On 12/17/2014 07:36 PM, Sean Mullan wrote: On 12/05/2014 08:00 AM, Peter Levart wrote: The question is what to do with the remaining data race that was present before. The 'mask' field. The best would be to make it final, but deserialization needs to set it. I don't see the pre-existing race c

Re: FilePermission Canonical path optimization

2014-12-17 Thread Sean Mullan
On 12/05/2014 08:00 AM, Peter Levart wrote: The question is what to do with the remaining data race that was present before. The 'mask' field. The best would be to make it final, but deserialization needs to set it. I don't see the pre-existing race condition on the mask field, but I'm probabl

Re: FilePermission Canonical path optimization

2014-12-17 Thread Sean Mullan
Hi, Can you elaborate more on the performance degradation that you are seeing at startup? Are you seeing this when you are running with or without a SecurityManager? If without a SecurityManager, can you provide some code paths/examples? As far as I can see, with the proposed fix you are movi

Re: FilePermission Canonical path optimization

2014-12-05 Thread Peter Levart
Hi Deven, Similar to lazy initialization of initial list of drivers in java.sql.DriverManager that was done recently: http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-December/029944.html It would be nice to replace the following pattern: if (cpath == null) initCannonicalpath(); ..

Re: FilePermission Canonical path optimization

2014-12-04 Thread deven you
Hi All, I have updated the patch[3] to reflect all of your suggestions. [3] http://cr.openjdk.java.net/~youdwei/ojdk-912/webrev.02/ Thanks a lot! 2014-12-05 10:39 GMT+08:00 deven you : > Hi Alan, > > I am not clear whether canonicalization cache enabled or disabled, however > I think even the

Re: FilePermission Canonical path optimization

2014-12-04 Thread deven you
Hi Bernd, I will update the patch for the underscores. As to security manager I think in most cases, FilePermission is used with it together. >From the spec: Absolute path:is complete in that no other information is required in order to locate the file that it denotes Canonical Path: is bo

Re: FilePermission Canonical path optimization

2014-12-04 Thread deven you
Hi Weijun, The original init() methods invoked by FilePermission constructors and readObject() for deserialization. The constructors will be invoked only once for each FilePermission Object and the ObjectInputStream will create new FilePermission for each deserialization so the old init() is fine

Re: FilePermission Canonical path optimization

2014-12-04 Thread deven you
Hi Alan, I am not clear whether canonicalization cache enabled or disabled, however I think even the cache is enable, it may not help much for the start up stage especially if the app uses many different files. The cache should speed up applications for common case especially after start up and t

Re: FilePermission Canonical path optimization

2014-12-01 Thread Alan Bateman
On 01/12/2014 08:06, deven you wrote: Hi All, File.getCanonicalPath() is a very time-consuming method, we observed significant performance degradation from some application's startup stage with java.io.FilePermission. However, lazying load the calls to getCanonicalPath() from java.ioFilePermiss

Re: FilePermission Canonical path optimization

2014-12-01 Thread Bernd
Hello, I thik the underscores in method and field do not match very the other names in that file (or the JCL). If I understand right, this is an optimization for the case a security manager is not present? For the other case, maybe having absolute but not canonical file names is an option? Or may

Re: FilePermission Canonical path optimization

2014-12-01 Thread Wang Weijun
Do you need some kind of synchronization on the get_dir_rec() method? --Max > On Dec 1, 2014, at 16:06, deven you wrote: > > Hi All, > File.getCanonicalPath() is a very time-consuming method, we observed > significant performance degradation from some application's startup stage > with java.io.

FilePermission Canonical path optimization

2014-12-01 Thread deven you
Hi All, File.getCanonicalPath() is a very time-consuming method, we observed significant performance degradation from some application's startup stage with java.io.FilePermission. However, lazying load the calls to getCanonicalPath() from java.ioFilePermission is straightforward and solve this pro