NavigationUser loginWho's onlineThere are currently 0 users and 29 guests online.
Highest Users
Linux NewsClick the above for your daily dose of Linux news. Food for ThoughtWe're becoming an oligarchic society, with an extreme concentration of wealth. This concentration of wealth is protected through a political process that's making it difficult for anyone but the monied class to have a voice. Spam?See spam posts on this site? If so, please don't reply to the spam! Instead, just report the URL to the webmaster. |
Administravie privileges for a programI 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. |
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.