Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2024 17:24:43 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Edward Tomasz Napierala <trasz@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: b165e9e3ea4e - main - Add fchroot(2)
Message-ID:  <Z0ncu8p149bHqCC_@kib.kiev.ua>
In-Reply-To: <202411291222.4ATCMG8Y068265@gitrepo.freebsd.org>
References:  <202411291222.4ATCMG8Y068265@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 29, 2024 at 12:22:16PM +0000, Edward Tomasz Napierala wrote:
> The branch main has been updated by trasz:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=b165e9e3ea4e327fc421d81c2a89242bd8720780
> 
> commit b165e9e3ea4e327fc421d81c2a89242bd8720780
> Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
> AuthorDate: 2024-11-29 07:46:07 +0000
> Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
> CommitDate: 2024-11-29 12:10:02 +0000
> 
>     Add fchroot(2)
>     
>     This is similar to chroot(2), but takes a file descriptor instead
>     of path.  Same syscall exists in NetBSD and Solaris.  It is part of a larger
>     patch to make absolute pathnames usable in Capsicum mode, but should
>     be useful in other contexts too.

I wonder if it should be fchrootat(fd, path, flags) with the support for
AT_EMPTY_PATH instead.  Then fchroot() becomes the libc wrapper.

I can see arguments both pro and contra.  Main argument against is that
the immediate semantic is easily emulated by openat() + fchroot().  But
the freedom of adding the fchroot-specific flags might be worth considering.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Z0ncu8p149bHqCC_>