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

Re: ITP: fakedate



In article <19990527103732.22117.qmail@snoopy.apana.org.au> you write:
>In article <99052618055002.04769@lyta> you write:
>>One issue that I have been thinking about is real vs effective UIDs.  I have
>>noticed when developing my library that innd does not seem to have a real UID of
>>news.  Does anyone know why this is, how I can find out the real UID of a
>>process, and whether anything other than looking at the effective UID should be
>>done by my library?
>
>I remember once doing this with ps. I had to read between the lines in
>the man page, and was able to specify the extra fields to display, for
>the set of {real,effective,?} {user,group} ids. I put the ? there, as I
>thought there was something else, but can't remember right now.
>
>Looking at the man page right now and I can't work out how I did it. I
>will investigate further tomorrow.

I still can't work out how to do this with ps (maybe it is no longer
possible), however, I think the information can be found under /proc.

eg /proc/286/status has:

Name:   squid
State:  S (sleeping)
Pid:    286
PPid:   281
Uid:    0       13      13      13
Gid:    13      13      13      13
Groups:
VmSize:    10536 kB
VmLck:         0 kB
VmRSS:      6952 kB
VmData:     8620 kB
VmStk:       324 kB
VmExe:       412 kB
VmLib:       956 kB
SigPnd: 0000000000000000
SigBlk: 0000000000000200
SigIgn: 0000000000001000
SigCgt: 0000000000014e57
CapInh: 00000000fffffeff
CapPrm: 00000000fffffeff
CapEff: 0000000000000000

I believe the entries under UID: stand for real, effective UID, or
something. I can't remember know why there are 4 numbers though.

This is:

Linux snoopy 2.2.6 #2 Fri Apr 23 21:35:43 EST 1999 i486 unknown

However, come to think of it, this may not be what you wanted. I am not
sure why you want to know the EUID inside your library, but if this is
what you require, have you considered using: getuid(), and/or geteuid()?


Reply to: