Administravie privileges for a program

I am developing a GUI application for editing certain system files similar to Windows SysEdit using Gambas. I can read the files ok but don't know how to gain root access to write to the files. Is there and API or shell command that I can use to accomplish this task?

I'm using etch as my system if that matters.

No votes yet

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Administravie privileges for a program

You can look at the CUPS code to see how it's done. The 'easy' way is for a program to run as root, temporarily pretend to lose priviledge via 'seteuid', then regain priviledges to do some task and drop them again. In the 'easy' case there is no need to supply a user and password - in the case of CUPS, a user and password is required and if you program things correctly that can be an improvement on the easy method.

Syndicate content