12.05.2020 12:58, Michael Tokarev wrote:
[]
>> I do not really know hot this argument is passed and how to fix it; maybe we 
>> need a way to wrap the original command completly to isolate it from the 
>> qemu arguments...
> 
> That's the main question. Which command line it is using.
> You can (temporarily) rename this program with a .bin suffix,
> and replace original name with a shell script which prints
> its arguments somewhere and executes .bin file, - hopefully
> it will be possible to catch it.  If not and the program
> executes its argv[0], you can try using argv0 program
> (https://cr.yp.to/ucspi-tcp/argv0.html ) pointing argv0 at
> your wrapper script.

Heh. I remember there's something simpler than argv0, but
weren't able to recall what it is.  Actually it's a bash's
exec -a.  So you rename your program to program.bin,
and create a bash script named program, which reads:

 #! /bin/bash
 excho "args=$*" >> /home/user/args  # do not use predictable names in /tmp!!
 exec "-a "$0" "$0.bin" "$@"

or something like that.

/mjt

Reply via email to