[Toybox] Still poking at shell corner cases...

enh enh at google.com
Mon Jul 1 14:06:06 PDT 2019


On Mon, Jul 1, 2019 at 1:58 PM Rob Landley <rob at landley.net> wrote:
>
>
>
> On 7/1/19 3:18 PM, enh wrote:
> > On Mon, Jul 1, 2019 at 1:11 PM Rob Landley <rob at landley.net> wrote:
> >>
> >> On 7/1/19 2:50 PM, enh wrote:
> >>> works for me as root. i think your copy & paste got mangled somewhere.
> >>> strace says the shell is opening files in /data/local/tmp/:
> >>
> >> No, just confirmed. It says /data/local/sho7qsuv.tmp.
> >
> > is that your cwd?
>
> pwd says /
>
> >> *shrug* Calling it via adb presumably works (haven't tried yet), the terminal
> >> app does not. I'm not sure how to install a terminal app with the permissions of
> >> adb. I think I'd have to root my phone.
> >>
> >> (I tried exporting TEMP=/tmp and it didn't change anything...)
> >
> > there is no /tmp. you'll want /data/local/tmp. plus isn't TEMP a
> > Windows thing? don't you mean TMPDIR?
>
> I mean it didn't change the error message, and I tried both. (And TMP=)
>
> >> The "help" pulldown for this terminal program pulled up
> >> https://jackpal.github.io/Android-Terminal-Emulator/help/index.html so maybe I'm
> >> using the wrong one? (First one that comes up in a play store search for
> >> terminal, 10M+ downloads. I thought they were all minor variants of the AOSP code?)
> >
> > no idea. i just use adb shell... there's so little you can do from an
> > untrusted app.
>
> I've noticed. :(
>
> >>> newfstatat(AT_FDCWD, "/data/local/tmp", {st_mode=S_IFDIR|0771,
> >>> st_size=20480, ...}, 0) = 0
> >>> openat(AT_FDCWD, "/data/local/tmp/shcj1bft.tmp",
> >>> O_RDWR|O_CREAT|O_EXCL, 0600) = 3
> >>
> >> Next up after toysh and route: strace.
> >
> > the longer we put off strace, the more likely mixed 32/64 systems are
> > dead and we can ignore all the hard parts of strace :-)
>
> Not _all_ the hard parts, but some of them. (And I still want to support 32 bit,
> embedded systems still use it...)

supporting 32-bit from a 32-bit binary is fine, and supporting 64-bit
from a 64-bit binary is fine, but supporting the other bitness than
your strace binary is a nightmare if you actually want to decode
anything (and if you don't, you're basically useless anyway). most of
the bulk of the existing strace goes into dealing with this.

> Rob



More information about the Toybox mailing list