Depends on having feedback of whether exec(), etc. failed; once we have that, if exec() of /bin/sh fails, we can execute some appropriate fallback.
I'm going to suggest something like /sbin/sulogin --missing-shell as a standard "OMG! THE SKY IS FALLING!" escape route. Of course, if your sulogin is missing, or is written in shell, you're still screwed.
Depends on having feedback of whether exec(), etc. failed; once we have that, if exec() of /bin/sh fails, we can execute some appropriate fallback.
I'm going to suggest something like /sbin/sulogin --missing-shell as a standard "OMG! THE SKY IS FALLING!" escape route. Of course, if your sulogin is missing, or is written in shell, you're still screwed.