* [Q] trace of set-uid program
@ 1999-08-11 4:00 Kim, Hyunchul
1999-08-11 4:00 ` Jeff Denham
0 siblings, 1 reply; 2+ messages in thread
From: Kim, Hyunchul @ 1999-08-11 4:00 UTC (permalink / raw)
I'm writing an application which traces system calls of target processes.
My problem is that when a target process do 'execve' to execute a set-uid
program
(with uid 0), the process comes to stop.
Then, neither getting the status of the process with
'ioctl(procfd, PIOCSTATUS, &prstatus)'
or making it running with
'ioctl(procfd, PIOCRUN, NULL)
succeeds.
The 'errno' is EWOULDBLOCK(EAGAIN).
Can I trace a root-set-uid program?
If I can, how can i do?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Q] trace of set-uid program
1999-08-11 4:00 [Q] trace of set-uid program Kim, Hyunchul
@ 1999-08-11 4:00 ` Jeff Denham
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Denham @ 1999-08-11 4:00 UTC (permalink / raw)
"Kim, Hyunchul" wrote:
> I'm writing an application which traces system calls of target processes.
>
> My problem is that when a target process do 'execve' to execute a set-uid
> program
> (with uid 0), the process comes to stop.
>
> Then, neither getting the status of the process with
> 'ioctl(procfd, PIOCSTATUS, &prstatus)'
> or making it running with
> 'ioctl(procfd, PIOCRUN, NULL)
> succeeds.
> The 'errno' is EWOULDBLOCK(EAGAIN).
>
> Can I trace a root-set-uid program?
> If I can, how can i do?
You should get an error return from the PIOCWSTOP
ioctl (the EAGAIN you're seeing -- same as EWOULDBLOCK).
When this happens, you need to reopen the process again to get
a new file descriptor and only then close the current and now invalid
tracing fd.
The process is actually stopped waiting for you to do this. If you
just close in invalid fd, the setuid process will continue running
detached from your trace.
Hope I remember this correctly -- it's been a long time. It should have
been in the man page for proc, which admittedly is pretty much a
disaster.
-- Jeff
__________________________________________________
Jeff Denham (jdenham@allaire.com)
Allaire Corp: Resource-management software
for building and managing fast, reliable web sites
See us at http://www.allaire.com and http://www.brighttiger.com
125 Nagog Park
Acton, MA 01720
Phone: (978) 263-5455 x177
Fax: (978) 263-5547
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-08-11 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-11 4:00 [Q] trace of set-uid program Kim, Hyunchul
1999-08-11 4:00 ` Jeff Denham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox