websphere 操作系统用户创建文件夹和写入文件需要哪些 Linux 权限?
我们最近安装的网络应用程序遇到了问题。
它允许用户上传文件并将其保存到操作系统中的目录中。我们已要求安全人员将 websphere 用户添加到目标路径组中,该路径具有 770 权限。
应该可以了,如果我们用websphere用户登录机器,我们就可以在该路径下创建文件夹和文件;但我们的 java web 应用程序无法创建目录并且失败。
不幸的是,没有抛出异常,失败的方法首先使用 File.isDirectory() 检查此目录是否存在,如果返回 false,则尝试使用 File.mkdirs( )。
未创建该目录,因此会向用户显示自定义错误消息。日志中没有其他线索。
我尝试在我的本地 Linux 笔记本电脑中重现该问题,并与用户和组进行交互,我发现权限的更改在新会话启动之前不会生效,但我不确定这如何影响我们部署的java web 应用程序以及需要做什么才能使权限有效。
我还确信这些文件是用 websphere 用户编写的,因为该应用程序已在不同的路径中写入了一些文件。
有人遇到过类似的事情吗?
谢谢
we are having a problem with our recently installed web app.
It allows users to upload files and save them to a directory in the OS. We've asked the Security guys to add the websphere user to the target path group, and this path has 770 permissions.
That should do it, if we log in to the machine with the websphere user, we can create folders and files in that path; but our java web app can´t create a directory and it fails.
Unfortunately no exception is thrown, the failing method first checks for this the existence of this directory with File.isDirectory()
if it returns false, then it tries to create it with File.mkdirs()
.
The directory is not created and so a custom error message is displayed to the user. No other clue in the logs.
I've tried to reproduce the problem in my local linux laptop and toying with users and groups, i've seen that changes to permissions do not take effect until a new session is started, but i'm not sure how that affects our deployed java web app and what needs to be done for permissions to be effective.
I'm also sure the files are written with websphere user, since the app has written some files in a different path.
Has anyone faced something similar?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
chown 似乎是一个解决方案。
更新:
另一个解决方案是检查 java 客户端的“文件权限策略”(参见)。
我希望它对你有帮助。
chown seems to be a solution.
UPDATE:
Another solution is to check the 'file permission policy' for the java client (see).
I hope it helps you.