ID: 31618 User updated by: kibab at icehouse dot net Reported By: kibab at icehouse dot net -Status: Feedback +Status: Open Bug Type: Filesystem function related Operating System: redhat enterprise PHP Version: 5.0.3 New Comment:
I tried and it didn't compile: [EMAIL PROTECTED] php5-200503082130***]$ make /bin/sh /root/builds/php5-200503082130/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/libxml/ -I/root/builds/php5-200503082130/ext/libxml/ -DPHP_ATOM_INC -I/root/builds/php5-200503082130/include -I/root/builds/php5-200503082130/main -I/root/builds/php5-200503082130 -I/root/builds/php5-200503082130/Zend -I/usr/include/libxml2 -I/usr/kerberos/include -I/usr/include/freetype2 -I/usr/include/imap -I/root/builds/php5-200503082130/ext/mbstring/oniguruma -I/root/builds/php5-200503082130/ext/mbstring/libmbfl -I/root/builds/php5-200503082130/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/ncurses -I/usr/include/pspell -I/root/builds/php5-200503082130/TSRM -g-O2 -prefer-non-pic -c /root/builds/php5-200503082130/ext/libxml/libxml.c -o ext/libxml/libxml.lo /root/builds/php5-200503082130/ext/libxml/libxml.c:337: syntax error before "error" /root/builds/php5-200503082130/ext/libxml/libxml.c: In function `_php_libxml_free_error': /root/builds/php5-200503082130/ext/libxml/libxml.c:339: `error' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c:339: (Each undeclared identifier is reported only once /root/builds/php5-200503082130/ext/libxml/libxml.c:339: for each function it appears in.) /root/builds/php5-200503082130/ext/libxml/libxml.c: At top level: /root/builds/php5-200503082130/ext/libxml/libxml.c:343: syntax error before "error" /root/builds/php5-200503082130/ext/libxml/libxml.c: In function `_php_list_set_error_structure': /root/builds/php5-200503082130/ext/libxml/libxml.c:345: `xmlError' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c:345: syntax error before "error_copy" /root/builds/php5-200503082130/ext/libxml/libxml.c:350: `error_copy' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c:352: `error' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c:357: `XML_ERR_ERROR' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c:363: `msg' undeclared (first use in this function) /root/builds/php5-200503082130/ext/libxml/libxml.c: At top level: /root/builds/php5-200503082130/ext/libxml/libxml.c:455: syntax error before "xmlErrorPtr" /root/builds/php5-200503082130/ext/libxml/libxml.c: In function `php_libxml_structured_error_handler': /root/builds/php5-200503082130/ext/libxml/libxml.c:457: `error' undeclared (first use in this function) make: *** [ext/libxml/libxml.lo] Error 1 I'll try the next few snapshots until one of them compiles and then provide feedback. Thanks. Previous Comments: ------------------------------------------------------------------------ [2005-02-28 20:59:48] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2005-01-20 22:32:24] kibab at icehouse dot net Maybe this isn't directly related, but fopen($myfilename,"r") also fails, even though include($myfilename) works. Again, $myfilename is in the safe_mode_include_dir, so fopen should be able to open it. ------------------------------------------------------------------------ [2005-01-19 23:05:35] kibab at icehouse dot net Description: ------------ is_readable($myfilename) in the repro code returns true if the script calling it is owned by root, but false if it is owned by someone else. Permissions are: -rw-r--r-- 1 root root 5452 Jan 13 13:02 /var/lib/php_packages/test_templ2.php drwxr-xr-x 4 root root 4096 Jan 19 08:19 /var/lib/php_packages drwxr-xr-x 27 root root 4096 Jan 12 09:27 /var/lib drwxr-xr-x 24 root root 4096 Sep 22 13:06 /var drwxr-xr-x 20 root root 4096 Oct 29 09:48 / Relevant Settings: include_path = ".:/var/lib/php_packages:/var/lib/php_packages/pear" safe_mode = On safe_mode_gid = On safe_mode_include_dir = /var/lib/php_packages Reproduce code: --------------- #### test.php ### $myfilename = '/var/lib/php_packages/test_templ2.php'; if (is_readable($myfilename)) { echo "is_readable: $myfilename (true)<br>"; } else { echo "is_readable: $myfilename (false)<br>"; } include($myfilename); ### test_templ2.php ### TESTING! Expected result: ---------------- I would expect is_readable() to return true in both instances. The uid/gid check shouldn't matter despite safe mode, as the file is in safe_mode_include_dir, and even if it wasn't, the is_readable documentation says that it does NOT take into account safe_mode restrictions. Actual result: -------------- // When test.php has the following ownership: $ ls -l test.php -rw-rw-r-- 1 root root 278 Jan 19 13:16 test.php // I get the following output: is_readable: /var/lib/php_packages/test_templ2.php (true) TESTING! // When test.php has the following permissions: $ ls -l test.php -rw-rw-r-- 1 dschlegel79 undergradadmiss 278 Jan 19 13:16 test.php // I get the following output: is_readable: /var/lib/php_packages/test_templ2.php (false) TESTING! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31618&edit=1