'exec /bin/sh' breaks alias

I have an application that requires su to root in order to run some commands. Unfortunately, my corporate policy only allows sudo so I created an alias in .profile as "alias su="su myaccount". My external application logs in with the first account no problem, it then runs 'exec /bin/sh' and then tries to su with the myaccount password but it comes back with 'incorrect password'. If I use an ssh account, login with my first account and then su with myaccount password it works fine. It looks like the 'exec /bin/sh' does not take the alias. /bin/sh points to bash. I have the alias in .bashrc, .profile, .shrc and .bash_profile but none of this works.

any ideas on how to get the alias to work with the /bin/sh shell?

Thanks

Stu

when you run exec, you are destroying your session and replacing it outright with your new one (Replacing your current session's PID with a new process using the same PID). You can simply run sh without exec, source your .profile or create another environment map and source that right after you change to the bourne shell.

While /bin/sh may be bash, usually it is a mapped compatibility mode for straight bourne.

By the way, the application doing this can be dangerous. Could you simply ask for the commands it needs to run to be added to the sudo configs to be allowed? That way, you will not need to exec a new shell.