🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #7801

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

#7801
From: chris mcdonald
Date: Thu, 23 May 1991 18:47
24 lines
1652 bytes
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@budgie.cs.uwa.oz.au
University of Western Australia,  ARPA:   chris%budgie.cs.uwa.oz.au@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
Technical Details
Message-ID: <2884@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews2!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews2!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: chris@bilby.cs.uwa.oz.au (chris mcdonald)
Newsgroups: comp.sys.sun
Subject: How to find the real uid/gid of a process?
Keywords: Miscellaneous
Message-ID: <2884@brchh104.bnr.ca>
Date: 23 May 91 18:47:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sun-Spots
Lines: 25
Approved: Sun-Spots@rice.edu
X-Original-Date: 6 May 91 09:22:20 GMT
X-Sun-Spots-Digest: Volume 10, Issue 102, message 5
X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu