[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/acinclude.m4 branches/PHP_5_3/ext/ldap/config.m4 branches/PHP_5_3/ext/openssl/config0.m4 trunk/acinclude.m4 trunk/ext/ldap/config.m4

2011-03-18 Thread Raphael Geissert
geissert Fri, 18 Mar 2011 18:47:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=309398

Log:
Add the libraries we actually test and need for LDAP and OpenSSL, fixes bug 
#53339
Patch by Clint Byrum

Bug: http://bugs.php.net/53339 (Open) Fails to build LDAP module when compilng 
with gcc 4.5 and DSO libraries
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/acinclude.m4
U   php/php-src/branches/PHP_5_3/ext/ldap/config.m4
U   php/php-src/branches/PHP_5_3/ext/openssl/config0.m4
U   php/php-src/trunk/acinclude.m4
U   php/php-src/trunk/ext/ldap/config.m4
U   php/php-src/trunk/ext/openssl/config0.m4

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2011-03-18 17:05:46 UTC (rev 309397)
+++ php/php-src/branches/PHP_5_3/NEWS   2011-03-18 18:47:09 UTC (rev 309398)
@@ -13,6 +13,10 @@
 - DBA extension:
   . Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe)

+- LDAP extension:
+  . Fixed bug #53339 (Fails to build when compilng with gcc 4.5 and DSO
+libraries). (Clint Byrum, Raphael)
+
 - MySQL Improved extension:
   . Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi 
queries).
 (Andrey)

Modified: php/php-src/branches/PHP_5_3/acinclude.m4
===
--- php/php-src/branches/PHP_5_3/acinclude.m4   2011-03-18 17:05:46 UTC (rev 
309397)
+++ php/php-src/branches/PHP_5_3/acinclude.m4   2011-03-18 18:47:09 UTC (rev 
309398)
@@ -2397,7 +2397,7 @@
   -L$OPENSSL_LIBDIR
 ])
 LIBS=$old_LIBS
-PHP_ADD_LIBRARY(ssl,,$1)
+PHP_ADD_LIBRARY(crypto,,$1)

 PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
   fi

Modified: php/php-src/branches/PHP_5_3/ext/ldap/config.m4
===
--- php/php-src/branches/PHP_5_3/ext/ldap/config.m4 2011-03-18 17:05:46 UTC 
(rev 309397)
+++ php/php-src/branches/PHP_5_3/ext/ldap/config.m4 2011-03-18 18:47:09 UTC 
(rev 309398)
@@ -50,7 +50,7 @@
 SASL_LIB=-L$LDAP_SASL_LIBDIR -lsasl2
   fi

-  PHP_CHECK_LIBRARY(ldap, sasl_version,
+  PHP_CHECK_LIBRARY(sasl2, sasl_version,
   [
 PHP_ADD_INCLUDE($LDAP_SASL_INCDIR)
 PHP_ADD_LIBRARY_WITH_PATH(sasl2, $LDAP_SASL_LIBDIR, LDAP_SHARED_LIBADD)

Modified: php/php-src/branches/PHP_5_3/ext/openssl/config0.m4
===
--- php/php-src/branches/PHP_5_3/ext/openssl/config0.m4 2011-03-18 17:05:46 UTC 
(rev 309397)
+++ php/php-src/branches/PHP_5_3/ext/openssl/config0.m4 2011-03-18 18:47:09 UTC 
(rev 309398)
@@ -17,6 +17,7 @@
   fi

   AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 
1, [OpenSSL 0.9.7 or later]))
+  AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, 
[OpenSSL 0.9.7 or later]))

   PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
   [

Modified: php/php-src/trunk/acinclude.m4
===
--- php/php-src/trunk/acinclude.m4  2011-03-18 17:05:46 UTC (rev 309397)
+++ php/php-src/trunk/acinclude.m4  2011-03-18 18:47:09 UTC (rev 309398)
@@ -2412,7 +2412,7 @@
   -L$OPENSSL_LIBDIR
 ])
 LIBS=$old_LIBS
-PHP_ADD_LIBRARY(ssl,,$1)
+PHP_ADD_LIBRARY(crypto,,$1)

 PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
   fi

Modified: php/php-src/trunk/ext/ldap/config.m4
===
--- php/php-src/trunk/ext/ldap/config.m42011-03-18 17:05:46 UTC (rev 
309397)
+++ php/php-src/trunk/ext/ldap/config.m42011-03-18 18:47:09 UTC (rev 
309398)
@@ -50,7 +50,7 @@
 SASL_LIB=-L$LDAP_SASL_LIBDIR -lsasl2
   fi

-  PHP_CHECK_LIBRARY(ldap, sasl_version,
+  PHP_CHECK_LIBRARY(sasl2, sasl_version,
   [
 PHP_ADD_INCLUDE($LDAP_SASL_INCDIR)
 PHP_ADD_LIBRARY_WITH_PATH(sasl2, $LDAP_SASL_LIBDIR, LDAP_SHARED_LIBADD)

Modified: php/php-src/trunk/ext/openssl/config0.m4
===
--- php/php-src/trunk/ext/openssl/config0.m42011-03-18 17:05:46 UTC (rev 
309397)
+++ php/php-src/trunk/ext/openssl/config0.m42011-03-18 18:47:09 UTC (rev 
309398)
@@ -17,6 +17,7 @@
   fi

   AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 
1, [OpenSSL 0.9.7 or later]))
+  AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, 
[OpenSSL 0.9.7 or later]))

   PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
   [

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in trunk/sapi/fpm/init.d.php-fpm.in

2010-07-29 Thread Raphael Geissert
geissert Thu, 29 Jul 2010 19:13:42 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=301700

Log:
Fix required facilities for php-fpm's init script

$all should only be used in rare, and very specific, cases.

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in
U   php/php-src/trunk/sapi/fpm/init.d.php-fpm.in

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in 2010-07-29 
19:03:12 UTC (rev 301699)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/init.d.php-fpm.in 2010-07-29 
19:13:42 UTC (rev 301700)
@@ -2,8 +2,8 @@

 ### BEGIN INIT INFO
 # Provides:  php-fpm
-# Required-Start:$all
-# Required-Stop: $all
+# Required-Start:$remote_fs $network
+# Required-Stop: $remote_fs $network
 # Default-Start: 2 3 4 5
 # Default-Stop:  0 1 6
 # Short-Description: starts php-fpm

Modified: php/php-src/trunk/sapi/fpm/init.d.php-fpm.in
===
--- php/php-src/trunk/sapi/fpm/init.d.php-fpm.in2010-07-29 19:03:12 UTC 
(rev 301699)
+++ php/php-src/trunk/sapi/fpm/init.d.php-fpm.in2010-07-29 19:13:42 UTC 
(rev 301700)
@@ -2,8 +2,8 @@

 ### BEGIN INIT INFO
 # Provides:  php-fpm
-# Required-Start:$all
-# Required-Stop: $all
+# Required-Start:$remote_fs $network
+# Required-Stop: $remote_fs $network
 # Default-Start: 2 3 4 5
 # Default-Stop:  0 1 6
 # Short-Description: starts php-fpm

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/sapi/cli/php.1.in branches/PHP_5_3/sapi/cli/php.1.in trunk/sapi/cli/php.1.in

2010-05-11 Thread Raphael Geissert
geissert Tue, 11 May 2010 15:07:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=299249

Log:
Document CGI options in the manpage (bug #51718)
Patch by Daniel Egeberg

Bug: http://bugs.php.net/51718 (Open) cgi options not documented on manpages
  
Changed paths:
U   php/php-src/branches/PHP_5_2/sapi/cli/php.1.in
U   php/php-src/branches/PHP_5_3/sapi/cli/php.1.in
U   php/php-src/trunk/sapi/cli/php.1.in

Modified: php/php-src/branches/PHP_5_2/sapi/cli/php.1.in
===
--- php/php-src/branches/PHP_5_2/sapi/cli/php.1.in  2010-05-11 14:49:17 UTC 
(rev 299248)
+++ php/php-src/branches/PHP_5_2/sapi/cli/php.1.in  2010-05-11 15:07:31 UTC 
(rev 299249)
@@ -94,6 +94,34 @@
 have history support.
 .TP
 .PD 0
+.B \-\-bindpath \fIaddress:port\fP|\fIport\fP
+.TP
+.PD 1
+.B \-b \fIaddress:port\fP|\fIport\fP
+Bind Path for external FASTCGI Server mode (CGI only).
+.TP
+.PD 0
+.B \-\-no\-chdir
+.TP
+.PD 1
+.B \-C
+Do not chdir to the script's directory (CGI only).
+.TP
+.PD 0
+.B \-\-no\-header
+.TP
+.PD 1
+.B \-q
+Quiet-mode. Suppress HTTP header output (CGI only).
+.TP
+.PD 0
+.B \-\-timing \fIcount\fP
+.TP
+.PD 1
+.B \-T \fIcount\fP
+Measure execution time of script repeated count times (CGI only).
+.TP
+.PD 0
 .B \-\-php\-ini \fIpath\fP|\fIfile\fP
 .TP
 .PD 1

Modified: php/php-src/branches/PHP_5_3/sapi/cli/php.1.in
===
--- php/php-src/branches/PHP_5_3/sapi/cli/php.1.in  2010-05-11 14:49:17 UTC 
(rev 299248)
+++ php/php-src/branches/PHP_5_3/sapi/cli/php.1.in  2010-05-11 15:07:31 UTC 
(rev 299249)
@@ -94,6 +94,34 @@
 have history support.
 .TP
 .PD 0
+.B \-\-bindpath \fIaddress:port\fP|\fIport\fP
+.TP
+.PD 1
+.B \-b \fIaddress:port\fP|\fIport\fP
+Bind Path for external FASTCGI Server mode (CGI only).
+.TP
+.PD 0
+.B \-\-no\-chdir
+.TP
+.PD 1
+.B \-C
+Do not chdir to the script's directory (CGI only).
+.TP
+.PD 0
+.B \-\-no\-header
+.TP
+.PD 1
+.B \-q
+Quiet-mode. Suppress HTTP header output (CGI only).
+.TP
+.PD 0
+.B \-\-timing \fIcount\fP
+.TP
+.PD 1
+.B \-T \fIcount\fP
+Measure execution time of script repeated count times (CGI only).
+.TP
+.PD 0
 .B \-\-php\-ini \fIpath\fP|\fIfile\fP
 .TP
 .PD 1

Modified: php/php-src/trunk/sapi/cli/php.1.in
===
--- php/php-src/trunk/sapi/cli/php.1.in 2010-05-11 14:49:17 UTC (rev 299248)
+++ php/php-src/trunk/sapi/cli/php.1.in 2010-05-11 15:07:31 UTC (rev 299249)
@@ -94,6 +94,34 @@
 have history support.
 .TP
 .PD 0
+.B \-\-bindpath \fIaddress:port\fP|\fIport\fP
+.TP
+.PD 1
+.B \-b \fIaddress:port\fP|\fIport\fP
+Bind Path for external FASTCGI Server mode (CGI only).
+.TP
+.PD 0
+.B \-\-no\-chdir
+.TP
+.PD 1
+.B \-C
+Do not chdir to the script's directory (CGI only).
+.TP
+.PD 0
+.B \-\-no\-header
+.TP
+.PD 1
+.B \-q
+Quiet-mode. Suppress HTTP header output (CGI only).
+.TP
+.PD 0
+.B \-\-timing \fIcount\fP
+.TP
+.PD 1
+.B \-T \fIcount\fP
+Measure execution time of script repeated count times (CGI only).
+.TP
+.PD 0
 .B \-\-php\-ini \fIpath\fP|\fIfile\fP
 .TP
 .PD 1

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/pgsql/pgsql.c branches/PHP_5_3/ext/pgsql/pgsql.c trunk/ext/pgsql/pgsql.c

2010-05-01 Thread Raphael Geissert
geissert Sat, 01 May 2010 18:27:42 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298840

Log:
Fix typos s/connnection/connection

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/pgsql/pgsql.c
U   php/php-src/branches/PHP_5_3/ext/pgsql/pgsql.c
U   php/php-src/trunk/ext/pgsql/pgsql.c

Modified: php/php-src/branches/PHP_5_2/ext/pgsql/pgsql.c
===
--- php/php-src/branches/PHP_5_2/ext/pgsql/pgsql.c  2010-05-01 18:20:30 UTC 
(rev 298839)
+++ php/php-src/branches/PHP_5_2/ext/pgsql/pgsql.c  2010-05-01 18:27:42 UTC 
(rev 298840)
@@ -3855,7 +3855,7 @@
 /* }}} */
 #endif

-/* {{{ proto int pg_connection_status(resource connnection)
+/* {{{ proto int pg_connection_status(resource connection)
Get connection status */
 PHP_FUNCTION(pg_connection_status)
 {
@@ -3876,7 +3876,7 @@
 /* }}} */

 #if HAVE_PGTRANSACTIONSTATUS
-/* {{{ proto int pg_transaction_status(resource connnection)
+/* {{{ proto int pg_transaction_status(resource connection)
Get transaction status */
 PHP_FUNCTION(pg_transaction_status)
 {

Modified: php/php-src/branches/PHP_5_3/ext/pgsql/pgsql.c
===
--- php/php-src/branches/PHP_5_3/ext/pgsql/pgsql.c  2010-05-01 18:20:30 UTC 
(rev 298839)
+++ php/php-src/branches/PHP_5_3/ext/pgsql/pgsql.c  2010-05-01 18:27:42 UTC 
(rev 298840)
@@ -434,12 +434,12 @@
 #endif

 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connection_status, 0, 0, 1)
-   ZEND_ARG_INFO(0, connnection)
+   ZEND_ARG_INFO(0, connection)
 ZEND_END_ARG_INFO()

 #if HAVE_PGTRANSACTIONSTATUS
 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_transaction_status, 0, 0, 1)
-   ZEND_ARG_INFO(0, connnection)
+   ZEND_ARG_INFO(0, connection)
 ZEND_END_ARG_INFO()
 #endif

@@ -4278,7 +4278,7 @@
 /* }}} */
 #endif

-/* {{{ proto int pg_connection_status(resource connnection)
+/* {{{ proto int pg_connection_status(resource connection)
Get connection status */
 PHP_FUNCTION(pg_connection_status)
 {
@@ -4299,7 +4299,7 @@
 /* }}} */

 #if HAVE_PGTRANSACTIONSTATUS
-/* {{{ proto int pg_transaction_status(resource connnection)
+/* {{{ proto int pg_transaction_status(resource connection)
Get transaction status */
 PHP_FUNCTION(pg_transaction_status)
 {

Modified: php/php-src/trunk/ext/pgsql/pgsql.c
===
--- php/php-src/trunk/ext/pgsql/pgsql.c 2010-05-01 18:20:30 UTC (rev 298839)
+++ php/php-src/trunk/ext/pgsql/pgsql.c 2010-05-01 18:27:42 UTC (rev 298840)
@@ -434,12 +434,12 @@
 #endif

 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_connection_status, 0, 0, 1)
-   ZEND_ARG_INFO(0, connnection)
+   ZEND_ARG_INFO(0, connection)
 ZEND_END_ARG_INFO()

 #if HAVE_PGTRANSACTIONSTATUS
 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_transaction_status, 0, 0, 1)
-   ZEND_ARG_INFO(0, connnection)
+   ZEND_ARG_INFO(0, connection)
 ZEND_END_ARG_INFO()
 #endif

@@ -4270,7 +4270,7 @@
 /* }}} */
 #endif

-/* {{{ proto int pg_connection_status(resource connnection)
+/* {{{ proto int pg_connection_status(resource connection)
Get connection status */
 PHP_FUNCTION(pg_connection_status)
 {
@@ -4291,7 +4291,7 @@
 /* }}} */

 #if HAVE_PGTRANSACTIONSTATUS
-/* {{{ proto int pg_transaction_status(resource connnection)
+/* {{{ proto int pg_transaction_status(resource connection)
Get transaction status */
 PHP_FUNCTION(pg_transaction_status)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/dom/node.c branches/PHP_5_3/ext/dom/node.c trunk/ext/dom/node.c

2010-05-01 Thread Raphael Geissert
geissert Sat, 01 May 2010 18:30:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298841

Log:
Fix another typo s/exlcusive/exclusive

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/dom/node.c
U   php/php-src/branches/PHP_5_3/ext/dom/node.c
U   php/php-src/trunk/ext/dom/node.c

Modified: php/php-src/branches/PHP_5_2/ext/dom/node.c
===
--- php/php-src/branches/PHP_5_2/ext/dom/node.c 2010-05-01 18:27:42 UTC (rev 
298840)
+++ php/php-src/branches/PHP_5_2/ext/dom/node.c 2010-05-01 18:30:38 UTC (rev 
298841)
@@ -1921,7 +1921,7 @@
inclusive_ns_prefixes[nscount] = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE,
-   Inclusive namespace prefixes only allowed in 
exlcusive mode.);
+   Inclusive namespace prefixes only allowed in 
exclusive mode.);
}
}


Modified: php/php-src/branches/PHP_5_3/ext/dom/node.c
===
--- php/php-src/branches/PHP_5_3/ext/dom/node.c 2010-05-01 18:27:42 UTC (rev 
298840)
+++ php/php-src/branches/PHP_5_3/ext/dom/node.c 2010-05-01 18:30:38 UTC (rev 
298841)
@@ -1871,7 +1871,7 @@
inclusive_ns_prefixes[nscount] = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE,
-   Inclusive namespace prefixes only allowed in 
exlcusive mode.);
+   Inclusive namespace prefixes only allowed in 
exclusive mode.);
}
}


Modified: php/php-src/trunk/ext/dom/node.c
===
--- php/php-src/trunk/ext/dom/node.c2010-05-01 18:27:42 UTC (rev 298840)
+++ php/php-src/trunk/ext/dom/node.c2010-05-01 18:30:38 UTC (rev 298841)
@@ -1871,7 +1871,7 @@
inclusive_ns_prefixes[nscount] = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE,
-   Inclusive namespace prefixes only allowed in 
exlcusive mode.);
+   Inclusive namespace prefixes only allowed in 
exclusive mode.);
}
}


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/enchant/enchant.c branches/PHP_5_3/ext/enchant/tests/dict_quick_check.phpt trunk/ext/enchant/enchant.c trunk/ext/enchant/tests/dict_quick_check.phpt

2010-05-01 Thread Raphael Geissert
geissert Sat, 01 May 2010 23:32:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298863

Log:
Fix unaligned memory accesses in enchant (bug #51289)

Bug: http://bugs.php.net/51289 (Assigned) unaligned memory access in enchant.c
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/enchant/enchant.c
A   php/php-src/branches/PHP_5_3/ext/enchant/tests/dict_quick_check.phpt
U   php/php-src/trunk/ext/enchant/enchant.c
A   php/php-src/trunk/ext/enchant/tests/dict_quick_check.phpt

Modified: php/php-src/branches/PHP_5_3/ext/enchant/enchant.c
===
--- php/php-src/branches/PHP_5_3/ext/enchant/enchant.c  2010-05-01 23:31:14 UTC 
(rev 298862)
+++ php/php-src/branches/PHP_5_3/ext/enchant/enchant.c  2010-05-01 23:32:40 UTC 
(rev 298863)
@@ -728,6 +728,7 @@

if (enchant_dict_check(pdict-pdict, word, wordlen)  0) {
int n_sugg;
+   size_t n_sugg_st;
char **suggs;

if (!sugg  ZEND_NUM_ARGS() == 2) {
@@ -736,7 +737,8 @@

array_init(sugg);

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
(size_t *) n_sugg);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
+   memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;
for (i = 0; i  n_sugg; i++) {
@@ -781,6 +783,7 @@
char **suggs;
enchant_dict *pdict;
int n_sugg;
+   size_t n_sugg_st;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, dict, 
word, wordlen) == FAILURE) {
RETURN_FALSE;
@@ -788,7 +791,8 @@

PHP_ENCHANT_GET_DICT;

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, (size_t 
*)n_sugg);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, n_sugg_st);
+   memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;


Added: php/php-src/branches/PHP_5_3/ext/enchant/tests/dict_quick_check.phpt
===
--- php/php-src/branches/PHP_5_3/ext/enchant/tests/dict_quick_check.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/enchant/tests/dict_quick_check.phpt
2010-05-01 23:32:40 UTC (rev 298863)
@@ -0,0 +1,26 @@
+--TEST--
+enchant_dict_quick_check() basic test
+--SKIPIF--
+?php
+if(!extension_loaded('enchant')) die('skip, enchant not loader');
+
+$tag = 'en_US';
+$r = enchant_broker_init();
+if (!enchant_broker_dict_exists($r, $tag))
+die('skip, no dictionary for ' . $tag . ' tag');
+?
+--FILE--
+?php
+
+$tag = 'en_US';
+$r = enchant_broker_init();
+
+$d = enchant_broker_request_dict($r, $tag);
+enchant_dict_quick_check($d, 'soong', $suggs);
+
+echo Elements:  . count($suggs) . \n;
+echo Done\n;
+?
+--EXPECTF--
+Elements: %d
+Done

Modified: php/php-src/trunk/ext/enchant/enchant.c
===
--- php/php-src/trunk/ext/enchant/enchant.c 2010-05-01 23:31:14 UTC (rev 
298862)
+++ php/php-src/trunk/ext/enchant/enchant.c 2010-05-01 23:32:40 UTC (rev 
298863)
@@ -728,6 +728,7 @@

if (enchant_dict_check(pdict-pdict, word, wordlen)  0) {
int n_sugg;
+   size_t n_sugg_st;
char **suggs;

if (!sugg  ZEND_NUM_ARGS() == 2) {
@@ -736,7 +737,8 @@

array_init(sugg);

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
(size_t *) n_sugg);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
+   memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;
for (i = 0; i  n_sugg; i++) {
@@ -781,6 +783,7 @@
char **suggs;
enchant_dict *pdict;
int n_sugg;
+   size_t n_sugg_st;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rs, dict, 
word, wordlen) == FAILURE) {
RETURN_FALSE;
@@ -788,7 +791,8 @@

PHP_ENCHANT_GET_DICT;

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, (size_t 
*)n_sugg);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, n_sugg_st);
+   memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;


Added: php/php-src/trunk/ext/enchant/tests/dict_quick_check.phpt
===
--- php/php-src/trunk/ext/enchant/tests/dict_quick_check.phpt   
(rev 0)
+++ php/php-src/trunk/ext/enchant/tests/dict_quick_check.phpt   2010-05-01 
23:32:40 UTC (rev 298863)
@@ -0,0 +1,26 @@
+--TEST--
+enchant_dict_quick_check() basic test
+--SKIPIF--
+?php
+if(!extension_loaded('enchant')) die('skip, enchant not loader');

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/enchant/enchant.c trunk/ext/enchant/enchant.c

2010-05-01 Thread Raphael Geissert
geissert Sun, 02 May 2010 05:01:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=298870

Log:
Fix bug in unaligned memory access fix

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/enchant/enchant.c
U   php/php-src/trunk/ext/enchant/enchant.c

Modified: php/php-src/branches/PHP_5_3/ext/enchant/enchant.c
===
--- php/php-src/branches/PHP_5_3/ext/enchant/enchant.c  2010-05-02 05:00:45 UTC 
(rev 298869)
+++ php/php-src/branches/PHP_5_3/ext/enchant/enchant.c  2010-05-02 05:01:51 UTC 
(rev 298870)
@@ -737,7 +737,7 @@

array_init(sugg);

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;

Modified: php/php-src/trunk/ext/enchant/enchant.c
===
--- php/php-src/trunk/ext/enchant/enchant.c 2010-05-02 05:00:45 UTC (rev 
298869)
+++ php/php-src/trunk/ext/enchant/enchant.c 2010-05-02 05:01:51 UTC (rev 
298870)
@@ -737,7 +737,7 @@

array_init(sugg);

-   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
+   suggs = enchant_dict_suggest(pdict-pdict, word, wordlen, 
n_sugg_st);
memcpy(n_sugg, n_sugg_st, sizeof(n_sugg));
if (suggs  n_sugg) {
int i;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/NEWS branches/PHP_5_2/ext/xmlrpc/tests/bug51288.phpt branches/PHP_5_2/ext/xmlrpc/xmlrpc-epi-php.c branches/PHP_5_3/NEWS branches/PHP_5_3/ext/xmlrpc/tests/

2010-03-13 Thread Raphael Geissert
geissert Sat, 13 Mar 2010 18:40:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296152

Log:
Fix CVE-2010-0397: null pointer dereference when processing invalid XML-RPC
requests (bug #51288)

Bug: http://bugs.php.net/51288 (Closed) null pointer deref when methodName is 
not set
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
A   php/php-src/branches/PHP_5_2/ext/xmlrpc/tests/bug51288.phpt
U   php/php-src/branches/PHP_5_2/ext/xmlrpc/xmlrpc-epi-php.c
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug51288.phpt
U   php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c
A   php/php-src/trunk/ext/xmlrpc/tests/bug51288.phpt
U   php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-03-13 17:40:13 UTC (rev 296151)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-03-13 18:40:29 UTC (rev 296152)
@@ -3,6 +3,9 @@
 ?? ??? 2010, PHP 5.2.14
 - Updated timezone database to version 2010.3. (Derick)

+- Fixed a NULL pointer dereference when processing invalid XML-RPC
+  requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
+
 - Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
 - Fixed bug #51237 (milter SAPI crash on startup). (igmar at palsenberg dot 
com)
 - Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia,

Added: php/php-src/branches/PHP_5_2/ext/xmlrpc/tests/bug51288.phpt
===
--- php/php-src/branches/PHP_5_2/ext/xmlrpc/tests/bug51288.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/xmlrpc/tests/bug51288.phpt 2010-03-13 
18:40:29 UTC (rev 296152)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #51288 (CVE-2010-0397, NULL pointer deref when no methodName in request)
+--FILE--
+?php
+$method = NULL;
+$req = '?xml version=1.0?methodCall/methodCall';
+var_dump(xmlrpc_decode_request($req, $method));
+var_dump($method);
+echo Done\n;
+?
+--EXPECT--
+NULL
+NULL
+Done

Modified: php/php-src/branches/PHP_5_2/ext/xmlrpc/xmlrpc-epi-php.c
===
--- php/php-src/branches/PHP_5_2/ext/xmlrpc/xmlrpc-epi-php.c2010-03-13 
17:40:13 UTC (rev 296151)
+++ php/php-src/branches/PHP_5_2/ext/xmlrpc/xmlrpc-epi-php.c2010-03-13 
18:40:29 UTC (rev 296152)
@@ -723,6 +723,7 @@
zval* retval = NULL;
XMLRPC_REQUEST response;
STRUCT_XMLRPC_REQUEST_INPUT_OPTIONS opts = {{0}};
+   const char *method_name;
opts.xml_elem_opts.encoding = encoding_in ? 
utf8_get_encoding_id_from_string(Z_STRVAL_P(encoding_in)) : ENCODING_DEFAULT;

/* generate XMLRPC_REQUEST from raw xml */
@@ -733,10 +734,15 @@

if(XMLRPC_RequestGetRequestType(response) == 
xmlrpc_request_call) {
if(method_name_out) {
-   zval_dtor(method_name_out);
-   Z_TYPE_P(method_name_out) = IS_STRING;
-   Z_STRVAL_P(method_name_out) = 
estrdup(XMLRPC_RequestGetMethodName(response));
-   Z_STRLEN_P(method_name_out) = 
strlen(Z_STRVAL_P(method_name_out));
+   method_name = 
XMLRPC_RequestGetMethodName(response);
+   if (method_name) {
+   zval_dtor(method_name_out);
+   Z_TYPE_P(method_name_out) = IS_STRING;
+   Z_STRVAL_P(method_name_out) = 
estrdup(method_name);
+   Z_STRLEN_P(method_name_out) = 
strlen(Z_STRVAL_P(method_name_out));
+   } else {
+   retval = NULL;
+   }
}
}


Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-03-13 17:40:13 UTC (rev 296151)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-03-13 18:40:29 UTC (rev 296152)
@@ -6,6 +6,9 @@
 - Added stream filter support to mcrypt extension (ported from
   mcrypt_filter). (Stas)

+- Fixed a NULL pointer dereference when processing invalid XML-RPC
+  requests (Fixes CVE-2010-0397, bug #51288). (Raphael Geissert)
+
 - Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
 - Fixed bug #51257 (CURL_VERSION_LARGEFILE incorrectly used after libcurl
   version 7.10.1). (aron dot ujvari at microsec dot hu)

Added: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug51288.phpt
===
--- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug51288.phpt 
(rev 0

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/gd/tests/bug42434.phpt branches/PHP_5_2/ext/gd/tests/imageantialias_error1.phpt branches/PHP_5_2/ext/gd/tests/imageantialias_error2.phpt branches/PHP_

2010-03-10 Thread Raphael Geissert
geissert Thu, 11 Mar 2010 05:49:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=296058

Log:
Properly skip tests that require the bundled gd lib when the external is used

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/gd/tests/bug42434.phpt
U   php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error1.phpt
U   php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error2.phpt
U   php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_basic.phpt
U   php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error1.phpt
U   php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error3.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/bug42434.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imageantialias_error1.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imageantialias_error2.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imagelayereffect_basic.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imagelayereffect_error1.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imagelayereffect_error2.phpt
U   php/php-src/branches/PHP_5_3/ext/gd/tests/imagelayereffect_error3.phpt
U   php/php-src/trunk/ext/gd/tests/bug42434.phpt
U   php/php-src/trunk/ext/gd/tests/imageantialias_error1.phpt
U   php/php-src/trunk/ext/gd/tests/imageantialias_error2.phpt
U   php/php-src/trunk/ext/gd/tests/imagelayereffect_basic.phpt
U   php/php-src/trunk/ext/gd/tests/imagelayereffect_error1.phpt
U   php/php-src/trunk/ext/gd/tests/imagelayereffect_error2.phpt
U   php/php-src/trunk/ext/gd/tests/imagelayereffect_error3.phpt

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/bug42434.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/bug42434.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/bug42434.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -5,6 +5,7 @@
 if (!extension_loaded('gd')) {
 	die('skip gd extension not available');
 }
+if (!GD_BUNDLED) die(skip requires bundled GD library\n);
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error1.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error1.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -6,6 +6,7 @@
 --SKIPIF--
 ?php
 if (!extension_loaded(gd)) die(skip GD not present);
+if (!GD_BUNDLED) die(skip requires bundled GD library\n);
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error2.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error2.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imageantialias_error2.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -6,6 +6,7 @@
 --SKIPIF--
 ?php
 if (!extension_loaded(gd)) die(skip GD not present);
+if (!GD_BUNDLED) die(skip requires bundled GD library\n);
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_basic.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_basic.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_basic.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -6,7 +6,7 @@
 --SKIPIF--
 ?php
 	if (!extension_loaded(gd)) die(skip GD not present);
-	if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+	if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error1.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error1.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -6,7 +6,7 @@
 --SKIPIF--
 ?php
 	if (!extension_loaded(gd)) die(skip GD not present);
-	if (!GD_BUNDLED) die('function only available in bundled, external GD detected');
+	if (!GD_BUNDLED) die('skip function only available in bundled, external GD detected');
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error3.phpt
===
--- php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error3.phpt	2010-03-11 05:48:42 UTC (rev 296057)
+++ php/php-src/branches/PHP_5_2/ext/gd/tests/imagelayereffect_error3.phpt	2010-03-11 05:49:50 UTC (rev 296058)
@@ -6,7 +6,7 @@
 --SKIPIF--
 ?php
 	if (!extension_loaded(gd)) 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/filter/logical_filters.c branches/PHP_5_2/ext/filter/tests/046.phpt branches/PHP_5_3/ext/filter/logical_filters.c branches/PHP_5_3/ext/filter/tests/04

2010-03-06 Thread Raphael Geissert
geissert Sat, 06 Mar 2010 18:54:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295896

Log:
Detect overflows before they occur in the filter extension (bug #51023)
Thanks to Sean Finney for the patch

Bug: http://bugs.php.net/51023 (Open) ext/filter/tests/046.phpt fails, does not 
detect int overflow (with -O2 gcc 4.4)
  
Changed paths:
U   php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c
U   php/php-src/branches/PHP_5_2/ext/filter/tests/046.phpt
U   php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c
U   php/php-src/branches/PHP_5_3/ext/filter/tests/046.phpt
U   php/php-src/trunk/ext/filter/logical_filters.c
U   php/php-src/trunk/ext/filter/tests/046.phpt

Modified: php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c
===
--- php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c	2010-03-06 16:55:43 UTC (rev 295895)
+++ php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c	2010-03-06 18:54:55 UTC (rev 295896)
@@ -68,7 +68,7 @@

 static int php_filter_parse_int(const char *str, unsigned int str_len, long *ret TSRMLS_DC) { /* {{{ */
 	long ctx_value;
-	int sign = 0;
+	int sign = 0, digit = 0;
 	const char *end = str + str_len;

 	switch (*str) {
@@ -82,7 +82,7 @@

 	/* must start with 1..9*/
 	if (str  end  *str = '1'  *str = '9') {
-		ctx_value = ((*(str++)) - '0');
+		ctx_value = ((sign)?-1:1) * ((*(str++)) - '0');
 	} else {
 		return -1;
 	}
@@ -95,19 +95,18 @@

 	while (str  end) {
 		if (*str = '0'  *str = '9') {
-			ctx_value = (ctx_value * 10) + (*(str++) - '0');
+			digit = (*(str++) - '0');
+			if ( (!sign)  ctx_value = (LONG_MAX-digit)/10 ) {
+ctx_value = (ctx_value * 10) + digit;
+			} else if ( sign  ctx_value = (LONG_MIN+digit)/10) {
+ctx_value = (ctx_value * 10) - digit;
+			} else {
+return -1;
+			}
 		} else {
 			return -1;
 		}
 	}
-	if (sign) {
-		ctx_value = -ctx_value;
-		if (ctx_value  0) { /* overflow */
-			return -1;
-		}
-	} else if (ctx_value  0) { /* overflow */
-		return -1;
-	}

 	*ret = ctx_value;
 	return 1;

Modified: php/php-src/branches/PHP_5_2/ext/filter/tests/046.phpt
===
--- php/php-src/branches/PHP_5_2/ext/filter/tests/046.phpt	2010-03-06 16:55:43 UTC (rev 295895)
+++ php/php-src/branches/PHP_5_2/ext/filter/tests/046.phpt	2010-03-06 18:54:55 UTC (rev 295896)
@@ -4,16 +4,46 @@
 ?php if (!extension_loaded(filter)) die(skip); ?
 --FILE--
 ?php
-$s = sprintf(%d, PHP_INT_MAX);
-var_dump(is_long(filter_var($s, FILTER_VALIDATE_INT)));
+$max = sprintf(%d, PHP_INT_MAX);
+switch($max) {
+case 2147483647: /* 32-bit systems */
+	$min = -2147483648;
+	$overflow = 2147483648;
+	$underflow = -2147483649;
+	break;
+case 9223372036854775807: /* 64-bit systems */
+	$min = -9223372036854775808;
+	$overflow = 9223372036854775808;
+	$underflow = -9223372036854775809;
+	break;
+default:
+	die(failed: unknown value for PHP_MAX_INT);
+	break;
+}

-$s = sprintf(%.0f, PHP_INT_MAX+1);
-var_dump(filter_var($s, FILTER_VALIDATE_INT));
+function test_validation($val, $msg) {
+	$f = filter_var($val, FILTER_VALIDATE_INT);
+	echo $msg filtered: ; var_dump($f); // filtered value (or false)
+	echo $msg is_long: ; var_dump(is_long($f)); // test validation
+	echo $msg equal: ; var_dump($val == $f); // test equality of result
+}

-$s = sprintf(%d, -PHP_INT_MAX);
-var_dump(is_long(filter_var($s, FILTER_VALIDATE_INT)));
+// PHP_INT_MAX
+test_validation($max, max);
+test_validation($overflow, overflow);
+test_validation($min, min);
+test_validation($underflow, underflow);
 ?
---EXPECT--
-bool(true)
-bool(false)
-bool(true)
+--EXPECTF--
+max filtered: int(%d)
+max is_long: bool(true)
+max equal: bool(true)
+overflow filtered: bool(false)
+overflow is_long: bool(false)
+overflow equal: bool(false)
+min filtered: int(-%d)
+min is_long: bool(true)
+min equal: bool(true)
+underflow filtered: bool(false)
+underflow is_long: bool(false)
+underflow equal: bool(false)

Modified: php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c
===
--- php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c	2010-03-06 16:55:43 UTC (rev 295895)
+++ php/php-src/branches/PHP_5_3/ext/filter/logical_filters.c	2010-03-06 18:54:55 UTC (rev 295896)
@@ -68,7 +68,7 @@

 static int php_filter_parse_int(const char *str, unsigned int str_len, long *ret TSRMLS_DC) { /* {{{ */
 	long ctx_value;
-	int sign = 0;
+	int sign = 0, digit = 0;
 	const char *end = str + str_len;

 	switch (*str) {
@@ -82,7 +82,7 @@

 	/* must start with 1..9*/
 	if (str  end  *str = '1'  *str = '9') {
-		ctx_value = ((*(str++)) - '0');
+		ctx_value = ((sign)?-1:1) * ((*(str++)) - '0');
 	} else {
 		return -1;
 	}
@@ -95,19 +95,18 @@

 	while (str  end) {
 		if (*str = '0'  *str = '9') {
-			ctx_value = (ctx_value * 10) + (*(str++) - '0');
+			digit = 

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_2/NEWS PHP_5_3/NEWS

2010-03-06 Thread Raphael Geissert
geissert Sat, 06 Mar 2010 20:02:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295901

Log:
Add NEWS entries for filter overflow fix

Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS   2010-03-06 19:19:09 UTC (rev 295900)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-03-06 20:02:25 UTC (rev 295901)
@@ -11,6 +11,8 @@
   an invalid option is provided). (Ilia)
 - Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
 - Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris 
Jones)
+- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).
+  (Raphael Geissert)
 - Fixed bug #49267 (Linking fails for iconv). (Moriyosh)
 - Fixed bug #43314 (iconv_mime_encode(), broken Q scheme). (Rasmus)
 - Fixed bug #23229 (syslog function truncates messages). (Adam)

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-03-06 19:19:09 UTC (rev 295900)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-03-06 20:02:25 UTC (rev 295901)
@@ -16,6 +16,8 @@
   parsing date strings). (Derick)
 - Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
 - Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris 
Jones)
+- Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).
+  (Raphael Geissert)
 - Fixed bug #50999 (unaligned memory access in dba_fetch()). (Felipe)
 - Fixed bug #50731 (Inconsistent namespaces sent to functions registered with
   spl_autoload_register). (Felipe)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/sysvmsg/tests/004.phpt branches/PHP_5_2/ext/sysvmsg/tests/005.phpt branches/PHP_5_2/ext/sysvmsg/tests/006.phpt branches/PHP_5_3/ext/sysvmsg/tests/004.

2010-02-28 Thread Raphael Geissert
geissert Mon, 01 Mar 2010 01:59:14 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295612

Log:
Add some sysvmsg coverage tests

Changed paths:
A   php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/004.phpt
A   php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/005.phpt
A   php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/006.phpt
A   php/php-src/branches/PHP_5_3/ext/sysvmsg/tests/004.phpt
A   php/php-src/branches/PHP_5_3/ext/sysvmsg/tests/005.phpt
A   php/php-src/branches/PHP_5_3/ext/sysvmsg/tests/006.phpt
A   php/php-src/trunk/ext/sysvmsg/tests/004.phpt
A   php/php-src/trunk/ext/sysvmsg/tests/005.phpt
A   php/php-src/trunk/ext/sysvmsg/tests/006.phpt

Added: php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/004.phpt
===
--- php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/004.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/004.phpt	2010-03-01 01:59:14 UTC (rev 295612)
@@ -0,0 +1,59 @@
+--TEST--
+msg_set_queue() and msg_stat_queue()
+--SKIPIF--
+?php if (!extension_loaded(sysvmsg)) die(skip sysvmsg extension is not available)?
+--FILE--
+?php
+$id = ftok(__FILE__, 'r');
+
+$q = msg_get_queue($id);
+
+echo Set mode:\n;
+$arr = array('msg_perm.mode' = 0600);
+var_dump(msg_set_queue($q, $arr));
+echo Did really work:\n;
+var_dump(count(array_diff_assoc($arr, msg_stat_queue($q))) == 0);
+
+echo Set uid:\n; // same as the running user to make it succeed
+$arr = array('msg_perm.uid' = getmyuid());
+var_dump(msg_set_queue($q, $arr));
+echo Did really work:\n;
+var_dump(count(array_diff_assoc($arr, msg_stat_queue($q))) == 0);
+
+echo Set gid:\n; // same as the running user to make it succeed
+$arr = array('msg_perm.gid' = getmygid());
+var_dump(msg_set_queue($q, $arr));
+echo Did really work:\n;
+var_dump(count(array_diff_assoc($arr, msg_stat_queue($q))) == 0);
+
+echo Set smaller qbytes:\n;
+$res = msg_stat_queue($q);
+$arr = array('msg_qbytes' = ($res['msg_qbytes'] -1));
+var_dump(msg_set_queue($q, $arr));
+echo Did really work:\n;
+var_dump(count(array_diff_assoc($arr, msg_stat_queue($q))) == 0);
+
+if (!msg_remove_queue($q)) {
+echo BAD: queue removal failed\n;
+}
+
+echo Done\n;
+?
+--EXPECTF--
+Set mode:
+bool(true)
+Did really work:
+bool(true)
+Set uid:
+bool(true)
+Did really work:
+bool(true)
+Set gid:
+bool(true)
+Did really work:
+bool(true)
+Set smaller qbytes:
+bool(true)
+Did really work:
+bool(true)
+Done

Added: php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/005.phpt
===
--- php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/005.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/005.phpt	2010-03-01 01:59:14 UTC (rev 295612)
@@ -0,0 +1,71 @@
+--TEST--
+sysvmsg functions on non-existing queue
+--SKIPIF--
+?php if (!extension_loaded(sysvmsg)) die(skip sysvmsg extension is not available)?
+--FILE--
+?php
+
+$tests = array(null, 'foo');
+
+foreach ($tests as $q) {
+
+if ($q === null) {
+	do {
+	$id = ftok(__FILE__, chr(mt_rand(0, 255)));
+	} while (msg_queue_exists($id));
+
+	$q = msg_get_queue($id) or die(Failed to create queue);
+	msg_remove_queue($q) or die(Failed to close queue);
+}
+
+echo Using '$q' as queue resource:\n;
+
+$errno = 0;
+
+var_dump(msg_set_queue($q, array('msg_qbytes' = 1)));
+
+var_dump(msg_stat_queue($q));
+
+var_dump(msg_receive($q, 0, $null, 1, $msg, true, 0, $errno));
+var_dump($errno != 0);
+// again, but triggering an E_WARNING
+var_dump(msg_receive($q, 0, $null, 0, $msg));
+
+var_dump(msg_send($q, 1, 'foo', true, true, $errno));
+var_dump($errno != 0);
+}
+
+echo Done\n;
+?
+--EXPECTF--
+Using 'Resource id #4' as queue resource:
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+
+Warning: msg_receive(): maximum size of the message has to be greater than zero in %s on line %d
+bool(false)
+
+Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d
+bool(false)
+bool(true)
+Using 'foo' as queue resource:
+
+Warning: msg_set_queue() expects parameter 1 to be resource, string given in %s on line %d
+bool(false)
+
+Warning: msg_stat_queue() expects parameter 1 to be resource, string given in %s on line %d
+bool(false)
+
+Warning: msg_receive() expects parameter 1 to be resource, string given in %s on line %d
+bool(false)
+bool(false)
+
+Warning: msg_receive() expects parameter 1 to be resource, string given in %s on line %d
+bool(false)
+
+Warning: msg_send() expects parameter 1 to be resource, string given in %s on line %d
+bool(false)
+bool(false)
+Done

Added: php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/006.phpt
===
--- php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/006.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/ext/sysvmsg/tests/006.phpt	

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/strtoupper1.phpt branches/PHP_5_3/ext/standard/tests/strings/strtoupper1.phpt trunk/ext/standard/tests/strings/strtoupper1.phpt

2010-02-21 Thread Raphael Geissert
geissert Sun, 21 Feb 2010 18:22:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295311

Log:
Fix the name of the locale in some tests

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtoupper1.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtoupper1.phpt
U   php/php-src/trunk/ext/standard/tests/strings/strtoupper1.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtoupper1.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtoupper1.phpt
2010-02-21 18:16:36 UTC (rev 295310)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtoupper1.phpt
2010-02-21 18:22:46 UTC (rev 295311)
@@ -2,8 +2,8 @@
 Test strtoupper() function
 --SKIPIF--
 ?php
-if (!...@setlocale(LC_ALL, 'en-US.UTF-8'))
-  die('skip need en-US.UTF-8 locale');
+if (!...@setlocale(LC_ALL, 'en_US.UTF-8'))
+  die('skip need en_US.UTF-8 locale');
 ?
 --FILE--
 ?php
@@ -13,7 +13,7 @@
  Returns string with all alphabetic characters converted to uppercase
 */

-setlocale(LC_ALL, 'en-US.UTF-8');
+setlocale(LC_ALL, 'en_US.UTF-8');

 echo *** Testing strtoupper() with all 256 chars ***\n;
 for ($i=0; $i=255; $i++){

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtoupper1.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtoupper1.phpt
2010-02-21 18:16:36 UTC (rev 295310)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtoupper1.phpt
2010-02-21 18:22:46 UTC (rev 295311)
@@ -8,7 +8,7 @@
   }
 } else {
   if (!setlocale(LC_ALL, 'en_US.UTF-8', 'en')) {
-die('skip need en-US.UTF-8 locale');
+die('skip need en_US.UTF-8 locale');
   }
 }
 ?
@@ -22,7 +22,7 @@
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   setlocale(LC_ALL, 'C');
 } else {
-  setlocale(LC_ALL, 'en-US.UTF-8');
+  setlocale(LC_ALL, 'en_US.UTF-8');
 }

 echo *** Testing strtoupper() with all 256 chars ***\n;

Modified: php/php-src/trunk/ext/standard/tests/strings/strtoupper1.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/strtoupper1.phpt   
2010-02-21 18:16:36 UTC (rev 295310)
+++ php/php-src/trunk/ext/standard/tests/strings/strtoupper1.phpt   
2010-02-21 18:22:46 UTC (rev 295311)
@@ -8,7 +8,7 @@
   }
 } else {
   if (!setlocale(LC_ALL, 'en_US.UTF-8', 'en')) {
-die('skip need en-US.UTF-8 locale');
+die('skip need en_US.UTF-8 locale');
   }
 }
 ?
@@ -22,7 +22,7 @@
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   setlocale(LC_ALL, 'C');
 } else {
-  setlocale(LC_ALL, 'en-US.UTF-8');
+  setlocale(LC_ALL, 'en_US.UTF-8');
 }

 echo *** Testing strtoupper() with all 256 chars ***\n;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/build/shtool branches/PHP_5_3/build/shtool trunk/build/shtool

2010-02-17 Thread Raphael Geissert
geissert Thu, 18 Feb 2010 00:30:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295225

Log:
Fix race condition in shtool's mkdir -p implementation (bug #51076)

Bug: http://bugs.php.net/51076 (Open) race condition in shtool's mkdir -p 
implementation
  
Changed paths:
U   php/php-src/branches/PHP_5_2/build/shtool
U   php/php-src/branches/PHP_5_3/build/shtool
U   php/php-src/trunk/build/shtool

Modified: php/php-src/branches/PHP_5_2/build/shtool
===
--- php/php-src/branches/PHP_5_2/build/shtool   2010-02-18 00:10:10 UTC (rev 
295224)
+++ php/php-src/branches/PHP_5_2/build/shtool   2010-02-18 00:30:12 UTC (rev 
295225)
@@ -991,7 +991,11 @@
 if [ .$opt_t = .yes ]; then
 echo mkdir $pathcomp 12
 fi
-mkdir $pathcomp || errstatus=$?
+mkdir $pathcomp || {
+_errstatus=$?
+[ -d $pathcomp ] || errstatus=${_errstatus}
+unset _errstatus
+}
 if [ .$opt_o != . ]; then
 if [ .$opt_t = .yes ]; then
 echo chown $opt_o $pathcomp 12

Modified: php/php-src/branches/PHP_5_3/build/shtool
===
--- php/php-src/branches/PHP_5_3/build/shtool   2010-02-18 00:10:10 UTC (rev 
295224)
+++ php/php-src/branches/PHP_5_3/build/shtool   2010-02-18 00:30:12 UTC (rev 
295225)
@@ -991,7 +991,11 @@
 if [ .$opt_t = .yes ]; then
 echo mkdir $pathcomp 12
 fi
-mkdir $pathcomp || errstatus=$?
+mkdir $pathcomp || {
+_errstatus=$?
+[ -d $pathcomp ] || errstatus=${_errstatus}
+unset _errstatus
+}
 if [ .$opt_o != . ]; then
 if [ .$opt_t = .yes ]; then
 echo chown $opt_o $pathcomp 12

Modified: php/php-src/trunk/build/shtool
===
--- php/php-src/trunk/build/shtool  2010-02-18 00:10:10 UTC (rev 295224)
+++ php/php-src/trunk/build/shtool  2010-02-18 00:30:12 UTC (rev 295225)
@@ -991,7 +991,11 @@
 if [ .$opt_t = .yes ]; then
 echo mkdir $pathcomp 12
 fi
-mkdir $pathcomp || errstatus=$?
+mkdir $pathcomp || {
+_errstatus=$?
+[ -d $pathcomp ] || errstatus=${_errstatus}
+unset _errstatus
+}
 if [ .$opt_o != . ]; then
 if [ .$opt_t = .yes ]; then
 echo chown $opt_o $pathcomp 12

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/general_functions/getservbyname_basic.phpt branches/PHP_5_3/ext/standard/tests/general_functions/getservbyname_basic.phpt trunk/ext/sta

2010-02-15 Thread Raphael Geissert
geissert Tue, 16 Feb 2010 05:38:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295137

Log:
Correct description of getservbyname_basic.phpt (bug #51022)

Bug: http://bugs.php.net/51022 (Feedback) getservbyname_basic.phpt has 
incorrect description and misses a skip case
  
Changed paths:
U   
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/getservbyname_basic.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/getservbyname_basic.phpt
U   
php/php-src/trunk/ext/standard/tests/general_functions/getservbyname_basic.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/getservbyname_basic.phpt
===
--- 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/getservbyname_basic.phpt
  2010-02-16 05:25:39 UTC (rev 295136)
+++ 
php/php-src/branches/PHP_5_2/ext/standard/tests/general_functions/getservbyname_basic.phpt
  2010-02-16 05:38:50 UTC (rev 295137)
@@ -1,5 +1,5 @@
 --TEST--
-Test function getservbyport() by calling it more than or less than its 
expected arguments
+Test function getservbyname()
 --CREDITS--
 Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbru...@grupporetina.com)

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/getservbyname_basic.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/getservbyname_basic.phpt
  2010-02-16 05:25:39 UTC (rev 295136)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/getservbyname_basic.phpt
  2010-02-16 05:38:50 UTC (rev 295137)
@@ -1,5 +1,5 @@
 --TEST--
-Test function getservbyport() by calling it more than or less than its 
expected arguments
+Test function getservbyname()
 --CREDITS--
 Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbru...@grupporetina.com)

Modified: 
php/php-src/trunk/ext/standard/tests/general_functions/getservbyname_basic.phpt
===
--- 
php/php-src/trunk/ext/standard/tests/general_functions/getservbyname_basic.phpt 
2010-02-16 05:25:39 UTC (rev 295136)
+++ 
php/php-src/trunk/ext/standard/tests/general_functions/getservbyname_basic.phpt 
2010-02-16 05:38:50 UTC (rev 295137)
@@ -1,5 +1,5 @@
 --TEST--
-Test function getservbyport() by calling it more than or less than its 
expected arguments
+Test function getservbyname()
 --CREDITS--
 Italian PHP TestFest 2009 Cesena 19-20-21 june
 Fabio Fabbrucci (fabbru...@grupporetina.com)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/standard/tests/strings/strtolower.phpt branches/PHP_5_3/ext/standard/tests/strings/strtolower.phpt trunk/ext/standard/tests/strings/strtolower.phpt

2010-02-13 Thread Raphael Geissert
geissert Sat, 13 Feb 2010 16:43:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=295010

Log:
Fix strtolower.phpt (bug #51031)

Bug: http://bugs.php.net/51031 (Assigned) strtolower.phpt fails
  
Changed paths:
U   php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtolower.phpt
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtolower.phpt
U   php/php-src/trunk/ext/standard/tests/strings/strtolower.phpt

Modified: 
php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtolower.phpt
===
--- php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtolower.phpt 
2010-02-13 15:43:45 UTC (rev 295009)
+++ php/php-src/branches/PHP_5_2/ext/standard/tests/strings/strtolower.phpt 
2010-02-13 16:43:04 UTC (rev 295010)
@@ -2,8 +2,8 @@
 Test strtolower() function
 --SKIPIF--
 ?php
-if (!setlocale(LC_ALL, 'en-US.UTF-8'))
-  die('skip need en-US.UTF-8 locale');
+if (!setlocale(LC_ALL, 'en_US.UTF-8'))
+  die('skip need en_US.UTF-8 locale');
 ?
 --FILE--
 ?php
@@ -13,7 +13,7 @@
  Returns string with all alphabetic characters converted to lowercase.
 */

-setlocale(LC_ALL, 'en-US.UTF-8');
+setlocale(LC_ALL, 'en_US.UTF-8');

 echo *** Testing strtolower() with all 256 chars ***\n;
 for ($i=0; $i=255; $i++){

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtolower.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtolower.phpt 
2010-02-13 15:43:45 UTC (rev 295009)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/strtolower.phpt 
2010-02-13 16:43:04 UTC (rev 295010)
@@ -8,7 +8,7 @@
   }
 } else {
   if (!setlocale(LC_ALL, 'en_US.UTF-8', 'en')) {
-die('skip need en-US.UTF-8 locale');
+die('skip need en_US.UTF-8 locale');
   }
 }
 ?
@@ -22,7 +22,7 @@
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   setlocale(LC_ALL, 'C');
 } else {
-  setlocale(LC_ALL, 'en-US.UTF-8');
+  setlocale(LC_ALL, 'en_US.UTF-8');
 }

 echo *** Testing strtolower() with all 256 chars ***\n;

Modified: php/php-src/trunk/ext/standard/tests/strings/strtolower.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/strtolower.phpt
2010-02-13 15:43:45 UTC (rev 295009)
+++ php/php-src/trunk/ext/standard/tests/strings/strtolower.phpt
2010-02-13 16:43:04 UTC (rev 295010)
@@ -8,7 +8,7 @@
   }
 } else {
   if (!setlocale(LC_ALL, 'en_US.UTF-8', 'en')) {
-die('skip need en-US.UTF-8 locale');
+die('skip need en_US.UTF-8 locale');
   }
 }
 ?
@@ -22,7 +22,7 @@
 if( substr(PHP_OS, 0, 3) == 'WIN') {
   setlocale(LC_ALL, 'C');
 } else {
-  setlocale(LC_ALL, 'en-US.UTF-8');
+  setlocale(LC_ALL, 'en_US.UTF-8');
 }

 echo *** Testing strtolower() with all 256 chars ***\n;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php