Windows是否等于Linux/freebsd' s` resolve_beneath`和o_Resolve_beneath`?
我想打开一个文件,同时确保路径的任何组件都不在特定目录之外。
在Linux上,我可以使用OpenAt2
和rasolve_beneath
来完成此操作,并且在FreeBSD上有o_resolve_beneath
with open> openat
flag 。
有什么方法可以对窗户产生相同的效果?请注意,这需要按每个电话为基础 - 在全球范围内将我的过程限制为给定目录是没有用的。
I want to open a file, while ensuring that no component of the path goes outside a certain directory.
On Linux, I can accomplish this using openat2
and RESOLVE_BENEATH
, and on FreeBSD there is the O_RESOLVE_BENEATH
flag with openat
.
Is there any way to achieve the same effect on Windows? Note that this needs to be on a per-call basis — globally restricting my process to a given directory is not useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论