su priviledges for application

So I have an interesting question since I've never had to worry about this before. Usually if I run an app after logging in with su xorg freaks out on me, but I'm writing an app that will need root access, what's the best way to allow a GUI app to run on FreeBSD with su built in C with Qt4. I know this question is asked weird but I'm not quite sure how to ask it in the first place?
 
Split the app into a GUI component and a minimal "worker" program that is setuid.

GUI code is notoriously infamous for programmers accidentally creating buffer overflow prone code - if you split the code out that needs to be setuid into a seperate executable, you can reduce the exposure and reduce the amount of code that needs to be so thoroughly audited.
 
Back
Top