How to find the real uid/gid of a process?

chris mcdonald chris at bilby.cs.uwa.oz.au
Fri May 24 04:47:00 AEST 1991


Me again, still trying to understand the SunOS kvm_* routines.

I would like to determine the real uid and gid of each process, but can't
seem to access them from each struct proc returned by kvm_nextproc();

Assuming:
	    struct proc theproc;

when I attempt to access theproc->p_cred I get a Memory Fault, and when I
access it as root I get a Segv.  I see in <sys/ucred.h> there are some
nice functions, such as crget(), but that these are only accessible in the
kernel.

Is there any way to get real uids and gids from the proc or user structs?
Unfortunately Leffler is no help on this.  While you're here, why are the
cred #defines actually in <sys/user.h> and not <sys/proc.h> ?

Thanks,

Department of Computer Science,   ACSnet: chris at budgie.cs.uwa.oz.au
University of Western Australia,  ARPA:   chris%budgie.cs.uwa.oz.au at uunet.uu.net
Mounts Bay Road,                  FTP:    bison.cs.uwa.oz.au,  130.95.1.23
Crawley, Western Australia, 6009. SCUD:   (31.97 +/-10% S, 115.81 +/-10% E)
PHONE:  ((+61) 09) 380 2533       FAX:    ((+61) 09) 382 1688




More information about the Comp.sys.sun mailing list