2011-07-26 43 views
1

我們最近安裝的網絡應用程序出現問題。websphere的操作系統用戶創建文件夾和寫入文件需要什麼Linux權限?

它允許用戶上傳文件並將其保存到OS中的目錄。我們要求安全人員將websphere用戶添加到目標路徑組,並且此路徑擁有770個權限。

應該這樣做,如果我們使用websphere用戶登錄到機器,我們可以在該路徑中創建文件夾和文件;但我們的Java Web應用程序不能創建一個目錄,它會失敗。

不幸的是沒有引發異常,失敗的方法首先檢查這個目錄的存在與File.isDirectory()如果它返回false,然後它試圖用File.mkdirs()創建它。

該目錄未創建,因此自定義錯誤消息顯示給用戶。日誌中沒有其他線索。

我試圖重現我的本地Linux筆記本電腦中的問題,玩弄用戶和組,我已經看到,更改權限不會生效,直到新會話開始,但我不知道如何這會影響我們部署的Java Web應用程序,以及需要做些什麼才能使權限生效。

我也確定這些文件是用websphere用戶編寫的,因爲應用程序已經在不同的路徑中寫入了一些文件。

有沒有人遇到類似的東西?

感謝

+0

哪些權限適用於「其他路徑」? – home

+0

是否啓用Java 2安全性? – home

+0

不同的路徑已經屬於websphere用戶。我不確定Java 2安全,我可以檢查它的任何想法? – rsinuhe

回答

1

chown似乎是一個解決方案。

UPDATE

另一種解決方案是檢查Java客戶端(see)的 '文件權限策略'。

Java 2安全性使用多個策略文件爲每個Java程序確定授予的權限。 有關WebSphere®Application Server支持的可用策略文件的列表,請參閱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. 

我希望它可以幫助你。

+0

我想它會這樣做,但我不能直接更改權限,必須詢問安全專家,這應該是一個合理的改變,不能要求他們更改路徑的所有者。由於他們已經看到當前的權限應該工作... – rsinuhe

+0

我修改了答案... – Aito

+0

對不起,爲了延遲,不得不經過很多官僚機構來證明client.policy確實存在一個特殊的配置,即禁止我們創建文件夾......並且老實說我忘記了回覆。 – rsinuhe

相關問題