[Anjuta-list] My executable needs to be run by root. How to debug?



Hi Everyone,

I need to call ioperm() which can only be done by root, but I don't want
to build as root.  I can't figure out how to make this work very well in
Anjuta 1.2.4a.  Does anyone have any suggestions?  

Things I have tried.  
1) making the executable owned by root, and giving others permissions to
execute it.  I setuid() back to regular privileges after the ioperm()
call for some safety.  The problem with this is that gdb doesn't seem to
have permissions to access that.  If I could figure out how to give gdb
privileges that might make this method work.

2)  I have from the terminal window started my process using sudo, then
attached the debugger to it, getting "Error: ptrace (operation not
permitted)."

3)  I have run done sudo anjuta and everything in debugging works, but
then everything is built as root and I don't want that.  I suppose I
could make some post-process that changes the ownership back to me, but
running the whole anjuta as root seems a little risky.

Any advice? 

Thanks,

Rob
-- 
Rob Frohne, Ph.D., P.E.
E.F. Cross School of Engineering
Walla Walla College
100 SW 4th Street
College Place, WA 99324
(509) 529-3585
http://www.wwc.edu/~frohro/





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]