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

Indeed, while on Android 4.3 I had to use /system/bin/sh, on Android 11
there is /bin/sh.

> 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

So, which default PATH would you suggest for Android ≥ 5.0? _PATH_DEFPATH
= 
"/product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/apex/com.android.virt/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin",
or something else?

And which binaries exist in /bin = /system/bin ?

Bruno




Reply via email to