Bug 251665 - New open(2) magic breaks php build
Summary: New open(2) magic breaks php build
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-08-10 10:43 UTC by Hans de Goede
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2007-08-10 12:16:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Hans de Goede 2007-08-10 10:43:30 UTC
Description of problem:
I just update glibc and now when compiling php5 I get:
/home/hans/projects/fedora-extras/php/devel/php-5.2.3/ext/dba/dba.c: In function
'php_dba_open':
/home/hans/projects/fedora-extras/php/devel/php-5.2.3/ext/dba/dba.c:933: error:
expected identifier before '(' token

Before the glibc update it compiled fine, line 933 is:
        if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) {

Adding "#undef open" after the #include statements fixes this. Am I the only one
who things making open a macro is a bad idea? There are bound to be many pieces
of software with structs, with in the struct a function pointer called open.

Comment 1 Jakub Jelinek 2007-08-10 12:16:58 UTC
You can and should use (hptr->open)(info, &error TSRMLS_CC)
or hptr->(open)(info, &error TSRMLS_CC)
POSIX allows any standard function to be defined function-like macro and
in the case of open the reason why we changed it were multiple requests from
security folks - way too many packages aren't able to use open correctly
with O_CREAT and pass random flags as third argument, which often is a security
issue.

Comment 2 Joe Orton 2007-08-10 12:30:28 UTC
Hans, I've added the patch to fix this to the devel branch.


Note You need to log in before you can comment on or make changes to this bug.