netdev
[Top] [All Lists]

Re: Wrong UIDs reported in /proc/net/tcp

To: "Chad N. Tindel" <chad@xxxxxxxxxx>
Subject: Re: Wrong UIDs reported in /proc/net/tcp
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Nov 2004 10:18:56 +1100
Cc: netdev@xxxxxxxxxxx, linux-net@xxxxxxxxxxxxxxx
In-reply-to: <20041109230411.GA91891@xxxxxxxxxxxxxx>
References: <20041109205358.GA64015@xxxxxxxxxxxxxx> <E1CRdBr-0001P2-00@xxxxxxxxxxxxxxxxxxxxxxxx> <20041109224337.GB87321@xxxxxxxxxxxxxx> <20041109225812.GA6001@xxxxxxxxxxxxxxxxxxx> <20041109230411.GA91891@xxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040722i
On Tue, Nov 09, 2004 at 06:04:11PM -0500, Chad N. Tindel wrote:
> 
> You're saying that since pidentd is calling fgets(), that can actually result
> in multiple read() calls.  Because of this, the first half of the line

fgets() is implemented on top of a buffered read, with my glibc it reads
4096 bytes.  Whatever that size is, the second read is most likely going
to be reading a partial record.  There is no guarantee that the partial
record is going to match the end of the first read.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

<Prev in Thread] Current Thread [Next in Thread>