websphere的OS用户创建文件夹和写入文件所需的Linux权限是什么?

时间:2011-07-26 18:35:49

标签: java linux filesystems websphere file-permissions

我们最近安装的网络应用程序遇到了问题。

它允许用户上传文件并将其保存到操作系统中的目录。我们已经要求安全人员将websphere用户添加到目标路径组,并且此路径具有770权限。

应该这样做,如果我们使用websphere用户登录到机器,我们可以在该路径中创建文件夹和文件;但我们的java web应用程序无法创建目录,它失败了。

不幸的是,没有抛出异常,失败的方法首先检查此目录是否存在,File.isDirectory()如果返回false,则尝试使用File.mkdirs()创建它。

未创建目录,因此会向用户显示自定义错误消息。日志中没有其他线索。

我试图在我的本地Linux笔记本电脑中重现问题并玩弄用户和组,我发现权限的更改在新会话启动之前不会生效,但我不知道如何影响我们部署的Java Web应用程序以及需要做什么才能使权限生效。

我也确定这些文件是用websphere用户编写的,因为应用程序已经在不同的路径中写了一些文件。

有没有人遇到类似的事情?

感谢

1 个答案:

答案 0 :(得分:1)

chown似乎是一种解决方案。

<强>更新

另一种解决方案是检查java客户端(see)的“文件权限策略”。

  

Java 2安全性使用多个策略文件来确定每个Java程序的授予权限。   有关WebSphere®ApplicationServer支持的可用策略文件的列表,请参阅Java 2安全策略文件。

* The client.policy file is a default policy file that is shared by all of the WebSphere Application Server client containers and applets on a node.
* The union of the permissions that is contained in the java.policy file and the client.policy file are given to all of the client containers for WebSphere Application Server and applets running on the node.
* The client.policy file is not a configuration file that is managed by the repository and the file replication service. Changes to this file are local and do not replicate to the other machine.
* The client.policy file supplied by WebSphere Application Server is located in the profile_root/properties/client.policy.
* If the default permissions for a client (union of the permissions defined in the java.policy file and the client.policy file) are enough, no action is required. The default client policy is picked up automatically.
* If a specific change is required to some of the client containers and applets on a node, modify the client.policy file with the Policy Tool. Refer to Using PolicyTool to edit policy files for Java 2 security, to edit policy files. Changes to the client.policy file are local for the node.

我希望它可以帮到你。