autoexec.win

David Collier from_busybox_maillist at dexdyne.com
Tue Feb 8 12:56:00 UTC 2011


I guess it would be easy enough to insist that all system() calls invoke
stub scripts which just go "busybox <realscript>

I have control over all system calls, so I can edit them all to do that.

D


In article <4D506D88.7080009 at address4me.eu>, harald.becker at address4me.eu
(Harald Becker) wrote:

> *From:* Harald Becker <harald.becker at address4me.eu>
> *To:* from_busybox_maillist at dexdyne.com
> *CC:* busybox at busybox.net
> *Date:* Mon, 07 Feb 2011 23:09:12 +0100
> 
>  Hallo David!
> 
> > spawns... I really want it to be using my installed busybox, 
> > rather than any other busybox or set of Linux utilities that 
> might be on the disk.
> >
> > I can see that the system call doesn't explicitly set a path, so 
> > I'm
> > guessing it's inheriting the path that the C program started in - 
> > though
> > I'd need to read some man pages to stop guessing :-)
> Outch! ... that could leed to some problems. The system call runs
> /bin/sh (most likely that absolute path) and doesn't search for the
> shell in the path. Other implementations honor the setting of the 
> SHELL
> variable, so you may be able to set it to: "export 
> SHELL=/YOUR/BUSYBOX
> ash" ... and try if that gets you to your requirements (I didn't do 
> that
> before). ... but that depends on the system call implementation in 
> the C
> library your are using.
> 
> ... it would be better to specify absolute (or at least relative) 
> paths
> to your scripts and applications in the system call ... or even 
> better:
> write your own system call function and link/use that one in your
> program(s). That way you have full control which shell is executed 
> and
> on your environment settings.
> 
> --
> Harald
> 
> 


More information about the busybox mailing list