Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.security.AccessControlException: access denied ("java.io.FilePermission" "/etc/os-release" "read") #10017

Closed
asalamon74 opened this issue Feb 11, 2020 · 1 comment · Fixed by #10018
Milestone

Comments

@asalamon74
Copy link

Expected behavior

Netty 4.1.39 added #9411 where netty checks for the /etc/os-release file. It's not a problem if this file is missing, but netty gives an error if we don't have right to read this file. I think it should be treated the same.

Actual behavior

[junit4]    > Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/etc/os-release" "read")                                                                                                                                                                                                                                      
   [junit4]    >        at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)                                                                                                                                                                                                                                                   
   [junit4]    >        at java.base/java.security.AccessController.checkPermission(AccessController.java:897)
   [junit4]    >        at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322)
   [junit4]    >        at java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:661)
   [junit4]    >        at java.base/java.io.File.exists(File.java:817)                                                                                                                                                                                                                                                                                                  
   [junit4]    >        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:225)

Steps to reproduce

Bump netty version in lucene-solr and run unit tests (e. g. org.apache.solr.core.HdfsDirectoryFactoryTest)

Netty version

4.1.39 - 4.1.45

JVM version (e.g. java -version)

openjdk version "11.0.2" 2019-01-15

OS version (e.g. uname -a)

MacOS 10.14 (Darwin Kernel Version 18.0.0)

normanmaurer added a commit that referenced this issue Feb 11, 2020
…mission" "/etc/os-release" "read")

Motivation:

Modifications:

- Wrap the code and execute with an AccessController
- Ignore SecurityException (by just logging it)
- Add some more debug logging

Result:

Fixes #10017
@normanmaurer
Copy link
Member

@asalamon74 PTAL #10018

normanmaurer added a commit that referenced this issue Feb 12, 2020
…mission" "/etc/os-release" "read")

Motivation:

Modifications:

- Wrap the code and execute with an AccessController
- Ignore SecurityException (by just logging it)
- Add some more debug logging

Result:

Fixes #10017
normanmaurer added a commit that referenced this issue Feb 13, 2020
…mission" "/etc/os-release" "read") (#10018)

Motivation:

Modifications:

- Wrap the code and execute with an AccessController
- Ignore SecurityException (by just logging it)
- Add some more debug logging

Result:

Fixes #10017
@normanmaurer normanmaurer added this to the 4.1.46.Final milestone Feb 13, 2020
normanmaurer added a commit that referenced this issue Feb 13, 2020
…mission" "/etc/os-release" "read") (#10018)

Motivation:

Modifications:

- Wrap the code and execute with an AccessController
- Ignore SecurityException (by just logging it)
- Add some more debug logging

Result:

Fixes #10017
ihanyong pushed a commit to ihanyong/netty that referenced this issue Jul 31, 2020
…mission" "/etc/os-release" "read") (netty#10018)

Motivation:

Modifications:

- Wrap the code and execute with an AccessController
- Ignore SecurityException (by just logging it)
- Add some more debug logging

Result:

Fixes netty#10017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants