On Mon, Nov 2, 2026 at 2:19 PM Bruno Haible <[email protected]> wrote:

> Elliott Hughes wrote:
> > isn't this what _PATH_DEFPATH is for? bionic (android) doesn't support
> > _CS_PATH (or, indeed, confstr() at all) but does have  the BSD
> > _PATH_DEFPATH
>
> On the platforms that have confstr(), confstr(_CS_PATH) returns
> _PATH_STDPATH, not _PATH_DEFPATH. For instance, on NetBSD:
> confstr(_CS_PATH) =>
> "/usr/bin:/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin"
> _PATH_STDPATH =
> "/usr/bin:/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin"
> _PATH_DEFPATH = "/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin"
>
> Anyway, on Android, where normal user programs cannot access
> /bin/ etc. and where /bin/sh does not exist, the current directory
> is the only reasonable fallback, I would say.
>

neither of those claims is true on current Android... an untrusted app
can't _search_ /bin, it can execute stuff from there as long as it knows
what it's called. and sh has there since at least android 5.0 (api level
21) in 2014, which is older than the lowest-supported api level by the NDK.


> Bruno
>
>
>
>

Reply via email to