# su priviledges for application



## kr651129 (Sep 27, 2012)

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?


----------



## derekschrock (Sep 27, 2012)

setuid the binary?


----------



## throAU (Sep 27, 2012)

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.


----------

