View Single Post
Posts: 164 | Thanked: 132 times | Joined on Dec 2007
#10
Changing su - to su helps only a little bit:

- .bashrc is still sourced
- the value of ~ changes to /root

The only difference is that the current directory doesn't change

I suppose I can put an if statement in gainroot so that it calls su when called from root and continues to call /bin/sh otherwise. Would this be acceptable? Can you think of other workarounds?