Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: openat(2) is mostly useless, sadly
To:
"H. Hartzer" <h@hartzer.sh>, tech@openbsd.org
Date:
Fri, 30 May 2025 15:06:03 -0600

Download raw body.

Thread
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.

> Testing, sorry.  I have not built OpenBSD from source for about
> fourteen years, i think.

You are probably too busy writing emails about everything.