Refactored docs for std::fs::set_permissions_nofollow + fix BSD-based systems to use fchmodat with AT_SYMLINK_NOFOLLOW flag - #160170
Conversation
|
@bors r+ rollup |
|
@bors r- Sorry I have a question :) |
|
This pull request was unapproved. |
|
r? RalfJung since you're mostly reviewing already |
|
|
d24bee2 to
82ff1cb
Compare
std::fs::set_permissions_nofollow + fix BSD-based systems to use fchmodat with AT_SYMLINK_NOFOLLOW flag
82ff1cb to
f0403c2
Compare
|
The user-facing comments are fine but this is turning into a libs discussion about the implementation. r? libs |
| /// * On all other platforms, the behavior remains the same with | ||
| /// This function currently corresponds to the following underlying operations: | ||
| /// * Linux, BSD-based platforms, Android, QNX, NTO: `fchmodat` with `AT_SYMLINK_NOFOLLOW`. | ||
| /// If that is not supported, we fall back to `open` with `O_NOFOLLOW` followed by |
There was a problem hiding this comment.
| /// If that is not supported, we fall back to `open` with `O_NOFOLLOW` followed by | |
| /// If that is not supported, we fall back to: |
There was a problem hiding this comment.
I added the colon, but wasn't really sure the reason with deleting "open with O_NOFOLLOW followed by"
There was a problem hiding this comment.
It looked redundant with the below bullet points to me:
/// If that is not supported, we fall back to: `open` with `O_NOFOLLOW` followed by
/// [`fs::set_permissions`].
/// * Other Unix-based platforms with symlinks: `open` with `O_NOFOLLOW` followed by
/// [`fs::set_permissions`].
/// * Other Unix-based platforms without symlinks: `open` followed by [`fs::set_permissions`].
/// * Windows: `CreateFileW` with `FILE_FLAG_OPEN_REPARSE_POINT` followed
/// by `SetFileInformationByHandle`.
61a29b7 to
b7b396a
Compare
|
Addressed the feedback (question on the doc feedback tho). |
This comment has been minimized.
This comment has been minimized.
b7b396a to
26c62dd
Compare
|
Looks good minus the nit on the doc comment. (r=me) Also, non-blocking, but if you could replace the |
I get different unused lint warnings depending on platform: for Will update doc when I'm back on PC |
|
That makes sense; I'm fine just leaving it as that, then. |
|
Just took a double-check at all the existing comments and resolved everything, since it looks like everything has been addressed. So, will merge this once you've made those updates. 👍🏻 |
…d fchmodat platform call on fchmodat and every platform falls back to open + fchmod when _res is set to ErrorKind::Unsupported; updated docs to reflect change
26c62dd to
459be4d
Compare
|
@bors r+ rollup Thanks for working on this! |
|
@bors note="Multi-platform code, has been tried but known to be unreliable" rollup=iffy |
|
Unknown command "note". Run |
|
@bors r+ note="Multi-platform code, has been tried but known to be unreliable" rollup=iffy |
This comment has been minimized.
This comment has been minimized.
Refactored docs for `std::fs::set_permissions_nofollow` + fix BSD-based systems to use fchmodat with AT_SYMLINK_NOFOLLOW flag This PR refactors documentations for `std::fs::set_permissions_nofollow` and fixes BSD-based systems + Android to use `fchmodat` with `AT_SYMLINK_NOFOLLOW` flag (instead of no flag set) and refactors all other platforms to defer to `OpenOptions` with `O_NOFOLLOW` behavior. r? @clarfonthey Since they looked at the original `set_permissions_nofollow` PR I made cc @RalfJung
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 9c04978 failed: CI. Failed job:
|
View all comments
This PR refactors documentations for
std::fs::set_permissions_nofollowand fixes BSD-based systems + Android to usefchmodatwithAT_SYMLINK_NOFOLLOWflag (instead of no flag set) and refactors all other platforms to defer toOpenOptionswithO_NOFOLLOWbehavior.r? @clarfonthey
Since they looked at the original
set_permissions_nofollowPR I madecc @RalfJung