libio backward compat bug? involving setmntent()

Zack Weinberg zack@rabi.columbia.edu
Sun May 2 18:48:00 GMT 1999


On 02 May 1999 18:35:12 -0700, Ulrich Drepper wrote:
>Zack Weinberg <zack@rabi.columbia.edu> writes:
>
>> The appended slightly-out-of-spec code segfaults when compiled on a
>> libc 2.0 system and run on a libc 2.1 system.  The problem is that
>> setmntent() returns a new FILE*, but fclose is bound to the old
>> fclose.
>> 
>> Do we want to support this, and if so, how?  (Have old fclose
>> recognize when it's handed a new FILE* and call _IO_new_fclose?)
>
>There is no libc problem (at least, not really).  The program is
>wrong:

I know the program is wrong.  However, it appears to work, and
recompiling it makes it appear to work again - so we get nailed for
inadequate backward compat.  If we really want to make people fix
this, we should change fclose such that it always barfs when handed
the FILE * that came from setmntent (or any other such function).
Otherwise, we should make it work again.

zw



More information about the Libc-hacker mailing list