Index | Thread | Search

From:
Steffen Nurpmeso <steffen@sdaoden.eu>
Subject:
Re: openat(2) is mostly useless, sadly
To:
Theo de Raadt <deraadt@openbsd.org>
Cc:
"H. Hartzer" <h@hartzer.sh>, tech@openbsd.org
Date:
Fri, 30 May 2025 23:50:37 +0200

Download raw body.

Thread
Theo de Raadt wrote in
 <64671.1748639163@cvs.openbsd.org>:
 |Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
 |
 |> Theo de Raadt wrote in
 |>  <13341.1748637162@cvs.openbsd.org>:
 |>|Steffen Nurpmeso <steffen@sdaoden.eu> wrote:
 |>|> H. Hartzer wrote in
 |>|>  <DA9P8IWDKRGV.SLD91CZNP0WP@hartzer.sh>:
 |>|>|Theo de Raadt wrote:
 |>|>|> instead of requiring a programmer to put a flag on every system \
 |>|>|> call \
 |>|>|> acting
 |>|>|> upon the object.  Two operational flags are added, O_BELOW and \
 |>|>|> F_BELOW.
 |>|>  ...
 |>|>|I wanted to point out that the language can be confusing of "above",
 |>|>|"below", etc. Now it may be that this is named as appropriately as it
 |>|>|can be, but while I was reading my instinct was that "below" meant a
 |>|>|child directory, rather than a parent. I think there may be some
 |>|>|confusion over the semantics.
 |>|>|
 |>|>|O_BELOW also sounds somewhat like it allows below, but not only below.
 |>|>|Maybe O_ONLYBELOW? Another possibility might be something like \
 |>|>|O_CHROOT,
 |>|>|which is a familiar and similar term, though might add other confusion.
 |>|>|
 |>|>|I think that ascend/descend might be somewhat more intuitive terms.
 |>|>|Perhaps O_DESCEND, or O_ONLYDESCEND.
 |>|> 
 |>|> How about "beneath" as Linux landlock uses?
 |>|
 |>|How about I use some other flag which already exists, and has different
 |>|semantics.  Like how about O_EXCL??
 |>|
 |>|/sarc
 |>|
 |>|You see, O_BENEATH already exists elsewhere, and is not compatible.
 |>|https://reviews.freebsd.org/D2808
 |> 
 |> ..it was O_RESOLVE_BENEATH.  Do not believe i have this highly
 |> non-portable stuff present, it was only in the back of my mind.
 |
 |https://reviews.freebsd.org/rG20e91ca36a56b8db1e6677f577ad011b66dd6eb3
 |
 |You are wrong.

True, there were also "O_BENEATH and AT_BENEATH".

But from looking at the FreeBSD manual earlier i like your idea of
turning "absolute" to mean "relative below" much more than the
FreeBSD variant of returning an access error for absolute paths.

 |> Testing, sorry.  I have not built OpenBSD from source for about
 |> fourteen years, i think.
 |
 |You are probably too busy writing emails about everything.

Unfortunately yes.

 --End of <64671.1748639163@cvs.openbsd.org>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)