From: Eric Hodel Date: 2006-07-20T06:10:00+09:00 Subject: Re: Patch for Unix socket peer credentials On Jul 19, 2006, at 1:42 PM, Sam Roberts wrote: > On Thu, Jul 20, 2006 at 03:02:19AM +0900, Eric Hodel wrote: >> On FreeBSD uid_t and gid_t are unsigned integers. Searching google > ^^^^^^^^ > Surely this is a typo? pid_t must be signed: > > http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/ > types.h.html > > "blksize_t, pid_t, and ssize_t shall be signed integer types." Yes, typo, I meant to write "signed integers". But not pid_t, uid_t. >> for 'negative uid' reveals that other operating systems also allow >> negative uids. > > Other __UNIX__ operating systems? Are you sure? > > Among other things, this would make the kill(2) system call not work: > > http://www.opengroup.org/onlinepubs/009695399/functions/kill.html > > Process IDs are positive. It is true that the pid_t type must allow > negative values, but not when a pid_t describes a process ID. > > Btw, presence of -45 in /etc/passwd doesn't mean that a running > process > will ever actually have negative pid. I'll believe that when I see > the a ps listing showing it. You are confusing user ids (uid_t) and process ids (pid_t). -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com