简体   繁体   English

具有Everyone = READ的Windows文件使访问被拒绝

[英]Windows file with Everyone=READ gives Access is denied

I have a Java based application which creates a number of files on Windows under C:\\ProgramData... These files need to be readable by all users, guests, and automated scripts/programs not run by a user. 我有一个基于Java的应用程序,该应用程序在Windows上的C:\\ ProgramData下创建了许多文件...所有用户,访客和非用户运行的自动脚本/程序都必须可读这些文件。 One example file is "ca-trust.crt" which is created when the app runs as a Service (no service user is configured so its running as Local Machine context). 一个示例文件是“ ca-trust.crt”,该文件在应用程序作为服务运行时创建(未配置服务用户,因此其作为本地计算机上下文运行)。

My app explicitly adds an ACL for group Everyone to have READ, READ+EXECUTE. 我的应用程序为组Everyone显式添加了一个ACL,使其具有READ,READ + EXECUTE。 However, my app gets "Access is denied" when trying to open the file to READ. 但是,尝试打开要读取的文件时,我的应用程序获得“访问被拒绝”。 The same thing happens if I run Powershell as a regular user and run "type C:\\ProgramData...". 如果以普通用户身份运行Powershell并运行“ type C:\\ ProgramData ...”,则会发生相同的情况。

See image below for permissions and "type ..." command output. 请参阅下面的图像以获取权限和“ type ...”命令输出。

在此处输入图片说明

If I open PS prompt as Administrator and run "type C:\\ProgramData..." for the same file it works fine. 如果我以管理员身份打开PS提示符并为同一文件运行“ type C:\\ ProgramData ...”,则可以正常工作。

Opening the file with Notepad also fails: 使用记事本打开文件也失败: 在此处输入图片说明

The test system is Windows 10 Enterprise non-AD joined. 测试系统是Windows 10企业版非AD加入的。

Adding SYNCHRONIZE to the ACL in addition to all the READ_* flags fixed the issue. 除了所有READ_ *标志之外,将SYNCHRONIZE添加到ACL中也解决了该问题。 Thank you eryksun! 谢谢eryksun!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java Applet:读取ttf文件-拒绝访问 - Java applet: Read ttf file - access denied 在Windows 7上创建文件导致“访问被拒绝”异常 - Creating file on Windows 7 causes “Access denied” exception 在Windows 7上使用Java拒绝某些特定文件类型的访问 - Access is denied for some particular file types using Java on Windows 7 Log4J滚动日志可访问Windows“所有人” - Log4J Rolling Log Give Access To Windows “Everyone” 文件复制访问被拒绝 - File copy access denied Spring security 拒绝访问 /actuator/health - Spring security gives access denied on /actuator/health 访问被拒绝的JNLP文件 - Access denied JNLP file 使用BufferedReader在2个单独的类中调用同一文件会产生FileNotFoundException(访问被拒绝) - Using BufferedReader to call same file in 2 separate classes gives FileNotFoundException (Access is denied) 读取文本文件会导致访问被拒绝错误 - 也尝试授予文件夹权限 - Reading a text file gives access denied error -Tried giving permissions to folder as well Java.security.Access.ControlException:访问被拒绝(“java.io.FilePermission”“[object file]”“read”) - Java.security.Access.ControlException: access denied(“java.io.FilePermission” “[object file]” “read”)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM