Re: [PATCH 0/2] fs: support $ORIGIN in ELF interpreter paths
From: David Laight
Date: Sun Jun 28 2026 - 14:44:19 EST
On Sun, 28 Jun 2026 15:20:11 +0200
Christian Brauner <brauner@xxxxxxxxxx> wrote:
...
> All of that needs consistent, easy to reason about treatment. Reading through
> the glibc implementation of $ORIGIN for shared libraries in rpath - even with
> an eye on cutting through most of the complexity - doesn't give me very warm
> feelings. It feels very hackish and full of edge cases...
I'm sure that NetBSD refused to implement $ORIGIN because it was full
of loopholes.
You'd need the kernel to hold a reference to the directory inode and
have a 'magic' argument to openat() to be relative to that directory
rather than cwd.
David