oe-lite / core

Official OE-lite/core repository - moved to GitLab.com
https://gitlab.com/oe-lite/core
Other
4 stars 17 forks source link

class/elfwrapper: Set argv[0] to wrapper instead of wrapped cmd #234

Closed esben closed 7 years ago

esben commented 7 years ago

When calling the wrapped command, set argv[0] to the wrapper argv[0] instead of the full path to the wrapped command.

This should be safer, as argv[0] can be used by the wrapped command (where as the full path to the wrapped command is not safe to call directly). Also, commands using argv[0] for usage information looks nicer.

Signed-off-by: Esben Haabendal esben@haabendal.dk

Villemoes commented 7 years ago

OK if the sdk actually works; I've never really used an sdk generated by oe-lite.

esben commented 7 years ago

It works :)

esben commented 7 years ago

Actually, this does not work in cases where /bin/sh is not bash. And as ld.so is shifting out argv[0] anyway, there really is no point in doing this anyway.