Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Mar 2010 17:45:23 -0700
From:      Garrett Cooper <yanefbsd@gmail.com>
To:        Christian Weisgerber <naddy@mips.inka.de>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Be careful with fdopendir() on RELENG_7
Message-ID:  <7d6fde3d1003291745v53ec10bake00bdae6d825be95@mail.gmail.com>
In-Reply-To: <hor0gd$6h2$1@lorvorc.mips.inka.de>
References:  <hor0gd$6h2$1@lorvorc.mips.inka.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 29, 2010 at 12:53 PM, Christian Weisgerber
<naddy@mips.inka.de> wrote:
> There is a silly bug in RELENG_7 up to and including RELENG_7_3:
> fdopendir(3) is available in libc, but the prototype is missing
> from <dirent.h>.
>
> This can have unexpected consequences. =A0A configure script can
> notice that fdopendir() is available, but due to the missing
> prototype, the function will be typed as the default
>
> =A0int fdopendir();
>
> This is bad. =A0fdopendir() returns a pointer and unless correctly
> prototyped, the return value will be truncated from 64 to 32 bits
> on LP64 platforms.
>
> So if you notice that something picks up the fdopendir() function
> you need to either disable it for 702102 to 703100 (inclusive) or
> make sure that the correct prototype
>
> =A0DIR *fdopendir(int);
>
> is wedged in somehow.
>
> This isn't a hypothetical concern. =A0When I initially tried gtar
> 1.23 on 7.3/amd64, it left a trail of coredumps because of this.

    Is there a bug outstanding for this?
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d6fde3d1003291745v53ec10bake00bdae6d825be95>