with the reasoning that the flags did not worked properly, and were not shipped in a release.
O_RESOLVE_BENEATH is kept as useful.
Differential D28907
open(2): Remove O_BENEATH and AT_BENEATH kib on Feb 23 2021, 8:22 PM. Authored by Tags None Referenced Files
Subscribers
Details
with the reasoning that the flags did not worked properly, and were not shipped in a release. O_RESOLVE_BENEATH is kept as useful.
Diff Detail
Event TimelineComment Actions Do we have any reason to believe that O_RESOLVE_BENEATH semantics are different from Linux's O_BENEATH? Comment Actions From Linux openat2 there are a set of resolve flags including RESOLVE_BENEATH Do not permit the path resolution to succeed if any component of the resolution is not a descendant of the directory indicated by dirfd. This causes absolute symbolic links (and absolute values of pathname) to be rejected. Currently, this flag also disables magic-link resolution (see below). However, this may change in the future. Therefore, to ensure that magic links are not resolved, the caller should explicitly specify RESOLVE_NO_MAGICLINKS. ... The semantics of RESOLVE_BENEATH were modeled after FreeBSD's O_BENEATH. Comment Actions And further, https://marc.info/?l=linux-arch&m=155002737229348
eventual commit https://github.com/torvalds/linux/commit/fddb5d430ad9fa91b49b1d34d0202ffe2fa0e179 Short answer (as I understand it): Linux has neither O_BENEATH nor O_RESOLVE_BENEATH; they have another way to specify resolution flags, and there RESOLVE_BENEATH corresponds to our O_RESOLVE BENEATH Comment Actions Ok, sorry, I confused myself into thinking that they had O_BENEATH. I believe the described semantics are compatible with O_RESOLVE_BENEATH. I'm ok with this change in principle. The capsicum test suite also needs to be updated. Comment Actions I wonder if we should just treat O_BENEATH/AT_BENEATH as a (deprecated) alias for the new O_RESOLVE_BENEATH/AT_RESOLVE_BENEATH? I doubt there's any code that depended on being able to leave the start dir with O_BENEATH? Comment Actions I would agree with the proposal, but I want to save bits in open(2) flags. It is too wasteful to leave a bit for legacy purposes, which formally should be never needed if we remove O_BENEATH before 13.0. Comment Actions Sorry about that, for some reason I though O_BENEATH already existed in 12. I agree that completely removing it makes more sense if it was never available in a real release.
Comment Actions Remove mentions of 'topping directory'. Reformulate O_RESOLVE_BENEATH based on Mark' suggestion, but make it shorter. Comment Actions I'm happy to take care of the capsicum-test updates if this gets committed. No objections from me, but I believe someone else should approve this change. Comment Actions I think the bits which remove O_BENEATH/AT_BENEATH handling at the system call layer are ok. You might split that into a separate commit.
Comment Actions Fix bug with removal of everything from tracker on a step. Per-commit split of the patch can be seen at
Comment Actions Grammar in man pages. |