Windows是否等于Linux/freebsd' s` resolve_beneath`和o_Resolve_beneath`?

发布于 2025-01-21 15:43:55 字数 273 浏览 3 评论 0原文

我想打开一个文件,同时确保路径的任何组件都不在特定目录之外。

在Linux上,我可以使用OpenAt2rasolve_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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文