title: Programmatically requesting elevated rights in Linux
body: <p>(<a href="https://stackoverflow.com/questions/690463/best-way-elevate-the-privileges-programmatically-under-different-versions-of-linu">This question</a> has identical title, but question body asks it in scripting point of view, e.g. <code>su -c</code>, don't dupe this to that)</p>
  
  <p>I have a Qt GUI app that needs to perform some file operations in /etc based on user input. One option would probably to use <code>system()</code> with <code>sudo</code>, but even that requires messing with <code>sudoers</code> file in some point. I also would like not to do <code>system()</code> plus script hacks to modify the files, but proper file operations.</p>
  
  <p><strong>What is the best way to programmatically elevate my applications rights to do this?</strong></p>
  
  <p>Edit: as a bonus, it'd be nice if it would work on Maemo/Meego/other handhelds too (afaik PolicyKit isn't available there..)</p>