This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: libio backward compat bug? involving setmntent()
- To: drepper@cygnus.com (Ulrich Drepper)
- Subject: Re: libio backward compat bug? involving setmntent()
- From: Zack Weinberg <zack@rabi.columbia.edu>
- Date: Sun, 02 May 1999 21:47:58 -0400
- cc: libc-hacker@cygnus.com
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