Re: geteuid() while debugging
Re: geteuid() while debugging
- Subject: Re: geteuid() while debugging
- From: Adam Nohejl <email@hidden>
- Date: Sat, 25 Jun 2005 20:22:19 +0200
2005/06/25 v 15:45, Chase:
i have an if statement that looks like:
if (geteuid()==0) {
// routing table adjustments that only root can make
}
after each compile, i use chown/chmod to set the binary's privs
like so:
-rwsr-xr-x root wheel
when i run the code normally, everything works just fine, whether
launching as root or as a vanilla user.
but, when i'm trying to step through the code with the xcode/gdb
debugger, geteuid() is returning the uid of my vanilla user (the
one i'm running xcode as).
what can i do to fix this so that i can properly debug without
having to log in as root to run xcode?
thanks.
You have to run gdb as root to debug processess running as root. (If
you think about it, it makes sense.)
I don't know whether there's any way for Xcode to run gdb as root but
you can do it yourself (using sudo) if you don't depend on Xcode's GUI.
--
Adam Nohejl
Loki Software
mailto:email@hidden
http://lokisw.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden