Koji cannot build openldap

Jan Safranek jsafranek at redhat.com
Fri Aug 3 06:45:53 UTC 2007


Jakub Jelinek wrote:
> dbm.c is buggy.  It includes <fcntl.h>, which provides open, and POSIX
> allows functions to be defined as function-like macros.
> Until recently glibc didn't define open as a function like macro, but
> in glibc 2.6.90 and later it does when -D_FORTIFY_SOURCE=2, to enforce
> correct use of open/open64/openat/openat64.
> But dbm.c uses dbm->open (x, y, z, a);, which works when open is
> not defined as a function-like macro, but of course can break badly
> if it is defined as a function-like macro.
> The fix is use () to avoid it being expanded as function-like macro:
> (dbm->open) (x, y, z, a);

Maybe POSIX does allow such behavior, but it will break lot of packages 
- for example all packages who use Berkeley DB (which is my case).  I

Patching the DB would result in >500 changed lines and I am bit 
skeptical about upstream accepting such patch - it would break API 
compatibility. Is here any way how to tell compiler/glibc not to define 
open() as macro and still have -D_FORTIFY_SOURCE=2?

Jan




More information about the Fedora-maintainers mailing list