root password request

Hello,

I want to start a daemon from my c++ program.
This can only be done with root permissions.
When the logged user is no root than show a dialog where the user has to enter the root's password to start the daemon.

How can I make this... Please help
You ought to create an account that has sufficient privileges for the task, and have your daemons use that. You really shouldn't be using root at all.
closed account (Dy7SLyTq)
or dont compile it under root
closed account (G309216C)
As KBW pointed out your need sufficient privileges for the task.

He is right.

My Idea would be to try to make a Kernel Driver then go a False Elevation to Root therefore it would do what you want.

Be ware that this does have rootkit like functionality so be advised to have a valid signature so that AV do not False-Positive it.

GL
Just use sudo if you are using a console application or gksudo otherwise. This is what other programs do as far as I know.
@SpaceWorm

Should you be giving info like that to someone who could be trying to write something harmful?

How can you be sure they are really doing what they say they are?
closed account (Dy7SLyTq)
i think that if they really wanted to learn how to do hacks like that space worm isnt the one stopping them. no offense spaceworm
closed account (G309216C)
If you read my Answer properly, you can see that I said "have a valid signature so that AV do not False-Positive it."

Therefore I did not feed any wrong information although the above paragraph can be used maliciously, Next As DTSCode said,

I cannot stop him because one or another he will gain the information because there are Forums dedicated to Black-Hats and it is full of Thousands of Members therefore he can easily get the information he needs.

It is just the matter of if he has the ability to do. If you really think I am a Black-Hat it is up to you because there are many members here who know that I am not a Black-Hat.

Thanks,
Topic archived. No new replies allowed.