fix(libfuse): fix flags in ReplyOpen & fix set_creds logic
#250
+52
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
write中无效参数的问题。解决方案是修复open()调用返回值的 flags,使其在目前的使用方式中不会出现O_DIRECT标志。这样做的原因是这个标志需要比较复杂的处理逻辑,目前还未实现(参考了上游仓库 fuse-backend-rs 也没有实现),所以暂时不要返回这个 flagopen_by_handle_at()调用,它需要CAP_DAC_READ_SEARCH能力,而这通常是 root 用户才有的。解决方案是把需要 root 能力的调用调整到线程 uid/gid 切换之前执行