/bin/sh is setuid


_jr_

Advanced Member
Joined
May 5, 2013
Messages
1,170
I just ran into a problem (called scripts losing LD_LIBRARY_PATH, similar to http://boards.openpandora.org/index.php/topic/9069-help-please-pnd-libraries-not-available) and tracked it down to /bin/sh being suid because /bin/busybox is suid.

I've worked around that by copying busybox to busybox-nosuid and relinking sh to busybox-nosuid. That seems to work fine, but before I reboot I'd like to hear your opinions about whether I'll have to reflash after shutdown :)

NB: it seems like a bug in busybox to have every utility (including those that don't need it) go through the suid process, because even dropping the privileges right after starting doesn't make it a noop.
 
Last edited by a moderator:
Oooh, that's interesting. For PNDs like cdevtools, it explains why 'configure' scripts ignore LD_LIBRARY_PATH, and so fail because gcc can't find its own libraries.

I'd always assumed that /bin/sh linked to bash, not busybox. Most scripts that people write use #!/bin/bash directly, so don't come across this problem, I guess.

Dunno whether your new 'sh' will break your start up. I don't imagine that it would .. worst case scenario: boot off a SD card, mount the nand, and relink it again, I suppose.
 
Last edited by a moderator:
Thanks for the encouragement. It works. Somehow some zenity icons are missing, but I suspect that is due to having a too new glib from my gtk3 build in LD_LIBRARY_PATH.


edit: everything back to normal. it actually were various gnome libs leaking from my build environment.
 
Last edited by a moderator:
Back
Top