ls -l segfault + [PATCH]

Jan Evert van Grootheest Jan-Evert.van.Grootheest at Vialis.nl
Mon Mar 19 06:02:51 PDT 2007


> On Mon, Mar 19, 2007 at 01:49:46PM +0100, Jan Evert van 
> Grootheest wrote:
> > I found the manual page a bit confusing, because it first 
> says, just 
> > above the flags section, that setvbuf may be used on any 
> open stream. 
> > While later on, at the end of the first paragraph below the flags 
> > section, it is said that it must be done between opening the stream 
> > and the first action on it.
> 
> The POSIX and C standard say:
> The setvbuf() function may be used after the stream pointed 
> to by stream is associated with an open file but before any 
> other operation (other than an unsuccessful call to 
> setvbuf()) is performed on the stream.

Right. So if we want to keep a fully buffered output (which I think we do), the patch below would be the way to go. And ls would remain a safe applet.

This works just fine here.

-- Jan Evert 
 
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
 


More information about the busybox mailing list