[SOLVED] Super user as child process

I am preparing a computer to run Mga3 for a person who has an irrational fear of the terminal. Rather than waste my time arguing with him I will simply provide solutions.
The software that he needs to run Gmorgan, for some reason needs su privileges to use some ALSA libs (I think).
Anyway, my plan is to write a simple c program that will go to su, prompt him for a password, then start gmorgan as su.
However, here's the problem.
When I do
then I lose control of the child process.
Is there a way for me to get su privileges from the user? Maybe by using a KDE window?
The software that he needs to run Gmorgan, for some reason needs su privileges to use some ALSA libs (I think).
Anyway, my plan is to write a simple c program that will go to su, prompt him for a password, then start gmorgan as su.
However, here's the problem.
When I do
- Code: Select all
if (fork()==0)
execp("su");
then I lose control of the child process.
Is there a way for me to get su privileges from the user? Maybe by using a KDE window?