I am using an android system and have a slightly broken su: I get a root shell, but stdin/stdout is acting weird: One example being that ctrl+c kills all children of the su process. So since su gets all the input before passing it to its children, I don't think there is anything I could do to fix this without killing the su process.
I thought about writing a small c programm that does the following:
- Find parent su process id and the file descriptors (for example /dev/pts/1)
- Fork new shell process with fd/0,fd/1,fd/2 pointing to /dev/pts/1
- Kill su process
Would this work? Is there maybe an easier way to stop the su binary from "intercepting" stdin/stdout?