Re: [gtk-list] still a bug with getpwuid_r [was: Re: 1.1.14



On 02-Feb-99 Sebastian Wilhelmi wrote:
> Hi, Trog 
> 
>> It now looks like this in the CVS:
>> 
>>  guint bufsize = 64;
>> 
>> I'm not convinced that this is correct. The buffer should be big
>> enough to hold the largest entry in /etc/passwd.
>> 
>> The Digital Unix man page states:
>> 
>> [Digital]  The minimum buffer size is 1024 bytes as defined for
>>             SIABUFSIZ in /usr/include/sia.h.
>> 
>> As 64 < 1024 we appear to have a problem.
> 
> No, the buffer size is doubled, until the buffer is big enough,
> allocating
> to much buffer right away is not a good idea, I think. 64 should
> actually
> be enough for most uses. (i.e. is must hold the name, real name and
> home
> dir of the user, typical sizes might be 8, 25, 25 thus the sum is
> 61
> (including the \0 at the end) so it looks as if it should suffice
> in most
> situations.)
> 

Doubled by whom? Don't forget that we are working on multiple
architectures, and the Digital UNIX man page seems very specific.

I'd rather have it suffice in all situations rather than most.

-tony

---
E-Mail: trog@gtk.org
Must I hold a candle to my shames?
		-- William Shakespeare, "The Merchant of Venice"

Go Bezerk! http://www.gtk.org/~trog



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