Page 1 of 1

[SOLVED] Super user as child process

PostPosted: May 30th, '13, 18:58
by Max
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
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?

Re: Super user as child process

PostPosted: May 30th, '13, 21:28
by doktor5000
Uhmm, why write a C program for that? Either use kdesu or create a custom launcher and start it under a different user ...

Re: Super user as child process

PostPosted: May 31st, '13, 16:13
by Max
Thanks, I knew there was a simpler way to do it.