wheel and applications

Hey everyone, I've got what is most likely a real simple question. I'm writing a network manager in C++ just to learn, the app will need root access to modify files and restart the connection so I won't have to run the app as root each time. When I compile apps I see wheel commands when it's getting compiled. I'm assuming this is the direction I need to take but I'd like to know if I'm on the right track or if someone can point me to a useful resource for this?

Thank you
 
kr651129 said:
When I compile apps I see wheel commands when it's getting compiled. I'm assuming this is the direction I need to take but I'd like to know if I'm on the right track or if someone can point me to a useful resource for this?

The wheel group is a special group (like others, operator, and so on) that has some more permissive capabilities on the system. Your application however has to run setuid or thru sudo(1), both are quite dangerous so be sure the application is really well tested.
 
I would write a simple graphical wrapper around su that would pop a dialog for root password before your application is executed then it would pipe the password to su that would execute your app as root. Make sure to use pipes to transfer the password and dont just put it as an argument or it will show up in process description when you run ps (and similar).

Simplest would be to use shell scriptable dialog toolkit like x11/zenity/, or you can write the wrapper in C++ using toolkit of your choice.
 
@SirDice -- thank you, I wanted to ask the question and I know I sounded dumb but I didn't know the right vocabulary to ask it

@Expl -- Thanks for the suggestion I may write that first as a starting point

@fluca -- I know what the wheel group is, I just needed a way to ask the question, but thank you.

Thanks for the help everyone :)
 
expl said:
I would write a simple graphical wrapper around su that would pop a dialog for root password before your application is executed then it would pipe the password to su that would execute your app as root.

Or you can use the already done kdesu or gsudo or some tool alike.
 
fluca1978 said:
Or you can use the already done kdesu or gsudo or some tool alike.

Well he said he wants to learn, there is no better way to learn than rolling your own.
 
expl said:
Well he said he wants to learn, there is no better way to learn than rolling your own.

Eventually I'd like to roll out my own window manager something similar to xfce. Not that I need to, but for the same reason any other geek would, just to do it.
 
Back
Top