[PHP-CVS] com php-src: These getpwnam('') tests are silly and not portable: ext/posix/tests/posix_getgrnam.phpt ext/posix/tests/posix_getgrnam_basic.phpt ext/posix/tests/posix_getpwnam.phpt ext/posix/

2013-10-21 Thread Rasmus Lerdorf
Commit:2129de4569bec4acd89e5824a471f59d887c5b57
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
14:04:47 -0700
Parents:   288a4ec3bd4a9e93d9cadc045d6ca9472081a3ec
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=2129de4569bec4acd89e5824a471f59d887c5b57

Log:
These getpwnam('') tests are silly and not portable

Changed paths:
  D  ext/posix/tests/posix_getgrnam.phpt
  D  ext/posix/tests/posix_getgrnam_basic.phpt
  D  ext/posix/tests/posix_getpwnam.phpt
  D  ext/posix/tests/posix_getpwnam_basic.phpt


Diff:
diff --git a/ext/posix/tests/posix_getgrnam.phpt 
b/ext/posix/tests/posix_getgrnam.phpt
deleted file mode 100644
index 854db4a..000
--- a/ext/posix/tests/posix_getgrnam.phpt
+++ /dev/null
@@ -1,19 +0,0 @@
---TEST--
-posix_getgrnam(): Basic tests
---SKIPIF--
-?php
-if (!extension_loaded('posix')) die('skip - POSIX extension not loaded'); 
-if (!function_exists('posix_getgrnam')) die('skip posix_getgrnam() not found');
-?
---FILE--
-?php
-
-var_dump(posix_getgrnam(NULL));
-var_dump(posix_getgrnam(1));
-var_dump(posix_getgrnam(''));
-
-?
---EXPECT--
-bool(false)
-bool(false)
-bool(false)
diff --git a/ext/posix/tests/posix_getgrnam_basic.phpt 
b/ext/posix/tests/posix_getgrnam_basic.phpt
deleted file mode 100644
index fd5bf23..000
--- a/ext/posix/tests/posix_getgrnam_basic.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-posix_getgrnam(): Basic tests
---SKIPIF--
-?php
-if (!extension_loaded('posix')) die('skip - POSIX extension not loaded'); 
-if (!function_exists('posix_getgrnam')) die('skip posix_getgrnam() not found');
-?
---FILE--
-?php
-echo Basic test of POSIX posix_getgrnam function\n;  
-
-var_dump(posix_getgrnam(NULL));
-var_dump(posix_getgrnam(1));
-var_dump(posix_getgrnam(''));
-
-?
-===DONE===
---EXPECT--
-Basic test of POSIX posix_getgrnam function
-bool(false)
-bool(false)
-bool(false)
-===DONE===
\ No newline at end of file
diff --git a/ext/posix/tests/posix_getpwnam.phpt 
b/ext/posix/tests/posix_getpwnam.phpt
deleted file mode 100644
index b5de1e4..000
--- a/ext/posix/tests/posix_getpwnam.phpt
+++ /dev/null
@@ -1,19 +0,0 @@
---TEST--
-posix_getpwnam(): Basic tests
---SKIPIF--
-?php
-if (!extension_loaded('posix')) die('skip - POSIX extension not loaded'); 
-if (!function_exists('posix_getpwnam')) die('skip posix_getpwnam() not found');
-?
---FILE--
-?php
-
-var_dump(posix_getpwnam(1));
-var_dump(posix_getpwnam(''));
-var_dump(posix_getpwnam(NULL));
-
-?
---EXPECT--
-bool(false)
-bool(false)
-bool(false)
diff --git a/ext/posix/tests/posix_getpwnam_basic.phpt 
b/ext/posix/tests/posix_getpwnam_basic.phpt
deleted file mode 100644
index d675d6c..000
--- a/ext/posix/tests/posix_getpwnam_basic.phpt
+++ /dev/null
@@ -1,23 +0,0 @@
---TEST--
-posix_getpwnam(): Basic tests
---SKIPIF--
-?php
-if (!extension_loaded('posix')) die('skip - POSIX extension not loaded'); 
-if (!function_exists('posix_getpwnam')) die('skip posix_getpwnam() not found');
-?
---FILE--
-?php
-echo Basic test of POSIX posix_getpwnam function\n; 
-
-var_dump(posix_getpwnam(1));
-var_dump(posix_getpwnam(''));
-var_dump(posix_getpwnam(NULL));
-
-?
-===DONE
---EXPECT--
-Basic test of POSIX posix_getpwnam function
-bool(false)
-bool(false)
-bool(false)
-===DONE


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/standard/basic_functions.c

2013-10-21 Thread Antony Dovgal
Commit:605b3c2ca1b8d29125f49a14b08f848368fc3d17
Author:Antony Dovgal tony2...@php.net Mon, 21 Oct 2013 15:10:15 
+0400
Parents:   4ddbb7dd1537580bd5b4291e8a3b93cf656d2a70 
b636c03426193ecf0b7e166126a14b70ce8185e9
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=605b3c2ca1b8d29125f49a14b08f848368fc3d17

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  fix bug #65936 (dangling context pointer causes crash)

Bugs:
https://bugs.php.net/65936

Changed paths:
  MM  ext/standard/basic_functions.c


Diff:



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



[PHP-CVS] com php-src: Fixed compilation warning: ext/opcache/ZendAccelerator.c

2013-10-21 Thread Dmitry Stogov
Commit:60ce3811ae3b86eb7bfb86cc965e3f79e61bfc4a
Author:Dmitry Stogov dmi...@zend.com Mon, 21 Oct 2013 14:17:10 
+0400
Parents:   098855433dc5d609e3970f0bc9d6766c007273f3
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=60ce3811ae3b86eb7bfb86cc965e3f79e61bfc4a

Log:
Fixed compilation warning

Changed paths:
  M  ext/opcache/ZendAccelerator.c


Diff:
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 48ff730..8cee80f 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -150,7 +150,7 @@ static inline int is_phar_relative_alias_path(const char 
*filename, char **alias
if (memcmp(filename, phar://, sizeof(phar://) - 1) == 0
 filename[sizeof(phar://) - 1] != '\0'  
filename[sizeof(phar://) - 1] != '/') {
char *slash;
-   *alias = filename + sizeof(phar://) - 1;
+   *alias = (char*)filename + sizeof(phar://) - 1;
slash = strstr(*alias, /);
if (slash) {
*alias_len = slash - *alias;


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: sapi/fpm/fpm/fastcgi.c

2013-10-21 Thread Rasmus Lerdorf
Commit:9e4651f6f181e0d90daab2a97fb57a76fe105a29
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
17:56:14 -0700
Parents:   2129de4569bec4acd89e5824a471f59d887c5b57 
18cc5386de399f4410d8e5bf0a7aa5a06b0309be
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9e4651f6f181e0d90daab2a97fb57a76fe105a29

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fix typo

Changed paths:
  MM  sapi/fpm/fpm/fastcgi.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/php_date.c

2013-10-21 Thread Stanislav Malyshev
Commit:cb47396d4601656173cffadf86f6342bcba5e2b7
Author:Stanislav Malyshev s...@php.net Mon, 21 Oct 2013 00:02:21 
-0700
Parents:   00697927d8d99bec2c7135fe62d5807544fe12f8 
f860486de5805eefd63af5d750c913e1515970c8
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=cb47396d4601656173cffadf86f6342bcba5e2b7

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix memory leak on error (from Coverity scan)

Changed paths:
  MM  ext/date/php_date.c


Diff:



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



[PHP-CVS] com php-src: - Fixed possible uninitialized scalar variable usage (spotted by Coverity): ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c ext/mbstring/libmbfl/filters/mbfilter_sjis_2

2013-10-20 Thread Felipe Pena
Commit:33d377e7012865e1622e58886416653ec874dcd7
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 08:51:09 
-0200
Parents:   a1daebefda6b481450e3b9ec7461609a09e4f578
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=33d377e7012865e1622e58886416653ec874dcd7

Log:
- Fixed possible uninitialized scalar variable usage (spotted by Coverity)

Changed paths:
  M  ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
  M  ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
  M  ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
  M  ext/mbstring/libmbfl/mbfl/mbfilter.c


Diff:
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 
b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
index 4deb029..03e9633 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
@@ -142,7 +142,7 @@ const struct mbfl_convert_vtbl vtbl_wchar_2022jp_kddi = {
 int
 mbfl_filt_conv_2022jp_mobile_wchar(int c, mbfl_convert_filter *filter)
 {
-   int c1, s, w, snd;
+   int c1, s, w, snd = 0;
 
 retry:
switch (filter-status  0xf) {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 
b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
index 4e1838f..87bb2f2 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
@@ -134,7 +134,7 @@ int
 mbfl_filt_conv_jis2004_wchar(int c, mbfl_convert_filter *filter)
 {
int k;
-   int c1, c2, s, s1, s2, w = 0, w1;
+   int c1, c2, s, s1 = 0, s2 = 0, w = 0, w1;
 
 retry:
switch (filter-status  0xf) {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 
b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
index 7a549af..93ac346 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
@@ -605,7 +605,7 @@ mbfilter_unicode2sjis_emoji_sb(int c, int *s1, 
mbfl_convert_filter *filter)
 int
 mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter)
 {
-   int c1, s, s1, s2, w;
+   int c1, s, s1 = 0, s2 = 0, w;
int snd = 0;
 
 retry:
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c 
b/ext/mbstring/libmbfl/mbfl/mbfilter.c
index b3759f9..3b14727 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter.c
@@ -985,7 +985,7 @@ mbfl_strpos(
 {
int result;
mbfl_string _haystack_u8, _needle_u8;
-   const mbfl_string *haystack_u8, *needle_u8;
+   const mbfl_string *haystack_u8, *needle_u8 = NULL;
const unsigned char *u8_tbl;
 
if (haystack == NULL || haystack-val == NULL || needle == NULL || 
needle-val == NULL) {


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



[PHP-CVS] com php-src: - Fixed possible NULL ptr dereference: ext/phar/util.c

2013-10-20 Thread Felipe Pena
Commit:52555a78946cd91034f86eb4ad03c2d76cbef0cd
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:04:24 
-0200
Parents:   b6feabc8c64377f621448a65564bdf33d0de6866
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=52555a78946cd91034f86eb4ad03c2d76cbef0cd

Log:
- Fixed possible NULL ptr dereference

Changed paths:
  M  ext/phar/util.c


Diff:
diff --git a/ext/phar/util.c b/ext/phar/util.c
index 898d8bd..227bd15 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -1262,8 +1262,10 @@ alias_success:
spprintf(error, 0, alias \%s\ is 
already used for archive \%s\ cannot be overloaded with \%s\, alias, 
(*fd_ptr)-fname, fname);
}
if (SUCCESS == phar_free_alias(*fd_ptr, alias, 
alias_len TSRMLS_CC)) {
-   efree(*error);
-   *error = NULL;
+   if (error) {
+   efree(*error);
+   *error = NULL;
+   }
}
return FAILURE;
}


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/phar/util.c

2013-10-20 Thread Felipe Pena
Commit:d23f089fb94b8a3fec07d58a6801fe078c32dd3e
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:04:36 
-0200
Parents:   b7c64683da3e8a632a37673052205d3cab6ad876 
5b0560efc3e803cdb59d161cb3cd660e388b211f
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d23f089fb94b8a3fec07d58a6801fe078c32dd3e

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  - Fixed possible NULL ptr dereference

Changed paths:
  MM  ext/phar/util.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/phar/util.c

2013-10-20 Thread Felipe Pena
Commit:5b0560efc3e803cdb59d161cb3cd660e388b211f
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:04:27 
-0200
Parents:   df31eb8fdcd3f1d45a799c397c8ca8573a76551b 
52555a78946cd91034f86eb4ad03c2d76cbef0cd
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5b0560efc3e803cdb59d161cb3cd660e388b211f

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  - Fixed possible NULL ptr dereference

Changed paths:
  MM  ext/phar/util.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/zip/php_zip.c

2013-10-20 Thread Felipe Pena
Commit:048923b3c6bec8a7aed97015e8a3597ae1898b3d
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:50:17 
-0200
Parents:   d23f089fb94b8a3fec07d58a6801fe078c32dd3e 
8aa19c9fd8bcccd76d5246064fd4eab4e4b5c4f2
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=048923b3c6bec8a7aed97015e8a3597ae1898b3d

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  - Moved NULL check before dereferencing

Changed paths:
  MM  ext/zip/php_zip.c


Diff:



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



[PHP-CVS] com php-src: - Moved NULL check before dereferencing: ext/zip/php_zip.c

2013-10-20 Thread Felipe Pena
Commit:9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:50:11 
-0200
Parents:   52555a78946cd91034f86eb4ad03c2d76cbef0cd
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d

Log:
- Moved NULL check before dereferencing

Changed paths:
  M  ext/zip/php_zip.c


Diff:
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index df16383..1f435bb 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -102,14 +102,14 @@ static char * php_zip_make_relative_path(char *path, int 
path_len) /* {{{ */
char *path_begin = path;
size_t i;
 
-   if (IS_SLASH(path[0])) {
-   return path + 1;
-   }
-
if (path_len  1 || path == NULL) {
return NULL;
}
 
+   if (IS_SLASH(path[0])) {
+   return path + 1;
+   }
+
i = path_len;
 
while (1) {


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/zip/php_zip.c

2013-10-20 Thread Felipe Pena
Commit:8aa19c9fd8bcccd76d5246064fd4eab4e4b5c4f2
Author:Felipe Pena felipe...@gmail.com Sun, 20 Oct 2013 09:50:13 
-0200
Parents:   5b0560efc3e803cdb59d161cb3cd660e388b211f 
9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8aa19c9fd8bcccd76d5246064fd4eab4e4b5c4f2

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  - Moved NULL check before dereferencing

Changed paths:
  MM  ext/zip/php_zip.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/ftp/ftp.c

2013-10-20 Thread Rasmus Lerdorf
Commit:c5e5a6c2ac68b0007f3bfabd79cebe8163084b9f
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
08:56:24 -0700
Parents:   8aa19c9fd8bcccd76d5246064fd4eab4e4b5c4f2 
1494298231072d5991e76db5ef25f20e81018106
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c5e5a6c2ac68b0007f3bfabd79cebe8163084b9f

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Minor Coverity tweaks

Changed paths:
  MM  ext/ftp/ftp.c


Diff:



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



[PHP-CVS] com php-src: Minor Coverity tweaks: ext/ftp/ftp.c

2013-10-20 Thread Rasmus Lerdorf
Commit:1494298231072d5991e76db5ef25f20e81018106
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
08:55:48 -0700
Parents:   9976b5cd7f36d90b49d1dcf58ec6497f0e592b7d
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1494298231072d5991e76db5ef25f20e81018106

Log:
Minor Coverity tweaks

Changed paths:
  M  ext/ftp/ftp.c


Diff:
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 58d3c2e..4da8d60 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1643,7 +1643,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char 
*path TSRMLS_DC)
if (ftp-resp == 226) {
ftp-data = data_close(ftp, data);
php_stream_close(tmpstream);
-   return ecalloc(1, sizeof(char**));
+   return ecalloc(1, sizeof(char*));
}
 
/* pull data buffer into tmpfile */
@@ -1671,11 +1671,11 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char 
*path TSRMLS_DC)
}
}
 
-   ftp-data = data = data_close(ftp, data);
+   ftp-data = data_close(ftp, data);
 
php_stream_rewind(tmpstream);
 
-   ret = safe_emalloc((lines + 1), sizeof(char**), size * sizeof(char*));
+   ret = safe_emalloc((lines + 1), sizeof(char*), size * sizeof(char*));
 
entry = ret;
text = (char*) (ret + lines + 1);


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



[PHP-CVS] com php-src: Clean up this weird safe_emalloc() call: ext/ftp/ftp.c

2013-10-20 Thread Rasmus Lerdorf
Commit:8f4a6d6e1b6c36259a5dc865d16f0dad76f2f2c9
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
09:36:50 -0700
Parents:   1494298231072d5991e76db5ef25f20e81018106
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8f4a6d6e1b6c36259a5dc865d16f0dad76f2f2c9

Log:
Clean up this weird safe_emalloc() call

Changed paths:
  M  ext/ftp/ftp.c


Diff:
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 4da8d60..b82017e 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1675,7 +1675,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char 
*path TSRMLS_DC)
 
php_stream_rewind(tmpstream);
 
-   ret = safe_emalloc((lines + 1), sizeof(char*), size * sizeof(char*));
+   ret = safe_emalloc((lines + 1), sizeof(char*), size);
 
entry = ret;
text = (char*) (ret + lines + 1);


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/ftp/ftp.c

2013-10-20 Thread Rasmus Lerdorf
Commit:288a4ec3bd4a9e93d9cadc045d6ca9472081a3ec
Author:Rasmus Lerdorf ras...@lerdorf.com Sun, 20 Oct 2013 
09:37:25 -0700
Parents:   c5e5a6c2ac68b0007f3bfabd79cebe8163084b9f 
8f4a6d6e1b6c36259a5dc865d16f0dad76f2f2c9
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=288a4ec3bd4a9e93d9cadc045d6ca9472081a3ec

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Clean up this weird safe_emalloc() call

Changed paths:
  MM  ext/ftp/ftp.c


Diff:



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



[PHP-CVS] com php-src: fixed skeleton to produce the normalized ext version macros: ext/skeleton/php_skeleton.h ext/skeleton/skeleton.c

2013-10-14 Thread Anatol Belski
Commit:7a038ccbe61c88b007a3a3ba1580185058792e91
Author:Anatol Belski a...@php.net Mon, 14 Oct 2013 14:18:43 +0200
Parents:   960b4e81f316528fc554ec1bff7daf46faa7129f
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7a038ccbe61c88b007a3a3ba1580185058792e91

Log:
fixed skeleton to produce the normalized ext version macros

See http://news.php.net/php.pecl.dev/11191 for more info.

Changed paths:
  M  ext/skeleton/php_skeleton.h
  M  ext/skeleton/skeleton.c


Diff:
diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h
index 495907b..0716ae0 100644
--- a/ext/skeleton/php_skeleton.h
+++ b/ext/skeleton/php_skeleton.h
@@ -6,6 +6,8 @@
 extern zend_module_entry extname_module_entry;
 #define phpext_extname_ptr extname_module_entry
 
+#define PHP_EXTNAME_VERSION 0.1.0 /* Replace with version number for your 
extension */
+
 #ifdef PHP_WIN32
 #  define PHP_EXTNAME_API __declspec(dllexport)
 #elif defined(__GNUC__)  __GNUC__ = 4
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index ee4ea74..2e37344 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -41,7 +41,7 @@ zend_module_entry extname_module_entry = {
PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do 
at request end */
PHP_MINFO(extname),
 #if ZEND_MODULE_API_NO = 20010901
-   0.1, /* Replace with version number for your extension */
+   PHP_EXTNAME_VERSION,
 #endif
STANDARD_MODULE_PROPERTIES
 };


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



[PHP-CVS] com php-src: OCI8: sync README and package.xml descriptions: ext/oci8/README ext/oci8/package.xml

2013-10-10 Thread Christopher Jones
Commit:5ae8c51e688060d0a3263b67ff9fb24ba2c8c1d2
Author:Christopher Jones s...@php.net Thu, 10 Oct 2013 13:38:38 
-0700
Parents:   71a3c07843ca2d35e59cc165f37359fc7796aea9
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5ae8c51e688060d0a3263b67ff9fb24ba2c8c1d2

Log:
OCI8: sync README and package.xml descriptions

Changed paths:
  M  ext/oci8/README
  M  ext/oci8/package.xml


Diff:
diff --git a/ext/oci8/README b/ext/oci8/README
index af5beeb..d662072 100644
--- a/ext/oci8/README
+++ b/ext/oci8/README
@@ -1,13 +1,20 @@
 The OCI8 Extension
 --
 
-Use the OCI8 extension to access Oracle Database.  
+Use the OCI8 extension to access Oracle Database.
 
 Documentation is at http://php.net/oci8
 
-The extension can be built with PHP versions 4.3.9 to 5.x using Oracle
-Database 9.2, 10, 11 or 12 client libraries.  Oracle's standard
-cross-version connectivity applies.  For example PHP linked with
-Oracle 11.2 client libraries can connect to Oracle Database 9.2
-onwards.  See Oracle's note Oracle Client / Server Interoperability
-Support (ID 207303.1) for details.
+The extension can be linked with Oracle client libraries from Oracle
+Database 10.2, 11, or 12.1.  These libraries are found in the database
+installation, or in the free Oracle Instant Client available from
+Oracle.
+
+Oracle's standard cross-version connectivity applies.  For example,
+PHP OCI8 linked with Instant Client 11.2 can connect to Oracle
+Database 9.2 onward.  See Oracle's note Oracle Client / Server
+Interoperability Support (ID 207303.1) for details.
+
+PHP OCI8 2.0 can be built with PHP 5.2 onward.  Use the older PHP OCI8
+1.4.10 when using PHP 4.3.9 through to PHP 5.1.x, or when only Oracle
+Database 9.2 client libraries are available.
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index d85faf0..f61def5 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -8,15 +8,17 @@ http://pear.php.net/dtd/package-2.0.xsd;
  summaryExtension for Oracle Database/summary
 
  description
-The PHP OCI8 extension gives access to Oracle Database. The extension
-can be linked with Oracle client libraries from Oracle Database 10.2,
-11, or 12.1. These libraries are found in the database installation,
-or in the free Oracle Instant Client. Oracle's standard cross-version
-connectivity applies.  For example, PHP OCI8 linked with Instant
-Client 11.2 can connect to Oracle Database 9.2 onwards.  PHP OCI8 2.0
-can be built with PHP 5.2 onwards. Use the older PHP OCI8 1.4.10 when
-using PHP 4.3.9 through to PHP 5.1.x, or when only Oracle Database 9.2
-client libraries are available.
+Use the OCI8 extension to access Oracle Database.  The extension can
+be linked with Oracle client libraries from Oracle Database 10.2, 11,
+or 12.1.  These libraries are found in the database installation, or
+in the free Oracle Instant Client available from Oracle.  Oracle's
+standard cross-version connectivity applies.  For example, PHP OCI8
+linked with Instant Client 11.2 can connect to Oracle Database 9.2
+onward.  See Oracle's note Oracle Client / Server Interoperability
+Support (ID 207303.1) for details.  PHP OCI8 2.0 can be built with
+PHP 5.2 onward.  Use the older PHP OCI8 1.4.10 when using PHP 4.3.9
+through to PHP 5.1.x, or when only Oracle Database 9.2 client
+libraries are available.
  /description
  lead
   nameChristopher Jones/name


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



Re: [PHP-CVS] com php-src: Merge branch 'issue-55736' of https://github.com/tistre/php-src: run-tests.php

2013-10-09 Thread Michael Wallner
On 9 October 2013 10:06, Michael Wallner m...@php.net wrote:
 Commit:5f41cb18beb9437df73c382b5a9689d43c357628
 Author:Michael Wallner m...@php.net Wed, 9 Oct 2013 10:06:45 
 +0200
 Parents:   29d5ff75d5ac076eb0b4623e1a29eb33bb65393a 
 5ffaf95d3f6d8634cdc218ea6bfdb24c7887148c
 Branches:  master

 Link:   
 http://git.php.net/?p=php-src.git;a=commitdiff;h=5f41cb18beb9437df73c382b5a9689d43c357628

 Log:
 Merge branch 'issue-55736' of https://github.com/tistre/php-src

 implements FR #55736

 * 'issue-55736' of https://github.com/tistre/php-src:
   run-tests.php: Adding support for sections EXPECT_EXTERNAL, 
 EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736)

 Bugs:
 https://bugs.php.net/55736

 Changed paths:
   MM  run-tests.php

Could someone grant me web-qa karma or merge PR #6, please?
https://github.com/php/web-qa/pull/6


-- 
Regards,
Mike

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



[PHP-CVS] com php-src: consolidate NEWS with 5.4: NEWS

2013-10-09 Thread Michael Wallner
Commit:e3c7b487099f317378cc747aea4dbe044f7faba8
Author:Michael Wallner m...@php.net Wed, 9 Oct 2013 08:16:00 +0200
Parents:   f32d2ac3aaa7d4af7c348b00ebebb9ae64955704
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e3c7b487099f317378cc747aea4dbe044f7faba8

Log:
consolidate NEWS with 5.4

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 6649a49..b70bdcc 100644
--- a/NEWS
+++ b/NEWS
@@ -2,22 +2,23 @@ PHP   
 NEWS
 |||
 ?? ??? 2013, PHP 5.5.5
 
-- Buildsystem:
-  . Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
-(Mike, Raphael Geissert)
-
 - Core:
   . Fixed bug #64979 (Wrong behavior of static variables in closure 
generators).
 (Nikita)
+  . Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
   . Fixed bug #65821 (By-ref foreach on property access of string offset
 segfaults). (Nikita)
 
 - CLI server:
   . Fixed bug #65633 (built-in server treat some http headers as
 case-sensitive). (Adam)
+  . Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
+encoding). (Felipe)
   . Added application/pdf to PHP CLI Web Server mime types (Chris Jones)
 
 - Datetime:
+  . Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
+message). (Boro Sitnikovski)
   . Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime).
 (Boro Sitnikovski)
   . Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work).
@@ -27,6 +28,14 @@ PHP  
  NEWS
   . Fixed bug #65708 (dba functions cast $key param to string in-place,
 bypassing copy on write). (Adam)
 
+- Filter:
+  . Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
+  . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain 
names).
+(Syra)
+
+- FTP:
+  . Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
+
 - GD
   . Ensure that the defined interpolation method is used with the generic
 scaling methods. (Pierre)
@@ -45,10 +54,29 @@ PHP 
   NEWS
   . Fixed issue #135 (segfault in interned strings if initial memory is too
 low). (Julien)
 
+- Sockets:
+  . Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
+(Mike)
+
 - SPL:
   . Fix bug #64782 (SplFileObject constructor make $context optional / give it
 a default value). (Nikita)
 
+- Standard:
+  . Fixed bug #61548 (content-type must appear at the end of headers for 201 
+Location to work in http). (Mike)
+
+- XMLReader:
+  . Fixed bug #51936 (Crash with clone XMLReader). (Mike)
+  . Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
+  
+- Build system:
+  . Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
+(Mike, Raphael Geissert)
+  . Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing 
+gzencode())). (Mike)
+
+
 19 Sep 2013, PHP 5.5.4
 
 - Core:
@@ -59,6 +87,7 @@ PHP   
 NEWS
 DTRACE_FUNCTION_*). (Chris Jones)
   . Fixed bug #65483 (quoted-printable encode stream filter incorrectly 
encoding
 spaces). (Michael M Slusarz)
+  . Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
   . Fixed bug #65470 (Segmentation fault in zend_error() with
 --enable-dtrace). (Chris Jones, Kris Van Hees)
   . Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
@@ -85,6 +114,10 @@ PHP 
   NEWS
   . Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
 some cases). (Mark Jones)
 
+- PDO:
+  . Fixed bug #64953 (Postgres prepared statement positional parameter 
+casting). (Mike)
+
 - Session:
   . Fixed bug #65475 (Session ID is not initialized properly when strict 
session
 is enabled). (Yasuo)
@@ -95,6 +128,10 @@ PHP 
   NEWS
   . Fix issue with return types of password API helper functions. Found via
 static analysis by cjones. (Anthony Ferrara) 
 
+- Zlib:
+  . Fixed bug #65391 (Unable to send vary header user-agent when 
+ob_start('ob_gzhandler') is called) (Mike)
+
 22 Aug 2013, PHP 5.5.3
 
 - Openssl:


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



[PHP-CVS] svn: /SVNROOT/ global_avail

2013-10-09 Thread Ferenc Kovacs
tyrael   Wed, 09 Oct 2013 11:07:56 +

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

Log:
grant mike web/qa.git karma

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2013-10-09 07:44:22 UTC (rev 331746)
+++ SVNROOT/global_avail2013-10-09 11:07:56 UTC (rev 331747)
@@ -78,7 +78,7 @@

 # The PHP Quality Assurance Team maintains their own website.

-avail|iliaa,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,jani,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,helly,sean,nlopess,tony2001,zoe,johannes,lsmith,stevseea,felixdv,scottmac,ericstewart,bjori,pajoye,philip,auroraeosrose,laruence|web/qa.git
+avail|iliaa,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,jani,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,helly,sean,nlopess,tony2001,zoe,johannes,lsmith,stevseea,felixdv,scottmac,ericstewart,bjori,pajoye,philip,auroraeosrose,laruence,mike|web/qa.git

 # Some people get only access to specific languages for phpdoc
 avail|diab,daif,salehcoder|phpdoc/ar

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

[PHP-CVS] com php-src: run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736): run-tests.php tests/run-test/test011.phpt tests/run-test/te

2013-10-09 Thread Michael Wallner
Commit:5ffaf95d3f6d8634cdc218ea6bfdb24c7887148c
Author:Tim Strehle t...@strehle.de Tue, 3 Sep 2013 14:38:52 +0200
Parents:   04fcf6a98b8901ae7c442aa92368c82fa7bd671d
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5ffaf95d3f6d8634cdc218ea6bfdb24c7887148c

Log:
run-tests.php: Adding support for sections EXPECT_EXTERNAL, EXPECTF_EXTERNAL 
and EXPECTREGEX_EXTERNAL. (Issue 55736)

Changed paths:
  M  run-tests.php
  A  tests/run-test/test011.phpt
  A  tests/run-test/test011.txt
  A  tests/run-test/test012.phpt
  A  tests/run-test/test012.txt
  A  tests/run-test/test013.phpt
  A  tests/run-test/test013.txt


Diff:
diff --git a/run-tests.php b/run-tests.php
index 54a12a1..dc88ddf 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1289,16 +1289,20 @@ TEST $file
unset($section_text['FILEEOF']);
}
 
-   if (@count($section_text['FILE_EXTERNAL']) == 1) {
-   // don't allow tests to retrieve files from 
anywhere but this subdirectory
-   $section_text['FILE_EXTERNAL'] = dirname($file) 
. '/' . trim(str_replace('..', '', $section_text['FILE_EXTERNAL']));
+   foreach (array( 'FILE', 'EXPECT', 'EXPECTF', 
'EXPECTREGEX' ) as $prefix) {
+   $key = $prefix . '_EXTERNAL';
 
-   if 
(file_exists($section_text['FILE_EXTERNAL'])) {
-   $section_text['FILE'] = 
file_get_contents($section_text['FILE_EXTERNAL'], FILE_BINARY);
-   unset($section_text['FILE_EXTERNAL']);
-   } else {
-   $bork_info = could not load 
--FILE_EXTERNAL--  . dirname($file) . '/' . 
trim($section_text['FILE_EXTERNAL']);
-   $borked = true;
+   if (@count($section_text[$key]) == 1) {
+   // don't allow tests to retrieve files 
from anywhere but this subdirectory
+   $section_text[$key] = dirname($file) . 
'/' . trim(str_replace('..', '', $section_text[$key]));
+
+   if (file_exists($section_text[$key])) {
+   $section_text[$prefix] = 
file_get_contents($section_text[$key], FILE_BINARY);
+   unset($section_text[$key]);
+   } else {
+   $bork_info = could not load 
-- . $key . --  . dirname($file) . '/' . trim($section_text[$key]);
+   $borked = true;
+   }
}
}
 
diff --git a/tests/run-test/test011.phpt b/tests/run-test/test011.phpt
new file mode 100644
index 000..17f1f7a
--- /dev/null
+++ b/tests/run-test/test011.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECT_EXTERNAL
+--FILE--
+abc
+--EXPECT_EXTERNAL--
+test011.txt
diff --git a/tests/run-test/test011.txt b/tests/run-test/test011.txt
new file mode 100644
index 000..8baef1b
--- /dev/null
+++ b/tests/run-test/test011.txt
@@ -0,0 +1 @@
+abc
diff --git a/tests/run-test/test012.phpt b/tests/run-test/test012.phpt
new file mode 100644
index 000..8213aa2
--- /dev/null
+++ b/tests/run-test/test012.phpt
@@ -0,0 +1,12 @@
+--TEST--
+EXPECTF_EXTERNAL
+--FILE--
+123
+-123
++123
++1.1
+abc
+0abc
+x
+--EXPECTF_EXTERNAL--
+test012.txt
diff --git a/tests/run-test/test012.txt b/tests/run-test/test012.txt
new file mode 100644
index 000..bb29321
--- /dev/null
+++ b/tests/run-test/test012.txt
@@ -0,0 +1,7 @@
+%d
+%i
+%i
+%f
+%s
+%x
+%c
diff --git a/tests/run-test/test013.phpt b/tests/run-test/test013.phpt
new file mode 100644
index 000..79ccd20
--- /dev/null
+++ b/tests/run-test/test013.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECTREGEX_EXTERNAL
+--FILE--
+abcde12314235xyz34264768286abcde
+--EXPECTREGEX_EXTERNAL--
+test013.txt
diff --git a/tests/run-test/test013.txt b/tests/run-test/test013.txt
new file mode 100644
index 000..6c280ec
--- /dev/null
+++ b/tests/run-test/test013.txt
@@ -0,0 +1 @@
+[abcde]+[0-5]*xyz[2-8]+abcde


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



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] com php-src: Merge branch 'issue-55736' of https://github.com/tistre/php-src: run-tests.php

2013-10-09 Thread Ferenc Kovacs
On Wed, Oct 9, 2013 at 11:41 AM, Michael Wallner m...@php.net wrote:

 On 9 October 2013 10:06, Michael Wallner m...@php.net wrote:
  Commit:5f41cb18beb9437df73c382b5a9689d43c357628
  Author:Michael Wallner m...@php.net Wed, 9 Oct 2013
 10:06:45 +0200
  Parents:   29d5ff75d5ac076eb0b4623e1a29eb33bb65393a
 5ffaf95d3f6d8634cdc218ea6bfdb24c7887148c
  Branches:  master
 
  Link:
 http://git.php.net/?p=php-src.git;a=commitdiff;h=5f41cb18beb9437df73c382b5a9689d43c357628
 
  Log:
  Merge branch 'issue-55736' of https://github.com/tistre/php-src
 
  implements FR #55736
 
  * 'issue-55736' of https://github.com/tistre/php-src:
run-tests.php: Adding support for sections EXPECT_EXTERNAL,
 EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736)
 
  Bugs:
  https://bugs.php.net/55736
 
  Changed paths:
MM  run-tests.php

 Could someone grant me web-qa karma or merge PR #6, please?
 https://github.com/php/web-qa/pull/6


 --
 Regards,
 Mike

 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


I've granted you web/qa.git karma, you should be able to merge the PR now.
Thanks for the contribution!


-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu


[PHP-CVS] com php-src: Thanks Daniel, I didn't think long enough: UPGRADING

2013-10-09 Thread Michael Wallner
Commit:1815942f53a976555e9cb60ac3ce2425142d1cb1
Author:Michael Wallner m...@php.net Wed, 9 Oct 2013 08:22:33 +0200
Parents:   cfa4eced9f7407f924fdf9c4bdbceae5373b3d0e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1815942f53a976555e9cb60ac3ce2425142d1cb1

Log:
Thanks Daniel, I didn't think long enough

Changed paths:
  M  UPGRADING


Diff:
diff --git a/UPGRADING b/UPGRADING
index 238aa5e..b19c3dd 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -113,11 +113,6 @@ PHP X.Y UPGRADE NOTES
 9. New Global Constants
 
 
-- Openssl:
-  . STREAM_CRYPTO_METHOD_SSLv2_CLIENT
-  . STREAM_CRYPTO_METHOD_SSLv3_CLIENT
-  . STREAM_CRYPTO_METHOD_SSLv23_CLIENT
-  . STREAM_CRYPTO_METHOD_TLS_CLIENT
 
 
 10. Changes to INI File Handling


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



Re: [PHP-CVS] com php-src: Merge branch 'issue-55736' of https://github.com/tistre/php-src: run-tests.php

2013-10-09 Thread Michael Wallner
Now gotta look up what QA docs I also have to change...

On 9 October 2013 10:06, Michael Wallner m...@php.net wrote:
 Commit:5f41cb18beb9437df73c382b5a9689d43c357628
 Author:Michael Wallner m...@php.net Wed, 9 Oct 2013 10:06:45 
 +0200
 Parents:   29d5ff75d5ac076eb0b4623e1a29eb33bb65393a 
 5ffaf95d3f6d8634cdc218ea6bfdb24c7887148c
 Branches:  master

 Link:   
 http://git.php.net/?p=php-src.git;a=commitdiff;h=5f41cb18beb9437df73c382b5a9689d43c357628

 Log:
 Merge branch 'issue-55736' of https://github.com/tistre/php-src

 implements FR #55736

 * 'issue-55736' of https://github.com/tistre/php-src:
   run-tests.php: Adding support for sections EXPECT_EXTERNAL, 
 EXPECTF_EXTERNAL and EXPECTREGEX_EXTERNAL. (Issue 55736)

 Bugs:
 https://bugs.php.net/55736

 Changed paths:
   MM  run-tests.php


 Diff:



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




-- 
Regards,
Mike

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



[PHP-CVS] com php-src: fix bug #51076 (race condition in shtool's mkdir -p): NEWS build/shtool

2013-10-08 Thread Michael Wallner
Commit:f32d2ac3aaa7d4af7c348b00ebebb9ae64955704
Author:Michael Wallner m...@php.net Tue, 8 Oct 2013 08:37:08 +0200
Parents:   0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f32d2ac3aaa7d4af7c348b00ebebb9ae64955704

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

Bugs:
https://bugs.php.net/51076

Changed paths:
  M  NEWS
  M  build/shtool


Diff:
diff --git a/NEWS b/NEWS
index 796f82f..6649a49 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP
NEWS
 |||
 ?? ??? 2013, PHP 5.5.5
 
+- Buildsystem:
+  . Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
+(Mike, Raphael Geissert)
+
 - Core:
   . Fixed bug #64979 (Wrong behavior of static variables in closure 
generators).
 (Nikita)
diff --git a/build/shtool b/build/shtool
index 684a01f..fc6ae1e 100755
--- a/build/shtool
+++ b/build/shtool
@@ -1003,7 +1003,14 @@ mkdir )
 if [ .$opt_t = .yes ]; then
 echo mkdir $pathcomp 12
 fi
-mkdir $pathcomp || errstatus=$?
+   # See https://bugs.php.net/51076
+   # The fix is from Debian who have sent 
it
+   # upstream, too; but upstream seems 
dead.
+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] com php-src: fix bad cast: ext/standard/php_fopen_wrapper.c

2013-10-08 Thread Michael Wallner
Commit:5d430ad90257e353321789d9dfe529554028ff6e
Author:Michael Wallner m...@php.net Tue, 8 Oct 2013 11:16:53 +0200
Parents:   b15765412aebb6b158465f26d8eedb85737862d8
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5d430ad90257e353321789d9dfe529554028ff6e

Log:
fix bad cast

Changed paths:
  M  ext/standard/php_fopen_wrapper.c


Diff:
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 76f77eb..0adb1e0 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -120,11 +120,11 @@ static int php_stream_input_flush(php_stream *stream 
TSRMLS_DC) /* {{{ */
 
 static int php_stream_input_seek(php_stream *stream, off_t offset, int whence, 
off_t *newoffset TSRMLS_DC) /* {{{ */
 {
-   php_stream *inner = stream-abstract;
+   php_stream_input_t *input = stream-abstract;
 
-   if (inner) {
-   int sought = php_stream_seek(inner, offset, whence);
-   *newoffset = inner-position;
+   if (*input-body_ptr) {
+   int sought = php_stream_seek(*input-body_ptr, offset, whence);
+   *newoffset = (*input-body_ptr)-position;
return sought;
}


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



[PHP-CVS] svn: /SVNROOT/ global_avail

2013-10-08 Thread Pierre Joye
pajoye   Tue, 08 Oct 2013 13:33:08 +

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

Log:
- ab karma

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2013-10-08 11:59:38 UTC (rev 331729)
+++ SVNROOT/global_avail2013-10-08 13:33:08 UTC (rev 331730)
@@ -411,8 +411,8 @@
 avail|bcarlyon,derick|web/bugtracker

 # php-internals-win karma
-avail|szarkos,pajoye,rrichards,auroraeosrose|php/php-internals-win
-avail|pajoye,guilhermeblanco,auroraeosrose,rrichards,kalle,sascham78,szarkos|web/windows.git
+avail|szarkos,pajoye,rrichards,auroraeosrose,ab|php/php-internals-win
+avail|pajoye,guilhermeblanco,auroraeosrose,rrichards,kalle,sascham78,szarkos,ab|web/windows.git
 avail|szarkos,ab|web/rmtools.git

 # php-benchmarks karma

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

[PHP-CVS] com php-src: Using SUCCESS and FAILURE for return values Using zend_bool for boolean arguments and return values Reduced one level of zval indirection where possible: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:955bc1d91bd772cbb782830220048511b657f063
Author:datibbaw datib...@php.net Mon, 7 Oct 2013 15:38:48 +0800
Parents:   e45eacd8fa4e32692697171e90f14d3c66d673de
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=955bc1d91bd772cbb782830220048511b657f063

Log:
Using SUCCESS and FAILURE for return values
Using zend_bool for boolean arguments and return values
Reduced one level of zval indirection where possible

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c208d43..d963f86 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1672,18 +1672,18 @@ PHP_FUNCTION(openssl_x509_export)
 }
 /* }}} */
 
-static int php_openssl_x509_fingerprint(X509 *peer, const char *method, int 
raw, char **out, int *out_len)
+static int php_openssl_x509_fingerprint(X509 *peer, const char *method, 
zend_bool raw, char **out, int *out_len)
 {
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
int n;
 
if (!(mdtype = EVP_get_digestbyname(method))) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, `%s`: Unknown 
signature algorithm, method);
-   return 0;
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
+   return FAILURE;
} else if (!X509_digest(peer, mdtype, md, n)) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, Could not generate 
signature);
-   return 0;
+   return FAILURE;
}
 
if (raw) {
@@ -1696,7 +1696,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const 
char *method, int raw,
make_digest_ex(*out, md, n);
}
 
-   return 1;
+   return SUCCESS;
 }
 
 static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char 
*expected)
@@ -1705,7 +1705,7 @@ static int php_x509_fingerprint_cmp(X509 *peer, const 
char *method, const char *
int fingerprint_len;
int result = -1;
 
-   if (php_openssl_x509_fingerprint(peer, method, 0, fingerprint, 
fingerprint_len)) {
+   if (php_openssl_x509_fingerprint(peer, method, 0, fingerprint, 
fingerprint_len) == SUCCESS) {
result = strcmp(expected, fingerprint);
efree(fingerprint);
}
@@ -1713,12 +1713,12 @@ static int php_x509_fingerprint_cmp(X509 *peer, const 
char *method, const char *
return result;
 }
 
-static int php_x509_fingerprint_match(X509 *peer, zval **val)
+static zend_bool php_x509_fingerprint_match(X509 *peer, zval *val)
 {
-   if (Z_TYPE_PP(val) == IS_STRING) {
+   if (Z_TYPE_P(val) == IS_STRING) {
const char *method = NULL;
 
-   switch (Z_STRLEN_PP(val)) {
+   switch (Z_STRLEN_P(val)) {
case 32:
method = md5;
break;
@@ -1728,19 +1728,19 @@ static int php_x509_fingerprint_match(X509 *peer, zval 
**val)
break;
}
 
-   return method  php_x509_fingerprint_cmp(peer, method, 
Z_STRVAL_PP(val)) == 0;
-   } else if (Z_TYPE_PP(val) == IS_ARRAY) {
+   return method  php_x509_fingerprint_cmp(peer, method, 
Z_STRVAL_P(val)) == 0;
+   } else if (Z_TYPE_P(val) == IS_ARRAY) {
HashPosition pos;
zval **current;
char *key;
uint key_len;
ulong key_index;
 
-   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(val), 
pos);
-   zend_hash_get_current_data_ex(Z_ARRVAL_PP(val), (void 
**)current, pos) == SUCCESS;
-   zend_hash_move_forward_ex(Z_ARRVAL_PP(val), pos)
+   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(val), pos);
+   zend_hash_get_current_data_ex(Z_ARRVAL_P(val), (void 
**)current, pos) == SUCCESS;
+   zend_hash_move_forward_ex(Z_ARRVAL_P(val), pos)
) {
-   int key_type = 
zend_hash_get_current_key_ex(Z_ARRVAL_PP(val), key, key_len, key_index, 0, 
pos);
+   int key_type = 
zend_hash_get_current_key_ex(Z_ARRVAL_P(val), key, key_len, key_index, 0, 
pos);
 
if (key_type == HASH_KEY_IS_STRING 
 Z_TYPE_PP(current) == IS_STRING
@@ -1776,7 +1776,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
RETURN_FALSE;
}
 
-   if (php_openssl_x509_fingerprint(cert, method, raw_output, 
fingerprint, fingerprint_len)) {
+   if (php_openssl_x509_fingerprint(cert, method, raw_output, 
fingerprint, fingerprint_len) == SUCCESS) {
RETVAL_STRINGL(fingerprint, fingerprint_len, 0);
} else {
RETVAL_FALSE;
@@ -4989,7 +4989,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
 

[PHP-CVS] com php-src: Added test case for openssl_x509_digest(): ext/openssl/tests/openssl_x509_digest.phpt

2013-10-08 Thread Michael Wallner
Commit:a97aec16c0320c5737b43ad1c3caf01ea1485874
Author:Tjerk Meesters datib...@php.net Fri, 20 Sep 2013 23:28:29 
+0800
Committer: Tjerk Meesters tj...@muvee.com  Fri, 20 Sep 2013 23:29:04 +0800
Parents:   574fe449dc05a11cfe7e6a33b04d3f6557442600
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a97aec16c0320c5737b43ad1c3caf01ea1485874

Log:
Added test case for openssl_x509_digest()

Changed paths:
  A  ext/openssl/tests/openssl_x509_digest.phpt


Diff:
diff --git a/ext/openssl/tests/openssl_x509_digest.phpt 
b/ext/openssl/tests/openssl_x509_digest.phpt
new file mode 100644
index 000..98ec009
--- /dev/null
+++ b/ext/openssl/tests/openssl_x509_digest.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Testing openssl_x509_digest()
+--SKIPIF--
+?php
+if (!extension_loaded(openssl)) die(skip);
+?
+--FILE--
+?php
+
+$cert = file:// . dirname(__FILE__) . /cert.crt;
+
+echo ** Testing default functionality **\n;
+var_dump(openssl_x509_digest($cert));
+echo ** Testing hash method md5 **\n;
+var_dump(openssl_x509_digest($cert, 'md5'));
+
+echo **Testing raw output md5 **\n;
+var_dump(bin2hex(openssl_x509_digest($cert, 'md5', true)));
+
+echo ** Testing bad certification **\n;
+var_dump(openssl_x509_digest('123'));
+echo ** Testing bad hash method **\n;
+var_dump(openssl_x509_digest($cert, 'xx45'));
+--EXPECTF--
+** Testing default functionality **
+string(40) 6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c
+** Testing hash method md5 **
+string(32) ac77008e172897e06c0b065294487a67
+**Testing raw output md5 **
+string(32) ac77008e172897e06c0b065294487a67
+** Testing bad certification **
+
+Warning: openssl_x509_digest(): cannot get cert from parameter 1 in %s on line 
%d
+bool(false)
+** Testing bad hash method **
+
+Warning: openssl_x509_digest(): Unknown signature algorithm in %s on line %d
+bool(false)
+


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



[PHP-CVS] com php-src: Renamed to be more descriptive of what it does: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_x509_digest.phpt ext/openssl/tests/openssl_x509_fingerp

2013-10-08 Thread Michael Wallner
Commit:2bfc5a253b4ee76f9930692f2d088371c38dd65f
Author:Tjerk Meesters datib...@php.net Mon, 23 Sep 2013 00:51:17 
+0800
Parents:   521a5c956800115f0be008e0581878e4303a5118
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=2bfc5a253b4ee76f9930692f2d088371c38dd65f

Log:
Renamed to be more descriptive of what it does

Changed paths:
  M  ext/openssl/openssl.c
  M  ext/openssl/php_openssl.h
  D  ext/openssl/tests/openssl_x509_digest.phpt
  A  ext/openssl/tests/openssl_x509_fingerprint.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 9685dac..9da10fc 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -129,7 +129,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_export, 0, 0, 2)
 ZEND_ARG_INFO(0, notext)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 1)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_fingerprint, 0, 0, 1)
ZEND_ARG_INFO(0, x509)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, raw_output)
@@ -449,7 +449,7 @@ const zend_function_entry openssl_functions[] = {
PHP_FE(openssl_x509_checkpurpose,   
arginfo_openssl_x509_checkpurpose)
PHP_FE(openssl_x509_check_private_key,  
arginfo_openssl_x509_check_private_key)
PHP_FE(openssl_x509_export, 
arginfo_openssl_x509_export)
-   PHP_FE(openssl_x509_digest, 
arginfo_openssl_x509_digest)
+   PHP_FE(openssl_x509_fingerprint,
arginfo_openssl_x509_fingerprint)
PHP_FE(openssl_x509_export_to_file, 
arginfo_openssl_x509_export_to_file)
 
 /* PKCS12 funcs */
@@ -1672,7 +1672,7 @@ PHP_FUNCTION(openssl_x509_export)
 }
 /* }}} */
 
-PHP_FUNCTION(openssl_x509_digest)
+PHP_FUNCTION(openssl_x509_fingerprint)
 {
X509 *cert;
zval **zcert;
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 4f0ac14..a06e43d 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -66,7 +66,7 @@ PHP_FUNCTION(openssl_x509_free);
 PHP_FUNCTION(openssl_x509_parse);
 PHP_FUNCTION(openssl_x509_checkpurpose);
 PHP_FUNCTION(openssl_x509_export);
-PHP_FUNCTION(openssl_x509_digest);
+PHP_FUNCTION(openssl_x509_fingerprint);
 PHP_FUNCTION(openssl_x509_export_to_file);
 PHP_FUNCTION(openssl_x509_check_private_key);
 
diff --git a/ext/openssl/tests/openssl_x509_digest.phpt 
b/ext/openssl/tests/openssl_x509_digest.phpt
deleted file mode 100644
index fde4280..000
--- a/ext/openssl/tests/openssl_x509_digest.phpt
+++ /dev/null
@@ -1,47 +0,0 @@
---TEST--
-Testing openssl_x509_digest()
---SKIPIF--
-?php
-if (!extension_loaded(openssl)) die(skip);
-?
---FILE--
-?php
-
-$cert = file:// . dirname(__FILE__) . /cert.crt;
-
-echo ** Testing with no parameters **\n;
-var_dump(openssl_x509_digest());
-
-echo ** Testing default functionality **\n;
-var_dump(openssl_x509_digest($cert));
-
-echo ** Testing hash method md5 **\n;
-var_dump(openssl_x509_digest($cert, 'md5'));
-
-echo **Testing raw output md5 **\n;
-var_dump(bin2hex(openssl_x509_digest($cert, 'md5', true)));
-
-echo ** Testing bad certification **\n;
-var_dump(openssl_x509_digest('123'));
-echo ** Testing bad hash method **\n;
-var_dump(openssl_x509_digest($cert, 'xx45'));
---EXPECTF--
-** Testing with no parameters **
-
-Warning: openssl_x509_digest() expects at least 1 parameter, 0 given in %s on 
line %d
-NULL
-** Testing default functionality **
-string(40) 6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c
-** Testing hash method md5 **
-string(32) ac77008e172897e06c0b065294487a67
-**Testing raw output md5 **
-string(32) ac77008e172897e06c0b065294487a67
-** Testing bad certification **
-
-Warning: openssl_x509_digest(): cannot get cert from parameter 1 in %s on line 
%d
-bool(false)
-** Testing bad hash method **
-
-Warning: openssl_x509_digest(): Unknown signature algorithm in %s on line %d
-bool(false)
-
diff --git a/ext/openssl/tests/openssl_x509_fingerprint.phpt 
b/ext/openssl/tests/openssl_x509_fingerprint.phpt
new file mode 100644
index 000..6cd464a
--- /dev/null
+++ b/ext/openssl/tests/openssl_x509_fingerprint.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Testing openssl_x509_fingerprint()
+--SKIPIF--
+?php
+if (!extension_loaded(openssl)) die(skip);
+?
+--FILE--
+?php
+
+$cert = file:// . dirname(__FILE__) . /cert.crt;
+
+echo ** Testing with no parameters **\n;
+var_dump(openssl_x509_fingerprint());
+
+echo ** Testing default functionality **\n;
+var_dump(openssl_x509_fingerprint($cert));
+
+echo ** Testing hash method md5 **\n;
+var_dump(openssl_x509_fingerprint($cert, 'md5'));
+
+echo **Testing raw output md5 **\n;
+var_dump(bin2hex(openssl_x509_fingerprint($cert, 'md5', true)));
+
+echo ** Testing bad certification **\n;
+var_dump(openssl_x509_fingerprint('123'));
+echo ** Testing bad hash method **\n;
+var_dump(openssl_x509_fingerprint($cert, 'xx45'));
+--EXPECTF--
+** Testing with no parameters **
+
+Warning: 

[PHP-CVS] com php-src: show method in error message: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:e45eacd8fa4e32692697171e90f14d3c66d673de
Author:Tjerk Meesters datib...@php.net Mon, 30 Sep 2013 21:21:56 
+0800
Parents:   edd93f34520b550c4c42877fe9e03112cad005ba
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e45eacd8fa4e32692697171e90f14d3c66d673de

Log:
show method in error message

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c0d1b0b..c208d43 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1679,7 +1679,7 @@ static int php_openssl_x509_fingerprint(X509 *peer, const 
char *method, int raw,
int n;
 
if (!(mdtype = EVP_get_digestbyname(method))) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, `%s`: Unknown 
signature algorithm, method);
return 0;
} else if (!X509_digest(peer, mdtype, md, n)) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, Could not generate 
signature);


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



[PHP-CVS] com php-src: Support string and array for peer fingerprint matching: ext/openssl/openssl.c ext/openssl/tests/openssl_peer_fingerprint.phpt

2013-10-08 Thread Michael Wallner
Commit:edd93f34520b550c4c42877fe9e03112cad005ba
Author:datibbaw datib...@php.net Fri, 27 Sep 2013 14:13:11 +0800
Parents:   69bdc5aca8f14515556bb6fc8f86becf55ef30bf
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=edd93f34520b550c4c42877fe9e03112cad005ba

Log:
Support string and array for peer fingerprint matching

Changed paths:
  M  ext/openssl/openssl.c
  M  ext/openssl/tests/openssl_peer_fingerprint.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index a6ddd14..c0d1b0b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1672,7 +1672,7 @@ PHP_FUNCTION(openssl_x509_export)
 }
 /* }}} */
 
-int php_openssl_x509_fingerprint(X509 *peer, const char *method, int raw, char 
**out, int *out_len)
+static int php_openssl_x509_fingerprint(X509 *peer, const char *method, int 
raw, char **out, int *out_len)
 {
unsigned char md[EVP_MAX_MD_SIZE];
const EVP_MD *mdtype;
@@ -1699,6 +1699,61 @@ int php_openssl_x509_fingerprint(X509 *peer, const char 
*method, int raw, char *
return 1;
 }
 
+static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char 
*expected)
+{
+   char *fingerprint;
+   int fingerprint_len;
+   int result = -1;
+
+   if (php_openssl_x509_fingerprint(peer, method, 0, fingerprint, 
fingerprint_len)) {
+   result = strcmp(expected, fingerprint);
+   efree(fingerprint);
+   }
+
+   return result;
+}
+
+static int php_x509_fingerprint_match(X509 *peer, zval **val)
+{
+   if (Z_TYPE_PP(val) == IS_STRING) {
+   const char *method = NULL;
+
+   switch (Z_STRLEN_PP(val)) {
+   case 32:
+   method = md5;
+   break;
+
+   case 40:
+   method = sha1;
+   break;
+   }
+
+   return method  php_x509_fingerprint_cmp(peer, method, 
Z_STRVAL_PP(val)) == 0;
+   } else if (Z_TYPE_PP(val) == IS_ARRAY) {
+   HashPosition pos;
+   zval **current;
+   char *key;
+   uint key_len;
+   ulong key_index;
+
+   for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(val), 
pos);
+   zend_hash_get_current_data_ex(Z_ARRVAL_PP(val), (void 
**)current, pos) == SUCCESS;
+   zend_hash_move_forward_ex(Z_ARRVAL_PP(val), pos)
+   ) {
+   int key_type = 
zend_hash_get_current_key_ex(Z_ARRVAL_PP(val), key, key_len, key_index, 0, 
pos);
+
+   if (key_type == HASH_KEY_IS_STRING 
+Z_TYPE_PP(current) == IS_STRING
+php_x509_fingerprint_cmp(peer, key, 
Z_STRVAL_PP(current)) != 0
+   ) {
+   return 0;
+   }
+   }
+   return 1;
+   }
+   return 0;
+}
+
 PHP_FUNCTION(openssl_x509_fingerprint)
 {
X509 *cert;
@@ -1709,7 +1764,7 @@ PHP_FUNCTION(openssl_x509_fingerprint)
int method_len;
 
char *fingerprint;
-   char *fingerprint_len;
+   int fingerprint_len;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|sb, zcert, 
method, method_len, raw_output) == FAILURE) {
return;
@@ -4932,30 +4987,14 @@ int php_openssl_apply_verification_policy(SSL *ssl, 
X509 *peer, php_stream *stre
 
/* if the cert passed the usual checks, apply our own local policies 
now */
 
-   if (GET_VER_OPT(peer_fingerprint)  Z_TYPE_PP(val) == IS_STRING) {
-   char *fingerprint;
-   int fingerprint_len;
-   const char *method = NULL;
-
-   switch (Z_STRLEN_PP(val)) {
-   case 32:
-   method = md5;
-   break;
-
-   case 40:
-   method = sha1;
-   break;
-   }
-
-   if (method  php_openssl_x509_fingerprint(peer, method, 0, 
fingerprint, fingerprint_len)) {
-   int match = strcmp(Z_STRVAL_PP(val), fingerprint) == 0;
-
-   efree(fingerprint);
-
-   if (!match) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Peer fingerprint `%s` not matched, Z_STRVAL_PP(val));
+   if (GET_VER_OPT(peer_fingerprint)) {
+   if (Z_TYPE_PP(val) == IS_STRING || Z_TYPE_PP(val) == IS_ARRAY) {
+   if (!php_x509_fingerprint_match(peer, val)) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Peer fingerprint doesn't match);
return FAILURE;
}
+   } else {
+   php_error_docref(NULL 

[PHP-CVS] com php-src: who put that stupid newline there?: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:69bdc5aca8f14515556bb6fc8f86becf55ef30bf
Author:Tjerk Meesters datib...@php.net Mon, 23 Sep 2013 23:42:31 
+0800
Parents:   1c7cabb2ca405e6763d7044015f9cb063941a838
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=69bdc5aca8f14515556bb6fc8f86becf55ef30bf

Log:
who put that stupid newline there?

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c8588e2..a6ddd14 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1,5 +1,4 @@
 /*
-   
+--+
| PHP Version 5|
+--+


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



[PHP-CVS] com php-src: don't leak cert on errors, return null on zpp failure: ext/openssl/openssl.c ext/openssl/tests/openssl_x509_digest.phpt

2013-10-08 Thread Michael Wallner
Commit:521a5c956800115f0be008e0581878e4303a5118
Author:Tjerk Meesters tj...@muvee.com Sat, 21 Sep 2013 18:24:00 
+0800
Parents:   a97aec16c0320c5737b43ad1c3caf01ea1485874
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=521a5c956800115f0be008e0581878e4303a5118

Log:
don't leak cert on errors, return null on zpp failure

Changed paths:
  M  ext/openssl/openssl.c
  M  ext/openssl/tests/openssl_x509_digest.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index e6040d5..9685dac 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1685,8 +1685,6 @@ PHP_FUNCTION(openssl_x509_digest)
unsigned char md[EVP_MAX_MD_SIZE];
unsigned int n;
 
-   RETVAL_FALSE;
-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|sb, zcert, 
method, method_len, raw_output) == FAILURE) {
return;
}
@@ -1694,28 +1692,26 @@ PHP_FUNCTION(openssl_x509_digest)
cert = php_openssl_x509_from_zval(zcert, 0, certresource TSRMLS_CC);
if (cert == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot get cert 
from parameter 1);
-   return;
+   RETURN_FALSE;
}
 
mdtype = EVP_get_digestbyname(method);
if (!mdtype) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
-   return;
-   }
-
-   if (!X509_digest(cert, mdtype, md, n)) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, out of memory);
-   return;
-   }
-
-   if (raw_output) {
-   RETVAL_STRINGL(md, n, 1);
+   RETVAL_FALSE;
+   } else if (!X509_digest(cert, mdtype, md, n)) {
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Out of memory);
+   RETVAL_FALSE;
} else {
-   int digest_str_len = n * 2;
-   char *digest_str = emalloc(digest_str_len + 1);
+   if (raw_output) {
+   RETVAL_STRINGL(md, n, 1);
+   } else {
+   int digest_str_len = n * 2;
+   char *digest_str = emalloc(digest_str_len + 1);
 
-   make_digest_ex(digest_str, md, n);
-   RETVAL_STRINGL(digest_str, digest_str_len, 0);
+   make_digest_ex(digest_str, md, n);
+   RETVAL_STRINGL(digest_str, digest_str_len, 0);
+   }
}
 
if (certresource == -1  cert) {
diff --git a/ext/openssl/tests/openssl_x509_digest.phpt 
b/ext/openssl/tests/openssl_x509_digest.phpt
index 98ec009..fde4280 100644
--- a/ext/openssl/tests/openssl_x509_digest.phpt
+++ b/ext/openssl/tests/openssl_x509_digest.phpt
@@ -9,8 +9,12 @@ if (!extension_loaded(openssl)) die(skip);
 
 $cert = file:// . dirname(__FILE__) . /cert.crt;
 
+echo ** Testing with no parameters **\n;
+var_dump(openssl_x509_digest());
+
 echo ** Testing default functionality **\n;
 var_dump(openssl_x509_digest($cert));
+
 echo ** Testing hash method md5 **\n;
 var_dump(openssl_x509_digest($cert, 'md5'));
 
@@ -22,6 +26,10 @@ var_dump(openssl_x509_digest('123'));
 echo ** Testing bad hash method **\n;
 var_dump(openssl_x509_digest($cert, 'xx45'));
 --EXPECTF--
+** Testing with no parameters **
+
+Warning: openssl_x509_digest() expects at least 1 parameter, 0 given in %s on 
line %d
+NULL
 ** Testing default functionality **
 string(40) 6e6fd1ea10a5a23071d61c728ee9b40df6dbc33c
 ** Testing hash method md5 **


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



[PHP-CVS] com php-src: add md5 and sha1 fingerprint tests: ext/openssl/openssl.c ext/openssl/tests/openssl_peer_fingerprint.phpt

2013-10-08 Thread Michael Wallner
Commit:1c7cabb2ca405e6763d7044015f9cb063941a838
Author:Tjerk Meesters datib...@php.net Mon, 23 Sep 2013 23:29:17 
+0800
Parents:   2bfc5a253b4ee76f9930692f2d088371c38dd65f
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1c7cabb2ca405e6763d7044015f9cb063941a838

Log:
add md5 and sha1 fingerprint tests

Changed paths:
  M  ext/openssl/openssl.c
  A  ext/openssl/tests/openssl_peer_fingerprint.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 9da10fc..c8588e2 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1,4 +1,5 @@
 /*
+   
+--+
| PHP Version 5|
+--+
@@ -1672,6 +1673,33 @@ PHP_FUNCTION(openssl_x509_export)
 }
 /* }}} */
 
+int php_openssl_x509_fingerprint(X509 *peer, const char *method, int raw, char 
**out, int *out_len)
+{
+   unsigned char md[EVP_MAX_MD_SIZE];
+   const EVP_MD *mdtype;
+   int n;
+
+   if (!(mdtype = EVP_get_digestbyname(method))) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
+   return 0;
+   } else if (!X509_digest(peer, mdtype, md, n)) {
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, Could not generate 
signature);
+   return 0;
+   }
+
+   if (raw) {
+   *out_len = n;
+   *out = estrndup(md, n);
+   } else {
+   *out_len = n * 2;
+   *out = emalloc(*out_len + 1);
+
+   make_digest_ex(*out, md, n);
+   }
+
+   return 1;
+}
+
 PHP_FUNCTION(openssl_x509_fingerprint)
 {
X509 *cert;
@@ -1681,9 +1709,8 @@ PHP_FUNCTION(openssl_x509_fingerprint)
char *method = sha1;
int method_len;
 
-   const EVP_MD *mdtype;
-   unsigned char md[EVP_MAX_MD_SIZE];
-   unsigned int n;
+   char *fingerprint;
+   char *fingerprint_len;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|sb, zcert, 
method, method_len, raw_output) == FAILURE) {
return;
@@ -1695,23 +1722,10 @@ PHP_FUNCTION(openssl_x509_fingerprint)
RETURN_FALSE;
}
 
-   mdtype = EVP_get_digestbyname(method);
-   if (!mdtype) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
-   RETVAL_FALSE;
-   } else if (!X509_digest(cert, mdtype, md, n)) {
-   php_error_docref(NULL TSRMLS_CC, E_ERROR, Out of memory);
-   RETVAL_FALSE;
+   if (php_openssl_x509_fingerprint(cert, method, raw_output, 
fingerprint, fingerprint_len)) {
+   RETVAL_STRINGL(fingerprint, fingerprint_len, 0);
} else {
-   if (raw_output) {
-   RETVAL_STRINGL(md, n, 1);
-   } else {
-   int digest_str_len = n * 2;
-   char *digest_str = emalloc(digest_str_len + 1);
-
-   make_digest_ex(digest_str, md, n);
-   RETVAL_STRINGL(digest_str, digest_str_len, 0);
-   }
+   RETVAL_FALSE;
}
 
if (certresource == -1  cert) {
@@ -4919,6 +4933,33 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
 
/* if the cert passed the usual checks, apply our own local policies 
now */
 
+   if (GET_VER_OPT(peer_fingerprint)  Z_TYPE_PP(val) == IS_STRING) {
+   char *fingerprint;
+   int fingerprint_len;
+   const char *method = NULL;
+
+   switch (Z_STRLEN_PP(val)) {
+   case 32:
+   method = md5;
+   break;
+
+   case 40:
+   method = sha1;
+   break;
+   }
+
+   if (method  php_openssl_x509_fingerprint(peer, method, 0, 
fingerprint, fingerprint_len)) {
+   int match = strcmp(Z_STRVAL_PP(val), fingerprint) == 0;
+
+   efree(fingerprint);
+
+   if (!match) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
Peer fingerprint `%s` not matched, Z_STRVAL_PP(val));
+   return FAILURE;
+   }
+   }
+   }
+
name = X509_get_subject_name(peer);
 
/* Does the common name match ? (used primarily for https://) */
diff --git a/ext/openssl/tests/openssl_peer_fingerprint.phpt 
b/ext/openssl/tests/openssl_peer_fingerprint.phpt
new file mode 100644
index 000..a6be676
--- /dev/null
+++ b/ext/openssl/tests/openssl_peer_fingerprint.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Testing peer fingerprint on connection
+--SKIPIF--
+?php 
+if 

[PHP-CVS] com php-src: indentation fail: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:ce13f9fa328ae4a0c7fa9ef5efdb72a43f29dde2
Author:datibbaw datib...@php.net Fri, 20 Sep 2013 16:59:44 +0800
Parents:   b2881db9a98db6e92d9f6964dd83a003c39a7fbd
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ce13f9fa328ae4a0c7fa9ef5efdb72a43f29dde2

Log:
indentation fail

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 6979e35..f0ae2b7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1676,14 +1676,14 @@ PHP_FUNCTION(openssl_x509_export)
 PHP_FUNCTION(openssl_x509_digest)
 {
X509 *cert;
-zval **zcert, *zout;
+   zval **zcert, *zout;
long certresource;
zend_bool raw_output = 0;
char *method = sha1;
int method_len;
 
const EVP_MD *mdtype;
-unsigned char md[EVP_MAX_MD_SIZE];
+   unsigned char md[EVP_MAX_MD_SIZE];
unsigned int n;
 
RETVAL_FALSE;


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



[PHP-CVS] com php-src: added option for raw output: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:5cff92fb12e83f4c6c81c6e8b89480def3ee5e9e
Author:datibbaw datib...@php.net Fri, 20 Sep 2013 15:45:41 +0800
Parents:   b8f9a20286c6d88c11e81967df42d118bdba2f02
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5cff92fb12e83f4c6c81c6e8b89480def3ee5e9e

Log:
added option for raw output

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index c7203a7..5dfb9b4 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -132,6 +132,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 2)
ZEND_ARG_INFO(0, x509)
ZEND_ARG_INFO(1, out)
+   ZEND_ARG_INFO(0, raw_output)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_check_private_key, 0)
@@ -1676,13 +1677,14 @@ PHP_FUNCTION(openssl_x509_digest)
X509 *cert;
 zval **zcert, *zout;
long certresource;
+   zend_bool raw_output = 0;
 
 unsigned char md[EVP_MAX_MD_SIZE];
unsigned int n;
 
RETVAL_FALSE;
 
-if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz, zcert, zout) 
== FAILURE) {
+if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz|b, zcert, 
zout, raw_output) == FAILURE) {
return;
}
 
@@ -1698,7 +1700,16 @@ PHP_FUNCTION(openssl_x509_digest)
}
 
zval_dtor(zout);
-   ZVAL_STRINGL(zout, md, n, 1);
+
+   if (raw_output) {
+   ZVAL_STRINGL(zout, md, n, 1);
+   } else {
+   int digest_str_len = n * 2;
+   char *digest_str = emalloc(digest_str_len + 1);
+
+   make_digest_ex(digest_str, md, n);
+   ZVAL_STRINGL(zout, digest_str, digest_str_len, 0);
+   }
 
if (certresource == -1  cert) {
X509_free(cert);


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



[PHP-CVS] com php-src: removed the byref result: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:574fe449dc05a11cfe7e6a33b04d3f6557442600
Author:Tjerk Meesters tj...@muvee.com Fri, 20 Sep 2013 22:50:30 
+0800
Parents:   ce13f9fa328ae4a0c7fa9ef5efdb72a43f29dde2
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=574fe449dc05a11cfe7e6a33b04d3f6557442600

Log:
removed the byref result

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index f0ae2b7..e6040d5 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -129,9 +129,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_export, 0, 0, 2)
 ZEND_ARG_INFO(0, notext)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 1)
ZEND_ARG_INFO(0, x509)
-   ZEND_ARG_INFO(1, out)
ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, raw_output)
 ZEND_END_ARG_INFO()
@@ -1676,7 +1675,7 @@ PHP_FUNCTION(openssl_x509_export)
 PHP_FUNCTION(openssl_x509_digest)
 {
X509 *cert;
-   zval **zcert, *zout;
+   zval **zcert;
long certresource;
zend_bool raw_output = 0;
char *method = sha1;
@@ -1688,7 +1687,7 @@ PHP_FUNCTION(openssl_x509_digest)
 
RETVAL_FALSE;
 
-if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz|sb, zcert, 
zout, method, method_len, raw_output) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|sb, zcert, 
method, method_len, raw_output) == FAILURE) {
return;
}
 
@@ -1701,7 +1700,7 @@ PHP_FUNCTION(openssl_x509_digest)
mdtype = EVP_get_digestbyname(method);
if (!mdtype) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
-   RETURN_FALSE;
+   return;
}
 
if (!X509_digest(cert, mdtype, md, n)) {
@@ -1709,22 +1708,19 @@ PHP_FUNCTION(openssl_x509_digest)
return;
}
 
-   zval_dtor(zout);
-
if (raw_output) {
-   ZVAL_STRINGL(zout, md, n, 1);
+   RETVAL_STRINGL(md, n, 1);
} else {
int digest_str_len = n * 2;
char *digest_str = emalloc(digest_str_len + 1);
 
make_digest_ex(digest_str, md, n);
-   ZVAL_STRINGL(zout, digest_str, digest_str_len, 0);
+   RETVAL_STRINGL(digest_str, digest_str_len, 0);
}
 
if (certresource == -1  cert) {
X509_free(cert);
}
-   RETVAL_TRUE;
 }
 
 /* {{{ proto bool openssl_x509_check_private_key(mixed cert, mixed key)


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



[PHP-CVS] com php-src: Merge branch 'bug65729' of https://github.com/datibbaw/php-src: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:8300ced2f7daef0e1a6786d89361b92aadb3dd10
Author:Michael Wallner m...@php.net Tue, 8 Oct 2013 15:58:28 +0200
Parents:   0d8c83a251a96a81f53dec16e4ae4d39de01c4da 
6106896440572dd8093acdd11ea691a07d9b169c
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8300ced2f7daef0e1a6786d89361b92aadb3dd10

Log:
Merge branch 'bug65729' of https://github.com/datibbaw/php-src

* 'bug65729' of https://github.com/datibbaw/php-src:
  DNS name comparison is now case insensitive.
  Use zend_bool as return value for _match()
  Added two more test cases for CN matching.
  yay, reduced one variable
  Fixed bug that would lead to out of bounds memory access
  added better wildcard matching for CN

Bugs:
https://bugs.php.net/65729

Changed paths:
  MM  ext/openssl/openssl.c


Diff:



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



[PHP-CVS] com php-src: added openssl_x509_digest(), output is binary sha1: ext/openssl/openssl.c ext/openssl/php_openssl.h

2013-10-08 Thread Michael Wallner
Commit:b8f9a20286c6d88c11e81967df42d118bdba2f02
Author:datibbaw datib...@php.net Fri, 20 Sep 2013 15:04:52 +0800
Parents:   11d60447f9f22944dd08d8dacba1230fc4caabd8
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b8f9a20286c6d88c11e81967df42d118bdba2f02

Log:
added openssl_x509_digest(), output is binary sha1

Changed paths:
  M  ext/openssl/openssl.c
  M  ext/openssl/php_openssl.h


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 4aac4e3..c7203a7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -129,6 +129,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_export, 0, 0, 
2)
 ZEND_ARG_INFO(0, notext)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 2)
+   ZEND_ARG_INFO(0, x509)
+   ZEND_ARG_INFO(1, out)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO(arginfo_openssl_x509_check_private_key, 0)
 ZEND_ARG_INFO(0, cert)
 ZEND_ARG_INFO(0, key)
@@ -443,6 +448,7 @@ const zend_function_entry openssl_functions[] = {
PHP_FE(openssl_x509_checkpurpose,   
arginfo_openssl_x509_checkpurpose)
PHP_FE(openssl_x509_check_private_key,  
arginfo_openssl_x509_check_private_key)
PHP_FE(openssl_x509_export, 
arginfo_openssl_x509_export)
+   PHP_FE(openssl_x509_digest, 
arginfo_openssl_x509_digest)
PHP_FE(openssl_x509_export_to_file, 
arginfo_openssl_x509_export_to_file)
 
 /* PKCS12 funcs */
@@ -1665,6 +1671,41 @@ PHP_FUNCTION(openssl_x509_export)
 }
 /* }}} */
 
+PHP_FUNCTION(openssl_x509_digest)
+{
+   X509 *cert;
+zval **zcert, *zout;
+   long certresource;
+
+unsigned char md[EVP_MAX_MD_SIZE];
+   unsigned int n;
+
+   RETVAL_FALSE;
+
+if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz, zcert, zout) 
== FAILURE) {
+   return;
+   }
+
+   cert = php_openssl_x509_from_zval(zcert, 0, certresource TSRMLS_CC);
+   if (cert == NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot get cert 
from parameter 1);
+   return;
+   }
+
+   if (!X509_digest(cert, EVP_sha1(), md, n)) {
+   php_error_docref(NULL TSRMLS_CC, E_ERROR, out of memory);
+   return;
+   }
+
+   zval_dtor(zout);
+   ZVAL_STRINGL(zout, md, n, 1);
+
+   if (certresource == -1  cert) {
+   X509_free(cert);
+   }
+   RETVAL_TRUE;
+}
+
 /* {{{ proto bool openssl_x509_check_private_key(mixed cert, mixed key)
Checks if a private key corresponds to a CERT */
 PHP_FUNCTION(openssl_x509_check_private_key)
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 8483bbf..4f0ac14 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -66,6 +66,7 @@ PHP_FUNCTION(openssl_x509_free);
 PHP_FUNCTION(openssl_x509_parse);
 PHP_FUNCTION(openssl_x509_checkpurpose);
 PHP_FUNCTION(openssl_x509_export);
+PHP_FUNCTION(openssl_x509_digest);
 PHP_FUNCTION(openssl_x509_export_to_file);
 PHP_FUNCTION(openssl_x509_check_private_key);


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



[PHP-CVS] com php-src: added option for hash function: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:b2881db9a98db6e92d9f6964dd83a003c39a7fbd
Author:datibbaw datib...@php.net Fri, 20 Sep 2013 16:56:50 +0800
Parents:   5cff92fb12e83f4c6c81c6e8b89480def3ee5e9e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b2881db9a98db6e92d9f6964dd83a003c39a7fbd

Log:
added option for hash function

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 5dfb9b4..6979e35 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -132,6 +132,7 @@ ZEND_END_ARG_INFO()
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_x509_digest, 0, 0, 2)
ZEND_ARG_INFO(0, x509)
ZEND_ARG_INFO(1, out)
+   ZEND_ARG_INFO(0, method)
ZEND_ARG_INFO(0, raw_output)
 ZEND_END_ARG_INFO()
 
@@ -1678,13 +1679,16 @@ PHP_FUNCTION(openssl_x509_digest)
 zval **zcert, *zout;
long certresource;
zend_bool raw_output = 0;
+   char *method = sha1;
+   int method_len;
 
+   const EVP_MD *mdtype;
 unsigned char md[EVP_MAX_MD_SIZE];
unsigned int n;
 
RETVAL_FALSE;
 
-if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz|b, zcert, 
zout, raw_output) == FAILURE) {
+if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zz|sb, zcert, 
zout, method, method_len, raw_output) == FAILURE) {
return;
}
 
@@ -1694,7 +1698,13 @@ PHP_FUNCTION(openssl_x509_digest)
return;
}
 
-   if (!X509_digest(cert, EVP_sha1(), md, n)) {
+   mdtype = EVP_get_digestbyname(method);
+   if (!mdtype) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature 
algorithm);
+   RETURN_FALSE;
+   }
+
+   if (!X509_digest(cert, mdtype, md, n)) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, out of memory);
return;
}


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



[PHP-CVS] com php-src: Use zend_bool as return value for _match(): ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:39c0daeb71f76ce22dc604bda8a063319fd55e59
Author:Tjerk Meesters datib...@php.net Mon, 7 Oct 2013 23:04:24 
+0800
Parents:   674dd73f8c34b9faf1e777a301e5302348b48b9d
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=39c0daeb71f76ce22dc604bda8a063319fd55e59

Log:
Use zend_bool as return value for _match()

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 2aa850a..2b34570 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4829,7 +4829,7 @@ static int verify_callback(int preverify_ok, 
X509_STORE_CTX *ctx) /* {{{ */
 }
 /* }}} */
 
-static int php_openssl_match_cn(const char *subjectname, const char *certname)
+static zend_bool php_openssl_match_cn(const char *subjectname, const char 
*certname)
 {
char *wildcard;
int prefix_len, suffix_len, subject_len;
@@ -4902,7 +4902,6 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
/* Does the common name match ? (used primarily for https://) */
GET_VER_OPT_STRING(CN_match, cnmatch);
if (cnmatch) {
-   int match = 0;
int name_len = X509_NAME_get_text_by_NID(name, NID_commonName, 
buf, sizeof(buf));
 
if (name_len == -1) {
@@ -4913,9 +4912,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
return FAILURE;
}
 
-   match = php_openssl_match_cn(cnmatch, buf);
-
-   if (!match) {
+   if (!php_openssl_match_cn(cnmatch, buf)) {
/* didn't match */
php_error_docref(NULL TSRMLS_CC, E_WARNING, Peer 
certificate CN=`%.*s' did not match expected CN=`%s', name_len, buf, cnmatch);
return FAILURE;


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



[PHP-CVS] com php-src: DNS name comparison is now case insensitive.: ext/openssl/openssl.c ext/openssl/tests/bug65729.phpt

2013-10-08 Thread Michael Wallner
Commit:6106896440572dd8093acdd11ea691a07d9b169c
Author:datibbaw datib...@php.net Tue, 8 Oct 2013 10:07:54 +0800
Parents:   39c0daeb71f76ce22dc604bda8a063319fd55e59
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=6106896440572dd8093acdd11ea691a07d9b169c

Log:
DNS name comparison is now case insensitive.

Changed paths:
  M  ext/openssl/openssl.c
  M  ext/openssl/tests/bug65729.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 2b34570..15cf798 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4834,7 +4834,7 @@ static zend_bool php_openssl_match_cn(const char 
*subjectname, const char *certn
char *wildcard;
int prefix_len, suffix_len, subject_len;
 
-   if (strcmp(subjectname, certname) == 0) {
+   if (strcasecmp(subjectname, certname) == 0) {
return 1;
}
 
@@ -4844,7 +4844,7 @@ static zend_bool php_openssl_match_cn(const char 
*subjectname, const char *certn
 
// 1) prefix, if not empty, must match subject
prefix_len = wildcard - certname;
-   if (prefix_len  strncmp(subjectname, certname, prefix_len) != 0) {
+   if (prefix_len  strncasecmp(subjectname, certname, prefix_len) != 0) {
return 0;
}
 
@@ -4854,7 +4854,7 @@ static zend_bool php_openssl_match_cn(const char 
*subjectname, const char *certn
/* 2) suffix must match
 * 3) no . between prefix and suffix
 **/
-   return strcmp(wildcard + 1, subjectname + subject_len - 
suffix_len) == 0 
+   return strcasecmp(wildcard + 1, subjectname + subject_len - 
suffix_len) == 0 
memchr(subjectname + prefix_len, '.', subject_len - 
suffix_len - prefix_len) == NULL;
}
 
diff --git a/ext/openssl/tests/bug65729.phpt b/ext/openssl/tests/bug65729.phpt
index 7008f3c..c0ee444 100644
--- a/ext/openssl/tests/bug65729.phpt
+++ b/ext/openssl/tests/bug65729.phpt
@@ -13,7 +13,7 @@ stream_context_set_option($context, 'ssl', 
'allow_self_signed', true);
 $server = stream_socket_server('ssl://127.0.0.1:64321', $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
 
-$expected_names = array('foo.test.com.sg', 'foo.test.com', 'foo.bar.test.com');
+$expected_names = array('foo.test.com.sg', 'foo.test.com', 'FOO.TEST.COM', 
'foo.bar.test.com');
 
 $pid = pcntl_fork();
 if ($pid == -1) {
@@ -44,6 +44,7 @@ Warning: stream_socket_client(): Failed to enable crypto in 
%s on line %d
 Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 
(Unknown error) in %s on line %d
 bool(false)
 resource(%d) of type (stream)
+resource(%d) of type (stream)
 
 Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not 
match expected CN=`foo.bar.test.com' in %s on line %d


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



[PHP-CVS] com php-src: Fixed bug that would lead to out of bounds memory access: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:8e847b5845b85c080295aea60c20869973c09a15
Author:Tjerk Meesters datib...@php.net Sat, 21 Sep 2013 19:38:09 
+0800
Parents:   8915c3fb4fa40743bdddf23013a63e014d03d02c
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8e847b5845b85c080295aea60c20869973c09a15

Log:
Fixed bug that would lead to out of bounds memory access

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 5460f3a..1c367df 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4831,26 +4831,36 @@ static int verify_callback(int preverify_ok, 
X509_STORE_CTX *ctx) /* {{{ */
 
 static int php_openssl_match_cn(const char *subjectname, const char *certname)
 {
-   int match = strcmp(subjectname, certname) == 0;
-
-   if (!match) {
-   char *wildcard = strchr(certname, '*');
-   int prefix_len = wildcard - certname;
-
-   /* 1) prefix, if not empty, must match */
-   if (wildcard  (prefix_len == 0 || strncmp(subjectname, 
certname, prefix_len) == 0)) {
-   const char *suffix = subjectname + strlen(subjectname) 
- strlen(wildcard + 1);
-
-   /*
-* 2) suffix must match
-* 3) no period between prefix and suffix
-   **/
-   match = strcmp(wildcard + 1, suffix) == 0 
-   memchr(subjectname + prefix_len, '.', suffix - 
subjectname - prefix_len) == NULL;
-   }
+   char *wildcard;
+   int prefix_len, suffix_len, subject_len;
+
+   if (strcmp(subjectname, certname) == 0) {
+   return 1;
}
 
-   return match;
+   if (!(wildcard = strchr(certname, '*'))) {
+   return 0;
+   }
+
+   // 1) prefix, if not empty, must match subject
+   prefix_len = wildcard - certname;
+   if (prefix_len  strncmp(subjectname, certname, prefix_len) != 0) {
+   return 0;
+   }
+
+   suffix_len = strlen(wildcard + 1);
+   subject_len = strlen(subjectname);
+   if (suffix_len = subject_len) {
+   const char *suffix = subjectname + subject_len - suffix_len;
+
+   /* 2) suffix must match
+* 3) no . between prefix and suffix
+**/
+   return strcmp(wildcard + 1, suffix) == 0 
+   memchr(subjectname + prefix_len, '.', suffix - 
subjectname - prefix_len) == NULL;
+   }
+
+   return 0;
 }
 
 int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream 
*stream TSRMLS_DC) /* {{{ */


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



[PHP-CVS] com php-src: Added two more test cases for CN matching.: ext/openssl/tests/bug65729.phpt

2013-10-08 Thread Michael Wallner
Commit:674dd73f8c34b9faf1e777a301e5302348b48b9d
Author:Tjerk Meesters datib...@php.net Mon, 7 Oct 2013 22:10:05 
+0800
Parents:   a820c3d6baac945ead4a5fe6e54d0a04b02620de
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=674dd73f8c34b9faf1e777a301e5302348b48b9d

Log:
Added two more test cases for CN matching.

Changed paths:
  M  ext/openssl/tests/bug65729.phpt


Diff:
diff --git a/ext/openssl/tests/bug65729.phpt b/ext/openssl/tests/bug65729.phpt
index d4645d9..7008f3c 100644
--- a/ext/openssl/tests/bug65729.phpt
+++ b/ext/openssl/tests/bug65729.phpt
@@ -13,24 +13,28 @@ stream_context_set_option($context, 'ssl', 
'allow_self_signed', true);
 $server = stream_socket_server('ssl://127.0.0.1:64321', $errno, $errstr,
STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
 
+$expected_names = array('foo.test.com.sg', 'foo.test.com', 'foo.bar.test.com');
+
 $pid = pcntl_fork();
 if ($pid == -1) {
die('could not fork');
 } else if ($pid) {
-   $contextC = stream_context_create(
-   array(
+   foreach ($expected_names as $expected_name) {
+   $contextC = stream_context_create(array(
'ssl' = array(
'verify_peer'   = true,
'allow_self_signed' = true,
-   'CN_match'  = 'foo.test.com.sg',
+   'CN_match'  = $expected_name,
)
-   )
-   );
-   var_dump(stream_socket_client(ssl://127.0.0.1:64321, $errno, $errstr, 
1,
+   ));
+   var_dump(stream_socket_client(ssl://127.0.0.1:64321, $errno, 
$errstr, 1,
STREAM_CLIENT_CONNECT, $contextC));
+   }
 } else {   
@pcntl_wait($status);
-   @stream_socket_accept($server, 1);
+   foreach ($expected_names as $name) {
+   @stream_socket_accept($server, 1);
+   }
 }
 --EXPECTF--
 Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not 
match expected CN=`foo.test.com.sg' in %s on line %d
@@ -39,4 +43,11 @@ Warning: stream_socket_client(): Failed to enable crypto in 
%s on line %d
 
 Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 
(Unknown error) in %s on line %d
 bool(false)
+resource(%d) of type (stream)
+
+Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not 
match expected CN=`foo.bar.test.com' in %s on line %d
+
+Warning: stream_socket_client(): Failed to enable crypto in %s on line %d
 
+Warning: stream_socket_client(): unable to connect to ssl://127.0.0.1:64321 
(Unknown error) in %s on line %d
+bool(false)


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



[PHP-CVS] com php-src: yay, reduced one variable: ext/openssl/openssl.c

2013-10-08 Thread Michael Wallner
Commit:a820c3d6baac945ead4a5fe6e54d0a04b02620de
Author:Tjerk Meesters datib...@php.net Sat, 21 Sep 2013 20:42:52 
+0800
Parents:   8e847b5845b85c080295aea60c20869973c09a15
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a820c3d6baac945ead4a5fe6e54d0a04b02620de

Log:
yay, reduced one variable

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 1c367df..2aa850a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4851,13 +4851,11 @@ static int php_openssl_match_cn(const char 
*subjectname, const char *certname)
suffix_len = strlen(wildcard + 1);
subject_len = strlen(subjectname);
if (suffix_len = subject_len) {
-   const char *suffix = subjectname + subject_len - suffix_len;
-
/* 2) suffix must match
 * 3) no . between prefix and suffix
 **/
-   return strcmp(wildcard + 1, suffix) == 0 
-   memchr(subjectname + prefix_len, '.', suffix - 
subjectname - prefix_len) == NULL;
+   return strcmp(wildcard + 1, subjectname + subject_len - 
suffix_len) == 0 
+   memchr(subjectname + prefix_len, '.', subject_len - 
suffix_len - prefix_len) == NULL;
}
 
return 0;


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



[PHP-CVS] com php-src: added better wildcard matching for CN: ext/openssl/openssl.c ext/openssl/tests/bug65729.pem ext/openssl/tests/bug65729.phpt

2013-10-08 Thread Michael Wallner
Commit:8915c3fb4fa40743bdddf23013a63e014d03d02c
Author:Tjerk Meesters tj...@muvee.com Sat, 21 Sep 2013 16:45:20 
+0800
Parents:   9e3bedcd73265acb3d190c894860bd9aa1015121
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8915c3fb4fa40743bdddf23013a63e014d03d02c

Log:
added better wildcard matching for CN

Changed paths:
  M  ext/openssl/openssl.c
  A  ext/openssl/tests/bug65729.pem
  A  ext/openssl/tests/bug65729.phpt


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 4aac4e3..5460f3a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4829,6 +4829,30 @@ static int verify_callback(int preverify_ok, 
X509_STORE_CTX *ctx) /* {{{ */
 }
 /* }}} */
 
+static int php_openssl_match_cn(const char *subjectname, const char *certname)
+{
+   int match = strcmp(subjectname, certname) == 0;
+
+   if (!match) {
+   char *wildcard = strchr(certname, '*');
+   int prefix_len = wildcard - certname;
+
+   /* 1) prefix, if not empty, must match */
+   if (wildcard  (prefix_len == 0 || strncmp(subjectname, 
certname, prefix_len) == 0)) {
+   const char *suffix = subjectname + strlen(subjectname) 
- strlen(wildcard + 1);
+
+   /*
+* 2) suffix must match
+* 3) no period between prefix and suffix
+   **/
+   match = strcmp(wildcard + 1, suffix) == 0 
+   memchr(subjectname + prefix_len, '.', suffix - 
subjectname - prefix_len) == NULL;
+   }
+   }
+
+   return match;
+}
+
 int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream 
*stream TSRMLS_DC) /* {{{ */
 {
zval **val = NULL;
@@ -4881,16 +4905,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
return FAILURE;
}
 
-   match = strcmp(cnmatch, buf) == 0;
-   if (!match  strlen(buf)  3  buf[0] == '*'  buf[1] == 
'.') {
-   /* Try wildcard */
-
-   if (strchr(buf+2, '.')) {
-   char *tmp = strstr(cnmatch, buf+1);
-
-   match = tmp  strcmp(tmp, buf+2)  tmp == 
strchr(cnmatch, '.');
-   }
-   }
+   match = php_openssl_match_cn(cnmatch, buf);
 
if (!match) {
/* didn't match */
diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem
new file mode 100644
index 000..dbeed6e
--- /dev/null
+++ b/ext/openssl/tests/bug65729.pem
@@ -0,0 +1,28 @@
+-BEGIN CERTIFICATE-
+MIICCTCCAXICCQDNMI29sowT7TANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT
+RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE
+AxQKKi50ZXN0LmNvbTAeFw0xMzA5MjEwNzUyMjRaFw0xNDA5MjEwNzUyMjRaMEkx
+CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli
+YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
+iQKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK03oAd1jTe
+Vd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOXZPG3UViD
+rtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQABMA0GCSqG
+SIb3DQEBBQUAA4GBAAS07u/Ke+EhEHidz6CG3Qcr+zg483JKRgZFyGz+YUKyyKKy
+fmLs7JieGJxYQjOmIpj/6X9Gnb2HjIPDnI6A+MV1emXDTnnmsgf2/lZGcthhpZn2
+rMbj9bI0iH6HwOVGtp4ZJA5fB7nj3J+gWNTCQzDDOxwX36d2LL9ua+UMnk/g
+-END CERTIFICATE-
+-BEGIN RSA PRIVATE KEY-
+MIICXQIBAAKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK0
+3oAd1jTeVd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOX
+ZPG3UViDrtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQAB
+AoGAeyzTwKPDl5QMRejHQL57GOwlH1vLcXrjv+VzwHZZKQ0IoKM++5fCQYf29KXp
+XPahaluGW2u9sWa8R/7wGcd0Q4RtquGzsgT3+AQsIc5KfIamyOyDaRVM/ymX3fWg
+gHIU7OOzB+ihOU8sHyRIwfbk01/kmrBXLRj8E31sy3i3PIECQQDQQYE+aN7Acrdt
+yN5CaqvbkiCGjRvASlemiTzPosgOtndyp21w1gakJwKYhYDk1N6A6Qb8REMZqM/U
+wFypldV/AkEAwfq6NFuhpGL6hDA7MvlyY1KiZ0cHetPUX+PgdNqy2DA+1Sv4i7gm
+Wd/uA651K7aPXuUaf9dKtPCmZwI4M6SEsQJBALW89HTqP7niYoDEEnITdPaghxHk
+gptERUln6lGo1L1CLus3gSI/JHyMLo+7scgAnEwTD62GRKhX0Ubwt+ymfTECQAY5
+fHYnppU20+EgBxZIqOIFCc8UmWnYmE0Ha/Fz/x8u1SVUBuK84wYpSGL32yyu7ATY
+hzQo/W229zABAzqtAdECQQCUdB7IBFpPnsfv/EUBFX7X/7zAc9JpACmu9It5ju8C
+KIsMuz/02D+TQoJNjdAngBM+4AJDIaGFgTMIfaDMh5L7
+-END RSA PRIVATE KEY-
diff --git a/ext/openssl/tests/bug65729.phpt b/ext/openssl/tests/bug65729.phpt
new file mode 100644
index 000..d4645d9
--- /dev/null
+++ b/ext/openssl/tests/bug65729.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #65729: CN_match gives false positive when wildcard is used
+--SKIPIF--
+?php 
+if (!extension_loaded(openssl)) die(skip);
+if (!function_exists('pcntl_fork')) die(skip no fork);
+--FILE--
+?php
+$context = stream_context_create();
+
+stream_context_set_option($context, 'ssl', 'local_cert', __DIR__ . 
/bug65729.pem);
+stream_context_set_option($context, 'ssl', 

[PHP-CVS] com php-src: Streams for ssl:// transports can now be configured to use a specific crypto method (SSLv3, SSLv2 etc.) by calling: ext/openssl/xp_ssl.c

2013-10-08 Thread Michael Wallner
Commit:ce2789558a970057539094ca9019d98ff09e831e
Author:Martin Jansen mar...@divbyzero.net Sat, 21 Sep 2013 
21:26:40 +0200
Parents:   9e3bedcd73265acb3d190c894860bd9aa1015121
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ce2789558a970057539094ca9019d98ff09e831e

Log:
Streams for ssl:// transports can now be configured to use a specific
crypto method (SSLv3, SSLv2 etc.) by calling

stream_context_set_option($ctx, ssl, crypto_method, $crypto_method)

where $crypto_method can be one of STREAM_CRYPTO_METHOD_SSLv2_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT, STREAM_CRYPTO_METHOD_SSLv23_CLIENT
or STREAM_CRYPTO_METHOD_TLS_CLIENT. SSLv23 remains the default crypto
method.

This change makes it possible to fopen() SSL URLs that are only
provided using SSL v3.

Changed paths:
  M  ext/openssl/xp_ssl.c


Diff:
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index d7ef42e..1ac8a02 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -853,6 +853,29 @@ php_stream_ops php_openssl_socket_ops = {
php_openssl_sockop_set_option,
 };
 
+static int get_crypto_method(php_stream_context *ctx) {
+if (ctx) {
+zval **val = NULL;
+long crypto_method;
+
+if (php_stream_context_get_option(ctx, ssl, crypto_method, 
val) == SUCCESS) {
+convert_to_long_ex(val);
+crypto_method = (long)Z_LVAL_PP(val);
+
+switch (crypto_method) {
+case STREAM_CRYPTO_METHOD_SSLv2_CLIENT:
+case STREAM_CRYPTO_METHOD_SSLv3_CLIENT:
+case STREAM_CRYPTO_METHOD_SSLv23_CLIENT:
+case STREAM_CRYPTO_METHOD_TLS_CLIENT:
+return crypto_method;
+}
+
+}
+}
+
+return STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
+}
+
 static char * get_sni(php_stream_context *ctx, const char *resourcename, 
size_t resourcenamelen, int is_persistent TSRMLS_DC) {
 
php_url *url;
@@ -939,7 +962,12 @@ php_stream *php_openssl_ssl_socket_factory(const char 
*proto, size_t protolen,

if (strncmp(proto, ssl, protolen) == 0) {
sslsock-enable_on_connect = 1;
-   sslsock-method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
+
+   /* General ssl:// transports can use a number
+* of crypto methods. The actual methhod can be
+* provided in the streams context options.
+*/ 
+   sslsock-method = get_crypto_method(context);
} else if (strncmp(proto, sslv2, protolen) == 0) {
 #ifdef OPENSSL_NO_SSL2
php_error_docref(NULL TSRMLS_CC, E_WARNING, SSLv2 support is 
not compiled into the OpenSSL library PHP is linked against);


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



[PHP-CVS] com php-src: Add unit test that covers setting the crypto method.: ext/openssl/tests/streams_crypto_method.pem ext/openssl/tests/streams_crypto_method.phpt

2013-10-08 Thread Michael Wallner
Commit:047877e8106ef9cb53f6a32dc8b645693d59e4b0
Author:Martin Jansen mar...@divbyzero.net Fri, 4 Oct 2013 
21:55:29 +0200
Parents:   ce2789558a970057539094ca9019d98ff09e831e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=047877e8106ef9cb53f6a32dc8b645693d59e4b0

Log:
Add unit test that covers setting the crypto method.

Changed paths:
  A  ext/openssl/tests/streams_crypto_method.pem
  A  ext/openssl/tests/streams_crypto_method.phpt


Diff:
diff --git a/ext/openssl/tests/streams_crypto_method.pem 
b/ext/openssl/tests/streams_crypto_method.pem
new file mode 100644
index 000..9d754d4
--- /dev/null
+++ b/ext/openssl/tests/streams_crypto_method.pem
@@ -0,0 +1,33 @@
+-BEGIN CERTIFICATE-
+MIIC5jCCAk+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBcMQswCQYDVQQGEwJBVTET
+MBEGA1UECBMKUXVlZW5zbGFuZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQx
+HDAaBgNVBAMTE1Rlc3QgUENBICgxMDI0IGJpdCkwHhcNOTkxMjAyMjEzNTQ4WhcN
+MDUwNzExMjEzNTQ4WjBcMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFu
+ZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxHDAaBgNVBAMTE1Rlc3QgUENB
+ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ2haT/f5Zwy
+V+MiuSDjSR62adBoSiBB7Usty44lXqsp9RICw+DCCxpsn/CfxPEDXLLd4olsWXc6
+JRcxGynbYmnzk+Z6aIPPJQhK3CTvaqGnWKZsA1m+WaUIUqJCuNTK4N+7hMAGaf6S
+S3e9HVgEQ4a34gXJ7VQFVIBNV1EnZRWHAgMBAAGjgbcwgbQwHQYDVR0OBBYEFE0R
+aEcrj18q1dw+G6nJbsTWR213MIGEBgNVHSMEfTB7gBRNEWhHK49fKtXcPhupyW7E
+1kdtd6FgpF4wXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
+BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
+NCBiaXQpggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAUa8B3pho
++Mvxeq9HsEzJxHIFQla05S5J/e/V+DQTYoKiRFchKPrDAdrzYSEvP3h4QJEtsNqQ
+JfOxg5M42uLFq7aPGWkF6ZZqZsYS+zA9IVT14g7gNA6Ne+5QtJqQtH9HA24st0T0
+Tga/lZ9M2ovImovaxSL/kRHbpCWcqWVxpOw=
+-END CERTIFICATE-
+-BEGIN RSA PRIVATE KEY-
+MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
+wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
+vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
+AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
+z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
+xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
+HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
+yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
+xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
+7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
+h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
+QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
+hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
+-END RSA PRIVATE KEY-
diff --git a/ext/openssl/tests/streams_crypto_method.phpt 
b/ext/openssl/tests/streams_crypto_method.phpt
new file mode 100644
index 000..7ac195b
--- /dev/null
+++ b/ext/openssl/tests/streams_crypto_method.phpt
@@ -0,0 +1,77 @@
+--TEST--
+Specific crypto method for ssl:// transports.
+--SKIPIF--
+?php 
+if (!extension_loaded('openssl')) die('skip, openssl required');
+if (!extension_loaded('pcntl')) die('skip, pcntl required');
+?
+--FILE--
+?php
+function client($port, $method) {
+   $ctx = stream_context_create();
+   stream_context_set_option($ctx, 'ssl', 'crypto_method', $method);
+
+   $fp = @fopen('https://127.0.0.1:' . $port . '/', 'r', false, $ctx);
+   if ($fp) {
+   fpassthru($fp);
+   fclose($fp);
+   }
+}
+
+function server($port, $transport) {
+$context = stream_context_create();
+
+stream_context_set_option($context, 'ssl', 'local_cert', 
dirname(__FILE__) . '/streams_crypto_method.pem');
+stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
+stream_context_set_option($context, 'ssl', 'verify_peer', false);
+
+$server = stream_socket_server($transport . '127.0.0.1:' . $port, 
$errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
+
+   $client = @stream_socket_accept($server);
+
+   if ($client) {
+   $in = '';
+   while (!preg_match('/\r?\n\r?\n/', $in)) {
+   $in .= fread($client, 2048);
+   }
+
+   $response = EOS
+HTTP/1.1 200 OK
+Content-Type: text/plain
+Content-Length: 13
+Connection: close
+
+Hello World!
+
+EOS;
+
+   fwrite($client, $response);
+   fclose($client);
+   exit();
+   }
+}
+
+$port1 = rand(15000, 16000);
+$port2 = rand(16001, 17000);
+
+$pid1 = pcntl_fork();
+$pid2 = pcntl_fork();
+
+if ($pid1 == 0  $pid2 != 0) {
+   server($port1, 'sslv3://');
+   exit;
+}
+
+if ($pid1 != 0  $pid2 == 0) {
+   server($port2, 'sslv3://');
+   exit;
+}
+
+client($port1, STREAM_CRYPTO_METHOD_SSLv3_CLIENT);
+client($port2, STREAM_CRYPTO_METHOD_SSLv2_CLIENT);
+
+pcntl_waitpid($pid1, $status);
+pcntl_waitpid($pid2, $status);
+?
+--EXPECTF--
+Hello World!


--
PHP CVS Mailing List 

[PHP-CVS] com php-src: openssl NEWS,UPGRADING: NEWS UPGRADING

2013-10-08 Thread Michael Wallner
Commit:cf6413ae7ca9773ea154df3b94ce9299435f0e33
Author:Michael Wallner m...@php.net Tue, 8 Oct 2013 16:20:07 +0200
Parents:   ea0578e223229a9e1fd84d6c29701aee21bc75ac
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=cf6413ae7ca9773ea154df3b94ce9299435f0e33

Log:
openssl NEWS,UPGRADING

Changed paths:
  M  NEWS
  M  UPGRADING


Diff:
diff --git a/NEWS b/NEWS
index 8113514..c2cf3d7 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,11 @@ PHP  
  NEWS
 cache_slots) in op_array-literals table. (Laruence, Dmitry)
   . Added script level constant replacement optimization pass. (Dmitry)
 
+- Openssl:
+  . Added crypto_method option for the ssl stream context. (Martin Jansen)
+  . Added certificate fingerprint support. (Tjerk Meesters)
+  . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters)
+  
 - PDO_pgsql:
   . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo)
   . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres  7.3
diff --git a/UPGRADING b/UPGRADING
index fb8daab..238aa5e 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -42,6 +42,11 @@ PHP X.Y UPGRADE NOTES
 
 - Added gost-crypto (CryptoPro S-box) hash algo.
 
+- Added openssl certificate fingerprint support (inclusive stream context 
+  option).
+
+- Added openssl crypto method stream context option.
+
 
 2. Changes in SAPI modules
 
@@ -71,6 +76,8 @@ PHP X.Y UPGRADE NOTES
 5. New Functions
 
 
+- Openssl:
+  Added string openssl_x509_fingerprint($x509, $type, $binary).
 
 
 6. New Classes and Interfaces
@@ -106,6 +113,11 @@ PHP X.Y UPGRADE NOTES
 9. New Global Constants
 
 
+- Openssl:
+  . STREAM_CRYPTO_METHOD_SSLv2_CLIENT
+  . STREAM_CRYPTO_METHOD_SSLv3_CLIENT
+  . STREAM_CRYPTO_METHOD_SSLv23_CLIENT
+  . STREAM_CRYPTO_METHOD_TLS_CLIENT
 
 
 10. Changes to INI File Handling


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



Re: [PHP-CVS] com php-src: DNS name comparison is now case insensitive.: ext/openssl/openssl.c ext/openssl/tests/bug65729.phpt

2013-10-08 Thread Johannes Schlüter
Hi,

On Tue, 2013-10-08 at 02:07 +, Michael Wallner wrote:
 
 Log:
 DNS name comparison is now case insensitive.
 
 -   if (strcmp(subjectname, certname) == 0) {
 +   if (strcasecmp(subjectname, certname) == 0) { 

Shouldn't that use an non-locale-dependent (ASCII based) comparison?
Else we get into trouble with the famous tolower(toupper('i')) != 'i'
issue in Turkish locales.

johannes



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



[PHP-CVS] com php-src: fixed failing tests for ICU = 51.2: ext/intl/tests/bug58756_MessageFormatter.phpt ext/intl/tests/collator_asort.phpt ext/intl/tests/collator_compare.phpt ext/intl/tests/collato

2013-10-07 Thread Anatol Belski
Commit:4840b0a749454335218f6131892031333d66142d
Author:Anatol Belski a...@php.net Mon, 7 Oct 2013 13:49:10 +0200
Parents:   fa40290fb76370c923e8f048daf1af144ff87604
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4840b0a749454335218f6131892031333d66142d

Log:
fixed failing tests for ICU = 51.2

Changed paths:
  M  ext/intl/tests/bug58756_MessageFormatter.phpt
  M  ext/intl/tests/collator_asort.phpt
  M  ext/intl/tests/collator_compare.phpt
  M  ext/intl/tests/collator_get_sort_key.phpt
  M  ext/intl/tests/collator_sort.phpt
  M  ext/intl/tests/collator_sort_with_sort_keys.phpt
  M  ext/intl/tests/dateformat_calendars.phpt
  M  ext/intl/tests/dateformat_create_cal_arg.phpt
  M  ext/intl/tests/dateformat_format.phpt
  M  ext/intl/tests/dateformat_formatObject_calendar.phpt
  M  ext/intl/tests/dateformat_formatObject_datetime.phpt
  M  ext/intl/tests/dateformat_format_parse.phpt
  M  ext/intl/tests/dateformat_get_set_calendar.phpt
  M  ext/intl/tests/dateformat_get_set_timezone.phpt
  M  ext/intl/tests/dateformat_set_timezone_id2.phpt
  M  ext/intl/tests/dateformat_timezone_arg_variations.phpt
  M  ext/intl/tests/formatter_get_locale.phpt
  M  ext/intl/tests/locale_filter_matches2.phpt
  M  ext/intl/tests/locale_get_display_name2.phpt
  M  ext/intl/tests/locale_get_display_region2.phpt
  M  ext/intl/tests/locale_lookup.phpt
  M  ext/intl/tests/msgfmt_format_intlcalendar.phpt
  M  ext/intl/tests/resourcebundle_null_mandatory_args.phpt
  M  ext/intl/tests/timezone_getDisplayName_variant2-49+.phpt

diff --git a/ext/intl/tests/bug58756_MessageFormatter.phpt 
b/ext/intl/tests/bug58756_MessageFormatter.phpt
index bbe96b7..18566b6 100644
--- a/ext/intl/tests/bug58756_MessageFormatter.phpt
+++ b/ext/intl/tests/bug58756_MessageFormatter.phpt
@@ -4,6 +4,9 @@ Bug #58756: w.r.t MessageFormatter
 ?php
 if (!extension_loaded('intl'))
die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '51.2') =  0)
+   die('skip for ICU  51.2');
+?
 --FILE--
 ?php
 ini_set(intl.error_level, E_WARNING);
@@ -31,4 +34,4 @@ echo msgf2: , $msgf-format(array($time, 'date')),  ,
 --EXPECT--
 date:  Tuesday, July 7, 2009 8:41:13 PM EDT
 msgf:  Tuesday, July 7, 2009 8:41:13 PM EDT
-==DONE==
\ No newline at end of file
+==DONE==
diff --git a/ext/intl/tests/collator_asort.phpt 
b/ext/intl/tests/collator_asort.phpt
index a614ddc..308f3a3 100644
--- a/ext/intl/tests/collator_asort.phpt
+++ b/ext/intl/tests/collator_asort.phpt
@@ -2,6 +2,7 @@
 asort()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_compare.phpt 
b/ext/intl/tests/collator_compare.phpt
index f10b570..7c07204 100644
--- a/ext/intl/tests/collator_compare.phpt
+++ b/ext/intl/tests/collator_compare.phpt
@@ -2,6 +2,7 @@
 compare()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_get_sort_key.phpt 
b/ext/intl/tests/collator_get_sort_key.phpt
index a9c4d71..58240d4 100644
--- a/ext/intl/tests/collator_get_sort_key.phpt
+++ b/ext/intl/tests/collator_get_sort_key.phpt
@@ -3,6 +3,8 @@ collator_get_sort_key()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
 ?php if(version_compare(INTL_ICU_VERSION, '4.8')  0) print 'skip ICU = 4.8 
only'; ?
+?php /* XXX Obviously it fails somewhere between = 4.8 and  51.2 */ 
+if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
@@ -95,4 +97,4 @@ key: 5c0a161801070107
 source: жжж
 key: 5c3a3a3a01070107
 source: эюя
-key: 5d3b3f4501070107
\ No newline at end of file
+key: 5d3b3f4501070107
diff --git a/ext/intl/tests/collator_sort.phpt 
b/ext/intl/tests/collator_sort.phpt
index 5cefe2f..e16eeea 100644
--- a/ext/intl/tests/collator_sort.phpt
+++ b/ext/intl/tests/collator_sort.phpt
@@ -2,6 +2,7 @@
 sort()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/collator_sort_with_sort_keys.phpt 
b/ext/intl/tests/collator_sort_with_sort_keys.phpt
index 2f489d7..8be9c97 100644
--- a/ext/intl/tests/collator_sort_with_sort_keys.phpt
+++ b/ext/intl/tests/collator_sort_with_sort_keys.phpt
@@ -2,6 +2,7 @@
 sort_with_sort_keys()
 --SKIPIF--
 ?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?
+?php if (version_compare(INTL_ICU_VERSION, '51.2') =  0) die('skip for ICU  
51.2'); ?
 --FILE--
 ?php
 
diff --git a/ext/intl/tests/dateformat_calendars.phpt 
b/ext/intl/tests/dateformat_calendars.phpt
index 6af02e5..2239af2 100644
--- a/ext/intl/tests/dateformat_calendars.phpt
+++ b/ext/intl/tests/dateformat_calendars.phpt
@@ -4,8 +4,8 @@ IntlDateFormatter, 

[PHP-CVS] com php-src: Merge branch 'PHP-5.5': sapi/cli/php_cli_server.c

2013-10-07 Thread Anatol Belski
Commit:4fe7ec33f1eef1ae0344acef6189911e03066b25
Author:Anatol Belski a...@php.net Mon, 7 Oct 2013 13:50:59 +0200
Parents:   9c7dbb0487f5991fde03873ea8f5e66d6688415f 
0117eb747e1b36a301d58fa29aa3ae48b5aa2ac7
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4fe7ec33f1eef1ae0344acef6189911e03066b25

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  added fixed tests for ICU = 51.2
  fixed failing tests for ICU = 51.2
  FIX BUG #65219 - Typo correction
  FIX BUG #65219 - USE DB not being sent for FreeTDS version  0.92 FreeTDS 
0.92 does not support DBSETLDBNAME option and therefore will not work with SQL 
Azure. Fallback to dbuse command in letter versions.
  - Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
encoding)
  - BFN

Bugs:
https://bugs.php.net/65219
https://bugs.php.net/65818

Changed paths:
  MM  sapi/cli/php_cli_server.c


Diff:



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



[PHP-CVS] com php-src: Add new tests: ext/oci8/tests/db_op_1.phpt ext/oci8/tests/db_op_2.phpt

2013-10-07 Thread Christopher Jones
Commit:1675fd22775c7067c5d21e0cc1a0cc81f9434a5c
Author:Christopher Jones s...@php.net Mon, 7 Oct 2013 17:26:00 
-0700
Parents:   12f9939b790a02ca3f22b91813029e78208f2c24
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=1675fd22775c7067c5d21e0cc1a0cc81f9434a5c

Log:
Add new tests

Changed paths:
  A  ext/oci8/tests/db_op_1.phpt
  A  ext/oci8/tests/db_op_2.phpt


Diff:
diff --git a/ext/oci8/tests/db_op_1.phpt b/ext/oci8/tests/db_op_1.phpt
new file mode 100644
index 000..f645cf8
--- /dev/null
+++ b/ext/oci8/tests/db_op_1.phpt
@@ -0,0 +1,61 @@
+--TEST--
+oci_set_db_operation: basic test for end-to-end tracing
+--SKIPIF--
+?php 
+if (!extension_loaded('oci8')) die (skip no oci8 extension); 
+$target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on 
these DBs
+require(dirname(__FILE__).'/skipif.inc');
+if (strcasecmp($user, system)  strcasecmp($user, sys)) {
+die(skip needs to be run as a DBA user);
+}
+preg_match('/.*Release 
([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/',
 oci_server_version($c), $matches);
+if (!(isset($matches[0])  $matches[1] = 12)) {
+die(skip expected output only valid when using Oracle Database 12c or 
greater);
+}
+preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
+if (!(isset($matches[0])  $matches[0] = 12)) { 
+die(skip works only with Oracle 12c or greater version of Oracle client 
libraries);
+}
+if (!function_exists('oci_set_db_operation'))
+{ 
+die(skip function oci_set_db_operation() does not exist);
+}
+?
+--FILE--
+?php
+
+require(dirname(__FILE__).'/connect.inc');
+
+// Run Test
+
+echo Test 1\n;
+
+// Test setting the DB operation used by Oracle DB for end-to-end 
application tracing
+
+function dq($c, $q)
+{
+$s = oci_parse($c, $q);
+oci_execute($s);
+var_dump(oci_fetch_assoc($s));
+}
+
+oci_set_db_operation($c, db_op_1);
+dq($c, 'select * from dual');
+
+dq($c, 'select dbop_name from v$sql_monitor where dbop_name is not null order 
by dbop_exec_id desc');
+
+?
+===DONE===
+?php exit(0); ?
+--EXPECTF--
+Test 1
+array(1) {
+  [DUMMY]=
+  string(1) X
+}
+array(1) {
+  [DBOP_NAME]=
+  string(7) db_op_1
+}
+===DONE===
+
diff --git a/ext/oci8/tests/db_op_2.phpt b/ext/oci8/tests/db_op_2.phpt
new file mode 100644
index 000..05c2269
--- /dev/null
+++ b/ext/oci8/tests/db_op_2.phpt
@@ -0,0 +1,69 @@
+--TEST--
+oci_set_db_operation: basic test for end-to-end tracing
+--SKIPIF--
+?php 
+if (!extension_loaded('oci8')) die (skip no oci8 extension); 
+$target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on 
these DBs
+require(dirname(__FILE__).'/skipif.inc');
+if (strcasecmp($user, system)  strcasecmp($user, sys)) {
+die(skip needs to be run as a DBA user);
+}
+preg_match('/.*Release 
([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/',
 oci_server_version($c), $matches);
+if (!(isset($matches[0])  $matches[1] = 12)) {
+die(skip expected output only valid when using Oracle Database 12c or 
greater);
+}
+preg_match('/^[[:digit:]]+/', oci_client_version(), $matches);
+if (!(isset($matches[0])  $matches[0] = 12)) { 
+die(skip works only with Oracle 12c or greater version of Oracle client 
libraries);
+}
+if (!function_exists('oci_set_db_operation'))
+{ 
+die(skip function oci_set_db_operation() does not exist);
+}
+?
+--FILE--
+?php
+
+require(dirname(__FILE__).'/connect.inc');
+
+function dq($c, $q)
+{
+$s = oci_parse($c, $q);
+oci_execute($s);
+var_dump(oci_fetch_assoc($s));
+}
+
+echo Test 1\n;
+oci_set_db_operation($c, db_op_2_a);
+dq($c, 'select * from dual');
+
+echo Test 2\n;
+oci_set_db_operation($c, db_op_2_b);
+dq($c, 'select * from dual');
+
+echo Test 3\n;
+dq($c, 'select dbop_name from v$sql_monitor where dbop_name like \'db_op2%\' 
order by dbop_exec_id desc');
+
+?
+===DONE===
+?php exit(0); ?
+--XFAIL--
+Fails due to Oracle Bug 16695981
+--EXPECTF--
+Test 1
+array(1) {
+  [DUMMY]=
+  string(1) X
+}
+Test 2
+array(1) {
+  [DUMMY]=
+  string(1) X
+}
+Test 3
+array(2) {
+  [DBOP_NAME]=
+  string(7) db_op_2a
+}
+===DONE===
+


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



[PHP-CVS] com php-src: Bump mininum requirements for PHP OCI8 2.0 to PHP 5.2 and Oracle client library 10.2 (Note this will connect to Oracle Database 8.1.7 onwards). Use the older OCI8 1.4 from PECL

2013-10-07 Thread Christopher Jones
Commit:12f9939b790a02ca3f22b91813029e78208f2c24
Author:Christopher Jones s...@php.net Mon, 7 Oct 2013 17:23:11 
-0700
Parents:   4fe7ec33f1eef1ae0344acef6189911e03066b25
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=12f9939b790a02ca3f22b91813029e78208f2c24

Log:
Bump mininum requirements for PHP OCI8 2.0 to PHP 5.2 and Oracle
client library 10.2 (Note this will connect to Oracle Database 8.1.7
onwards). Use the older OCI8 1.4 from PECL if using an earlier PHP
version or older Oracle client library support is necessary.

Changed paths:
  M  ext/oci8/config.m4
  M  ext/oci8/config.w32
  M  ext/oci8/oci8.c
  M  ext/oci8/oci8_collection.c
  M  ext/oci8/oci8_interface.c
  M  ext/oci8/oci8_lob.c
  M  ext/oci8/package.xml
  M  ext/oci8/php_oci8_int.h

diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 3873a22..0d08d21 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -208,8 +208,8 @@ if test $PHP_OCI8 != no; then
   IFS=$ac_IFS
   oci8_php_version=`expr [$]1 \* 100 + [$]2 \* 1000 + [$]3`
 
-  if test $oci8_php_version -lt 4003009; then
-AC_MSG_ERROR([You need at least PHP 4.3.9 to be able to use this version 
of OCI8. PHP $php_version found])
+  if test $oci8_php_version -lt 5002000; then
+AC_MSG_ERROR([You need at least PHP 5.2.0 to be able to use this version 
of OCI8. PHP $php_version found])
   else
 AC_MSG_RESULT([$php_version, ok])
   fi
@@ -332,24 +332,8 @@ if test $PHP_OCI8 != no; then
 AC_OCI8_ORACLE_VERSION($OCI8_DIR)
 
 case $OCI8_ORACLE_VERSION in
-  7.3|8.0|8.1)
-   AC_MSG_ERROR([Oracle client libraries  9.2 are not supported])
-   ;;
-
-  9.0)
-   PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
-   [
- OCI8_ORACLE_VERSION=9.2
-   ],
-   [
- AC_MSG_ERROR([Oracle client libraries  9.2 are not supported])
-   ], [
- -L$OCI8_DIR/$OCI8_LIB_DIR $OCI8_SHARED_LIBADD
-   ])
-   ;;
-
-  *)
-   AC_DEFINE(HAVE_OCI_LOB_READ2,1,[Defined to 1 if OCI8 configuration 
located Oracle's OCILobRead2 function])
+  7.3|8.0|8.1|9.0)
+   AC_MSG_ERROR([Oracle client libraries  10 are not supported])
;;
 esac
 
@@ -425,7 +409,6 @@ if test $PHP_OCI8 != no; then
 PHP_ADD_LIBPATH($PHP_OCI8_INSTANT_CLIENT, OCI8_SHARED_LIBADD)
 
 AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration 
located Oracle's Instant Client libraries])
-AC_DEFINE(HAVE_OCI_LOB_READ2,1,[Defined to 1 if OCI8 configuration located 
Oracle's OCILobRead2 function])
 
 PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c 
oci8_collection.c oci8_interface.c, $ext_shared)
 AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle 
Database is configured])
diff --git a/ext/oci8/config.w32 b/ext/oci8/config.w32
index ac573a8..750f163 100644
--- a/ext/oci8/config.w32
+++ b/ext/oci8/config.w32
@@ -29,8 +29,6 @@ if (PHP_OCI8_12C != no) {
 
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
-   AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
-
} else {
WARNING(oci8-12c not enabled: Oracle Database client libraries 
or Oracle Database 12c Instant Client not found);
PHP_OCI8_12C = no
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index eeb1ade..f8abacf 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -39,12 +39,9 @@
 
 #if HAVE_OCI8
 
-#if PHP_MAJOR_VERSION  5
-#error This version of the PHP OCI8 extension is not compatible with PHP 6 or 
later
-#elif PHP_MAJOR_VERSION  5
-#ifdef ZTS
-#error The PHP OCI8 extension does not support ZTS mode in PHP 4
-#endif
+/* PHP 5.2 is the minimum supported version for OCI8 2.0 */
+#if PHP_MAJOR_VERSION  5 || (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION = 1)
+#error Use PHP OCI8 1.4 for your version of PHP
 #endif
 
 #include php_oci8.h
@@ -66,11 +63,8 @@
 #endif
 
 ZEND_DECLARE_MODULE_GLOBALS(oci)
-#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION  1) || (PHP_MAJOR_VERSION  
5)
-/* This if allows PECL builds from this file to be portable to older PHP 
releases */
 static PHP_GINIT_FUNCTION(oci);
 static PHP_GSHUTDOWN_FUNCTION(oci);
-#endif
 
 /* Allow PHP 5.3 branch to be used in PECL for 5.x compatible builds */
 #ifndef Z_ADDREF_P
@@ -1055,16 +1049,11 @@ zend_module_entry oci8_module_entry = {
PHP_RSHUTDOWN(oci),   /* per-request shutdown function */
PHP_MINFO(oci),   /* information function */
PHP_OCI8_VERSION,
-#if (PHP_MAJOR_VERSION == 5  PHP_MINOR_VERSION  1) || (PHP_MAJOR_VERSION  
5)
-   /* This check allows PECL builds from this file to be portable to older 
PHP releases */
PHP_MODULE_GLOBALS(oci),  /* globals descriptor */
PHP_GINIT(oci),   /* globals ctor */
PHP_GSHUTDOWN(oci),   /* globals dtor */
NULL, /* post deactivate */
STANDARD_MODULE_PROPERTIES_EX

[PHP-CVS] com php-src: Add new tests to package.xml: ext/oci8/package.xml

2013-10-07 Thread Christopher Jones
Commit:f0863fa43aa2201b7e2a749f5a8e98e519cfd47f
Author:Christopher Jones s...@php.net Mon, 7 Oct 2013 17:38:56 
-0700
Parents:   1675fd22775c7067c5d21e0cc1a0cc81f9434a5c
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f0863fa43aa2201b7e2a749f5a8e98e519cfd47f

Log:
Add new tests to package.xml

Changed paths:
  M  ext/oci8/package.xml


Diff:
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index d2c4972..47e5415 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -227,6 +227,8 @@ Oracle client library support is necessary.
 file name=cursors_old.phpt role=test /
 file name=cursors.phpt role=test /
 file name=dbmsoutput.phpt role=test /
+file name=db_op_1.phpt role=test /
+file name=db_op_2.phpt role=test /
 file name=debug.phpt role=test /
 file name=default_prefetch0.phpt role=test /
 file name=default_prefetch1.phpt role=test /


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



[PHP-CVS] svn: /SVNROOT/ global_avail

2013-10-06 Thread Ferenc Kovacs
tyrael   Sun, 06 Oct 2013 10:20:11 +

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

Log:
memcache was moved to git

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2013-10-06 07:55:13 UTC (rev 331704)
+++ SVNROOT/global_avail2013-10-06 10:20:11 UTC (rev 331705)
@@ -263,7 +263,7 @@
 avail|mboeren|pecl/dbx
 avail|lcastelli|pecl/chdb,phpdoc
 avail|traufeisen,jandrade|pecl/gnupg,phpdoc/en/reference/gnupg
-avail|mikl|pecl/memcache,pecl/wbxml,pecl/ocal,pecl/pam
+avail|mikl|pecl/caching/memcache.git,pecl/wbxml,pecl/ocal,pecl/pam
 avail|ohill|pecl/stem
 avail|gwang|pecl/litespeed,php-src.git/sapi/litespeed
 avail|jsjohnst|pecl/flitetts
@@ -333,7 +333,7 @@
 avail|dmendolia,patrickallaert,dragoonis|pecl/apm,phpdoc
 avail|bd808|pecl/file_formats/yaml.git,phpdoc
 avail|dchill42pecl|pecl/xdom,phpdoc
-avail|hradtke|pecl/memcache,phpdoc
+avail|hradtke|pecl/caching/memcache.git,phpdoc
 avail|pdezwart,brodriguez,bkw|pecl/amqp,phpdoc
 avail|ssufficool|php-src.git/ext/pdo_dblib,php-src.git/NEWS
 avail|ben|php-src.git/tests

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

[PHP-CVS] com php-src: fixing a minor typo in CODING_STANDARDS document: CODING_STANDARDS

2013-10-06 Thread Lior Kaplan
Commit:b5a0f128718d93a236b450bb9b409477f0a97888
Author:ArunSK arunsk@gmail.com Mon, 7 Oct 2013 00:26:49 +0200
Committer: Lior Kaplan kaplanl...@gmail.com  Mon, 7 Oct 2013 00:26:49 
+0200
Parents:   63f242178d33fa22346d2e976b06a76455dbd6ab
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b5a0f128718d93a236b450bb9b409477f0a97888

Log:
fixing a minor typo in CODING_STANDARDS document

Changed paths:
  M  CODING_STANDARDS


Diff:
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index 7413be4..5ceacdc 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -151,7 +151,7 @@ Naming Conventions
 
 7.  Classes should be given descriptive names. Avoid using abbreviations where
 possible. Each word in the class name should start with a capital letter,
-without underscore delimiters (CampelCaps starting with a capital letter).
+without underscore delimiters (CamelCaps starting with a capital letter).
 The class name should be prefixed with the name of the 'parent set' (e.g.
 the name of the extension)::


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



[PHP-CVS] com php-src: - BFN: NEWS

2013-10-05 Thread Felipe Pena
Commit:248afd1c3c0c923c15d7544b4a588396ad0c136e
Author:Felipe Pena felipe...@gmail.com Sat, 5 Oct 2013 12:52:32 
-0300
Parents:   6a823071f9b321ca8580d082c99829b1caffa8a3
Branches:  PHP-5.4 PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=248afd1c3c0c923c15d7544b4a588396ad0c136e

Log:
- BFN

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 7a7ceca..fcf34c3 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP
NEWS
 |||
 ?? ??? 2013, PHP 5.4.22
 
+- CLI server:
+  . Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
+encoding). (Felipe)
+
 - FTP:
   . Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)


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



[PHP-CVS] com php-src: - Fixed bug #65818 (Segfault with built-in webserver and chunked transfer encoding): sapi/cli/php_cli_server.c

2013-10-05 Thread Felipe Pena
Commit:3aaee86ee33af276d2e879f5a645cc6dc850de22
Author:Felipe Pena felipe...@gmail.com Sat, 5 Oct 2013 12:52:55 
-0300
Parents:   248afd1c3c0c923c15d7544b4a588396ad0c136e
Branches:  PHP-5.4 PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=3aaee86ee33af276d2e879f5a645cc6dc850de22

Log:
- Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
encoding)

Bugs:
https://bugs.php.net/65818

Changed paths:
  M  sapi/cli/php_cli_server.c


Diff:
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 4da55ac..aa4b2cd 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1589,6 +1589,7 @@ static int 
php_cli_server_client_read_request_on_body(php_http_parser *parser, c
}
client-request.content_len = 0;
}
+   client-request.content = perealloc(client-request.content, 
client-request.content_len + length, 1);
memmove(client-request.content + client-request.content_len, at, 
length);
client-request.content_len += length;
return 0;


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: sapi/cli/php_cli_server.c

2013-10-05 Thread Felipe Pena
Commit:93f3ba66a7e238f82706cc38006836022a53aeb4
Author:Felipe Pena felipe...@gmail.com Sat, 5 Oct 2013 12:53:10 
-0300
Parents:   5bc377457e155ceaddd27a536467a4d353fdcd4f 
3aaee86ee33af276d2e879f5a645cc6dc850de22
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=93f3ba66a7e238f82706cc38006836022a53aeb4

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  - Fixed bug #65818 (Segfault with built-in webserver and chunked transfer 
encoding)
  - BFN

Bugs:
https://bugs.php.net/65818

Changed paths:
  MM  sapi/cli/php_cli_server.c


Diff:



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



[PHP-CVS] com php-src: FIX BUG #65219 - USE DB not being sent for FreeTDS version 0.92 FreeTDS 0.92 does not support DBSETLDBNAME option and therefore will not work with SQL Azure. Fallback to dbus

2013-10-05 Thread Stanley Sufficool
Commit:690bbe170d9ed4597629e4e986575fbe0a2cb796
Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013 
09:54:45 -0700
Parents:   ac05cfb49912dd87264573df930d0ead3c3e0cca
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=690bbe170d9ed4597629e4e986575fbe0a2cb796

Log:
FIX BUG #65219 - USE DB not being sent for FreeTDS version  0.92
FreeTDS 0.92 does not support DBSETLDBNAME option and therefore
will not work with SQL Azure. Fallback to dbuse command in
letter versions.

Bugs:
https://bugs.php.net/65219

Changed paths:
  M  ext/pdo_dblib/dblib_driver.c


Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 2aaf397..13444b8 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
 
DBSETLAPP(H-login, vars[1].optval);
 
+/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */
 #ifdef DBSETLDBNAME
if (vars[3].optval) {
-   DBSETLDBNAME(H-login, vars[3].optval);
+   if(FAIL == DBSETLDBNAME(H-login, vars[3].optval)) goto cleanup;
}
 #endif
 
@@ -362,6 +363,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
goto cleanup;
}
 
+/*
+ * FreeTDS  0.92 does not support the DBSETLDBNAME option
+ * Send use database here after login (Will not work with SQL Azure)
+ */
+#ifndef DBSETLDBNAME
+   if (vars[3].optval) {
+   if(FAIL == dbuse(H-link, vars[3].optval)) goto gleanup;
+   }
+#endif
+
 #if PHP_DBLIB_IS_MSSQL
/* dblib do not return more than this length from text/image */
DBSETOPT(H-link, DBTEXTLIMIT, 2147483647);
@@ -377,23 +388,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
dbh-max_escaped_char_length = 2;
dbh-alloc_own_columns = 1;
 
-#if 0
-   /* Cache the supported data types from the servers systypes table */
-   if(dbcmd(H-link, select usertype, name from systypes order by 
usertype) != FAIL) {
-   if(dbsqlexec(H-link) != FAIL) {
-   dbresults(H-link);
-   while (dbnextrow(H-link) == SUCCESS) {
-   val = dbdata(H-link, 1);   

-   add_index_string(pdo_dblib_datatypes, *val, 
dbdata(H-link, 2), 1);
-   }
-   }
-   /* Throw out any remaining resultsets */
-   dbcancel(H-link);
-   }
-#endif
-   
-
-
 cleanup:
for (i = 0; i  nvars; i++) {
if (vars[i].freeme) {


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



[PHP-CVS] com php-src: FIX BUG #65219 - USE DB not being sent for FreeTDS version 0.92 FreeTDS 0.92 does not support DBSETLDBNAME option and therefore will not work with SQL Azure. Fallback to dbus

2013-10-05 Thread Stanley Sufficool
Commit:5ce23f39d51b1fc53a731d9fd7d419714d3de9fb
Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013 
09:54:45 -0700
Parents:   93f3ba66a7e238f82706cc38006836022a53aeb4
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5ce23f39d51b1fc53a731d9fd7d419714d3de9fb

Log:
FIX BUG #65219 - USE DB not being sent for FreeTDS version  0.92
FreeTDS 0.92 does not support DBSETLDBNAME option and therefore
will not work with SQL Azure. Fallback to dbuse command in
letter versions.

Bugs:
https://bugs.php.net/65219

Changed paths:
  M  ext/pdo_dblib/dblib_driver.c


Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 2aaf397..13444b8 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
 
DBSETLAPP(H-login, vars[1].optval);
 
+/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */
 #ifdef DBSETLDBNAME
if (vars[3].optval) {
-   DBSETLDBNAME(H-login, vars[3].optval);
+   if(FAIL == DBSETLDBNAME(H-login, vars[3].optval)) goto cleanup;
}
 #endif
 
@@ -362,6 +363,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
goto cleanup;
}
 
+/*
+ * FreeTDS  0.92 does not support the DBSETLDBNAME option
+ * Send use database here after login (Will not work with SQL Azure)
+ */
+#ifndef DBSETLDBNAME
+   if (vars[3].optval) {
+   if(FAIL == dbuse(H-link, vars[3].optval)) goto gleanup;
+   }
+#endif
+
 #if PHP_DBLIB_IS_MSSQL
/* dblib do not return more than this length from text/image */
DBSETOPT(H-link, DBTEXTLIMIT, 2147483647);
@@ -377,23 +388,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
dbh-max_escaped_char_length = 2;
dbh-alloc_own_columns = 1;
 
-#if 0
-   /* Cache the supported data types from the servers systypes table */
-   if(dbcmd(H-link, select usertype, name from systypes order by 
usertype) != FAIL) {
-   if(dbsqlexec(H-link) != FAIL) {
-   dbresults(H-link);
-   while (dbnextrow(H-link) == SUCCESS) {
-   val = dbdata(H-link, 1);   

-   add_index_string(pdo_dblib_datatypes, *val, 
dbdata(H-link, 2), 1);
-   }
-   }
-   /* Throw out any remaining resultsets */
-   dbcancel(H-link);
-   }
-#endif
-   
-
-
 cleanup:
for (i = 0; i  nvars; i++) {
if (vars[i].freeme) {


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



Re: [PHP-CVS] com php-src: FIX BUG #65219 - USE DB not being sent for FreeTDS version 0.92 FreeTDS 0.92 does not support DBSETLDBNAME option and therefore will not work with SQL Azure. Fallback to

2013-10-05 Thread Nikita Popov
On Sat, Oct 5, 2013 at 6:54 PM, Stanley Sufficool ssuffic...@php.netwrote:

 Commit:690bbe170d9ed4597629e4e986575fbe0a2cb796
 Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013
 09:54:45 -0700
 Parents:   ac05cfb49912dd87264573df930d0ead3c3e0cca
 Branches:  PHP-5.4

 Link:
 http://git.php.net/?p=php-src.git;a=commitdiff;h=690bbe170d9ed4597629e4e986575fbe0a2cb796

 Log:
 FIX BUG #65219 - USE DB not being sent for FreeTDS version  0.92
 FreeTDS 0.92 does not support DBSETLDBNAME option and therefore
 will not work with SQL Azure. Fallback to dbuse command in
 letter versions.

 Bugs:
 https://bugs.php.net/65219

 Changed paths:
   M  ext/pdo_dblib/dblib_driver.c


 Diff:
 diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
 index 2aaf397..13444b8 100644
 --- a/ext/pdo_dblib/dblib_driver.c
 +++ b/ext/pdo_dblib/dblib_driver.c
 @@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh,
 zval *driver_options TSRMLS_

 DBSETLAPP(H-login, vars[1].optval);

 +/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */
  #ifdef DBSETLDBNAME
 if (vars[3].optval) {
 -   DBSETLDBNAME(H-login, vars[3].optval);
 +   if(FAIL == DBSETLDBNAME(H-login, vars[3].optval)) goto
 cleanup;
 }
  #endif

 @@ -362,6 +363,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh,
 zval *driver_options TSRMLS_
 goto cleanup;
 }

 +/*
 + * FreeTDS  0.92 does not support the DBSETLDBNAME option
 + * Send use database here after login (Will not work with SQL Azure)
 + */
 +#ifndef DBSETLDBNAME
 +   if (vars[3].optval) {
 +   if(FAIL == dbuse(H-link, vars[3].optval)) goto gleanup;
 +   }
 +#endif


Is that supposed to be gleanup?

Furthermore this does not look properly merged, see
https://github.com/php/php-src/network (PHP-5.4 not merged into PHP-5.5,
PHP-5.5 not merged into master).

Nikita


[PHP-CVS] com php-src: Fix bug #64338 pdo_dblib can't connect to Azure SQL: ext/pdo_dblib/dblib_driver.c

2013-10-05 Thread Stanley Sufficool
Commit:9c7dbb0487f5991fde03873ea8f5e66d6688415f
Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013 
18:26:25 -0700
Parents:   3e023c3ddf9e80046803a989f4951ee16d3b8f9b
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9c7dbb0487f5991fde03873ea8f5e66d6688415f

Log:
Fix bug #64338 pdo_dblib can't connect to Azure SQL

Bugs:
https://bugs.php.net/64338

Changed paths:
  M  ext/pdo_dblib/dblib_driver.c


Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 8e4cbb7..daf5494 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -350,9 +350,10 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
 
DBSETLAPP(H-login, vars[1].optval);
 
+/* DBSETLDBNAME is only available in FreeTDS 0.92 or above */
 #ifdef DBSETLDBNAME
if (vars[3].optval) {
-   DBSETLDBNAME(H-login, vars[3].optval);
+   if(FAIL == DBSETLDBNAME(H-login, vars[3].optval)) goto cleanup;
}
 #endif
 
@@ -362,6 +363,16 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
goto cleanup;
}
 
+/*
+ * FreeTDS  0.92 does not support the DBSETLDBNAME option
+ * Send use database here after login (Will not work with SQL Azure)
+ */
+#ifndef DBSETLDBNAME
+   if (vars[3].optval) {
+   if(FAIL == dbuse(H-link, vars[3].optval)) goto cleanup;
+   }
+#endif
+
 #if PHP_DBLIB_IS_MSSQL
/* dblib do not return more than this length from text/image */
DBSETOPT(H-link, DBTEXTLIMIT, 2147483647);
@@ -371,29 +382,12 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
DBSETOPT(H-link, DBTEXTSIZE, 2147483647);
 
/* allow double quoted indentifiers */
-   DBSETOPT(H-link, DBQUOTEDIDENT, NULL);
+   DBSETOPT(H-link, DBQUOTEDIDENT, 1);
 
ret = 1;
dbh-max_escaped_char_length = 2;
dbh-alloc_own_columns = 1;
 
-#if 0
-   /* Cache the supported data types from the servers systypes table */
-   if(dbcmd(H-link, select usertype, name from systypes order by 
usertype) != FAIL) {
-   if(dbsqlexec(H-link) != FAIL) {
-   dbresults(H-link);
-   while (dbnextrow(H-link) == SUCCESS) {
-   val = dbdata(H-link, 1);   

-   add_index_string(pdo_dblib_datatypes, *val, 
dbdata(H-link, 2), 1);
-   }
-   }
-   /* Throw out any remaining resultsets */
-   dbcancel(H-link);
-   }
-#endif
-   
-
-
 cleanup:
for (i = 0; i  nvars; i++) {
if (vars[i].freeme) {


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



[PHP-CVS] com php-src: FIX BUG #65219 - Typo correction: ext/pdo_dblib/dblib_driver.c

2013-10-05 Thread Stanley Sufficool
Commit:fa40290fb76370c923e8f048daf1af144ff87604
Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013 
21:00:47 -0700
Parents:   5ce23f39d51b1fc53a731d9fd7d419714d3de9fb
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fa40290fb76370c923e8f048daf1af144ff87604

Log:
FIX BUG #65219 - Typo correction

Bugs:
https://bugs.php.net/65219

Changed paths:
  M  ext/pdo_dblib/dblib_driver.c


Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 13444b8..daf5494 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -369,7 +369,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
  */
 #ifndef DBSETLDBNAME
if (vars[3].optval) {
-   if(FAIL == dbuse(H-link, vars[3].optval)) goto gleanup;
+   if(FAIL == dbuse(H-link, vars[3].optval)) goto cleanup;
}
 #endif


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



[PHP-CVS] com php-src: FIX BUG #65219 - Typo correction: ext/pdo_dblib/dblib_driver.c

2013-10-05 Thread Stanley Sufficool
Commit:63f242178d33fa22346d2e976b06a76455dbd6ab
Author:Stanley Sufficool ssuffic...@php.net Sat, 5 Oct 2013 
20:59:20 -0700
Parents:   d74b9cfee528936a50af7772c3dc56843a068c7f
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=63f242178d33fa22346d2e976b06a76455dbd6ab

Log:
FIX BUG #65219 - Typo correction

Bugs:
https://bugs.php.net/65219

Changed paths:
  M  ext/pdo_dblib/dblib_driver.c


Diff:
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 13444b8..daf5494 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -369,7 +369,7 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval 
*driver_options TSRMLS_
  */
 #ifndef DBSETLDBNAME
if (vars[3].optval) {
-   if(FAIL == dbuse(H-link, vars[3].optval)) goto gleanup;
+   if(FAIL == dbuse(H-link, vars[3].optval)) goto cleanup;
}
 #endif


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



[PHP-CVS] com php-src: Fixed bug #64230 (XMLReader does not suppress errors): NEWS ext/xmlreader/php_xmlreader.c ext/xmlreader/tests/bug64230.phpt

2013-10-04 Thread Michael Wallner
Commit:f6ff3a28d60c24dea2a05344d9b7eb823f09b4e5
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 11:22:17 +0200
Parents:   dc3d360a0ff8c17cb2ce2030813d30b578249be9
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f6ff3a28d60c24dea2a05344d9b7eb823f09b4e5

Log:
Fixed bug #64230 (XMLReader does not suppress errors)

Bugs:
https://bugs.php.net/64230

Changed paths:
  M  NEWS
  M  ext/xmlreader/php_xmlreader.c
  A  ext/xmlreader/tests/bug64230.phpt


Diff:
diff --git a/NEWS b/NEWS
index ffde301..9963714 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ PHP 
   NEWS
 
 - XMLReader:
   . Fixed bug #51936 (Crash with clone XMLReader). (Mike)
+  . Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
 
 
 ?? ??? 2013, PHP 5.4.21
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 8b80320..adf2821 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -805,7 +805,6 @@ PHP_METHOD(xmlreader, read)
if (intern != NULL  intern-ptr != NULL) {
retval = xmlTextReaderRead(intern-ptr);
if (retval == -1) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, An Error 
Occurred while reading);
RETURN_FALSE;
} else {
RETURN_BOOL(retval);
@@ -847,7 +846,6 @@ PHP_METHOD(xmlreader, next)
retval = xmlTextReaderNext(intern-ptr); 
}
if (retval == -1) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, An Error 
Occurred while reading);
RETURN_FALSE;
} else {
RETURN_BOOL(retval);
diff --git a/ext/xmlreader/tests/bug64230.phpt 
b/ext/xmlreader/tests/bug64230.phpt
new file mode 100644
index 000..0b07092
--- /dev/null
+++ b/ext/xmlreader/tests/bug64230.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #64230 (XMLReader does not suppress errors)
+--SKIPIF--
+?php
+extension_loaded(xmlreader) or die(skip requires xmlreader);
+?
+--FILE--
+?php
+echo Test\n;
+
+function show_internal_errors() {
+   foreach (libxml_get_errors() as $error) {
+   printf(Internal: %s\n, $error-message);
+   }
+   libxml_clear_errors();
+}
+
+echo Internal errors TRUE\n;
+libxml_use_internal_errors(true);
+
+$x = new XMLReader;
+$x-xml(root att/);
+$x-read();
+
+show_internal_errors();
+
+echo Internal errors FALSE\n;
+libxml_use_internal_errors(false);
+
+$x = new XMLReader;
+$x-xml(root att/);
+$x-read();
+
+show_internal_errors();
+
+?
+Done
+--EXPECTF--
+Test
+Internal errors TRUE
+Internal: Specification mandate value for attribute att
+
+Internal errors FALSE
+
+Warning: XMLReader::read(): %s: parser error : Specification mandate value for 
attribute att in %s on line %d
+
+Warning: XMLReader::read(): root att/ in %s on line %d
+
+Warning: XMLReader::read():  ^ in %s on line %d
+Done


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/xmlreader/php_xmlreader.c

2013-10-04 Thread Michael Wallner
Commit:2e2bda3508444190cb9b707dffe328a263ec60a1
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 11:22:43 +0200
Parents:   92fd085ebfb4cc8256cad235a51b34b246a4c3b7 
f6ff3a28d60c24dea2a05344d9b7eb823f09b4e5
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=2e2bda3508444190cb9b707dffe328a263ec60a1

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fixed bug #64230 (XMLReader does not suppress errors)

Bugs:
https://bugs.php.net/64230

Changed paths:
  MM  ext/xmlreader/php_xmlreader.c


Diff:
diff --cc ext/xmlreader/php_xmlreader.c
index 464998c,adf2821..aae55c8
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@@ -844,10 -843,9 +843,9 @@@ PHP_METHOD(xmlreader, next
if 
(xmlStrEqual(xmlTextReaderConstLocalName(intern-ptr), (xmlChar *)name)) {
RETURN_TRUE;
}
 -  retval = xmlTextReaderNext(intern-ptr); 
 +  retval = xmlTextReaderNext(intern-ptr);
}
if (retval == -1) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, An Error 
Occurred while reading);
RETURN_FALSE;
} else {
RETURN_BOOL(retval);


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/xmlreader/php_xmlreader.c

2013-10-04 Thread Michael Wallner
Commit:e13e5b17ffce68c7ea65d3410a6b4fe433135914
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 11:22:52 +0200
Parents:   099b295646b108ad56d1ec3b37dfcb5812fd378c 
2e2bda3508444190cb9b707dffe328a263ec60a1
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e13e5b17ffce68c7ea65d3410a6b4fe433135914

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Fixed bug #64230 (XMLReader does not suppress errors)

Bugs:
https://bugs.php.net/64230

Changed paths:
  MM  ext/xmlreader/php_xmlreader.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': Zend/zend_compile.c Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-10-04 Thread Nikita Popov
Commit:ff46b6f6337a49d7ee07e3bdc2d4f97de4b4bf86
Author:Nikita Popov ni...@php.net Fri, 4 Oct 2013 13:15:45 +0200
Parents:   e13e5b17ffce68c7ea65d3410a6b4fe433135914 
536260f2c52af7057a657af96d991acf27c0cc86
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ff46b6f6337a49d7ee07e3bdc2d4f97de4b4bf86

Log:
Merge branch 'PHP-5.5'

Changed paths:
  MM  Zend/zend_compile.c
  MM  Zend/zend_vm_def.h
  MM  Zend/zend_vm_execute.h


Diff:



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



[PHP-CVS] com php-src: Fix bug #65821: By-ref foreach on property access of string offset segfaults: NEWS Zend/zend_compile.c Zend/zend_vm_def.h Zend/zend_vm_execute.h

2013-10-04 Thread Nikita Popov
Commit:536260f2c52af7057a657af96d991acf27c0cc86
Author:Nikita Popov ni...@php.net Fri, 4 Oct 2013 13:13:46 +0200
Parents:   2e2bda3508444190cb9b707dffe328a263ec60a1
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=536260f2c52af7057a657af96d991acf27c0cc86

Log:
Fix bug #65821: By-ref foreach on property access of string offset segfaults

This removes the now unnecessary ZEND_FETCH_ADD_LOCK on the
container of a property fetch of a by-reference foreach.

Bugs:
https://bugs.php.net/65821

Changed paths:
  M  NEWS
  M  Zend/zend_compile.c
  M  Zend/zend_vm_def.h
  M  Zend/zend_vm_execute.h

diff --git a/NEWS b/NEWS
index 1b1f9c4..796f82f 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP 
   NEWS
 - Core:
   . Fixed bug #64979 (Wrong behavior of static variables in closure 
generators).
 (Nikita)
+  . Fixed bug #65821 (By-ref foreach on property access of string offset
+segfaults). (Nikita)
 
 - CLI server:
   . Fixed bug #65633 (built-in server treat some http headers as
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index f250b2b..9008f23 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1749,7 +1749,6 @@ void zend_do_begin_function_declaration(znode 
*function_token, znode *function_n
zend_op dummy_opline;
 
dummy_opline.result_type = IS_UNUSED;
-   dummy_opline.op1_type = IS_UNUSED;
 
zend_stack_push(CG(foreach_copy_stack), (void *) 
dummy_opline, sizeof(zend_op));
}
@@ -2662,7 +2661,7 @@ static int generate_free_switch_expr(const 
zend_switch_entry *switch_entry TSRML
opline-opcode = (switch_entry-cond.op_type == IS_TMP_VAR) ? ZEND_FREE 
: ZEND_SWITCH_FREE;
SET_NODE(opline-op1, switch_entry-cond);
SET_UNUSED(opline-op2);
-   opline-extended_value = 0;
+
return 0;
 }
 /* }}} */
@@ -2672,7 +2671,7 @@ static int generate_free_foreach_copy(const zend_op 
*foreach_copy TSRMLS_DC) /*
zend_op *opline;
 
/* If we reach the separator then stop applying the stack */
-   if (foreach_copy-result_type == IS_UNUSED  foreach_copy-op1_type == 
IS_UNUSED) {
+   if (foreach_copy-result_type == IS_UNUSED) {
return 1;
}
 
@@ -2681,16 +2680,6 @@ static int generate_free_foreach_copy(const zend_op 
*foreach_copy TSRMLS_DC) /*
opline-opcode = (foreach_copy-result_type == IS_TMP_VAR) ? ZEND_FREE 
: ZEND_SWITCH_FREE;
COPY_NODE(opline-op1, foreach_copy-result);
SET_UNUSED(opline-op2);
-   opline-extended_value = 1;
-
-   if (foreach_copy-op1_type != IS_UNUSED) {
-   opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-
-   opline-opcode = (foreach_copy-op1_type == IS_TMP_VAR) ? 
ZEND_FREE : ZEND_SWITCH_FREE;
-   COPY_NODE(opline-op1, foreach_copy-op1);
-   SET_UNUSED(opline-op2);
-   opline-extended_value = 0;
-   }
 
return 0;
 }
@@ -6227,7 +6216,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode 
*open_brackets_token, zno
 {
zend_op *opline;
zend_bool is_variable;
-   zend_bool push_container = 0;
zend_op dummy_opline;
 
if (variable) {
@@ -6239,14 +6227,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode 
*open_brackets_token, zno
/* save the location of FETCH_W instruction(s) */
open_brackets_token-u.op.opline_num = 
get_next_op_number(CG(active_op_array));
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
-   if (CG(active_op_array)-last  0 
-   
CG(active_op_array)-opcodes[CG(active_op_array)-last-1].opcode == 
ZEND_FETCH_OBJ_W) {
-   /* Only lock the container if we are fetching from a 
real container and not $this */
-   if 
(CG(active_op_array)-opcodes[CG(active_op_array)-last-1].op1_type == IS_VAR) {
-   
CG(active_op_array)-opcodes[CG(active_op_array)-last-1].extended_value |= 
ZEND_FETCH_ADD_LOCK;
-   push_container = 1;
-   }
-   }
} else {
is_variable = 0;
open_brackets_token-u.op.opline_num = 
get_next_op_number(CG(active_op_array));
@@ -6266,11 +6246,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode 
*open_brackets_token, zno
opline-extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
 
COPY_NODE(dummy_opline.result, opline-result);
-   if (push_container) {
-   COPY_NODE(dummy_opline.op1, 
CG(active_op_array)-opcodes[CG(active_op_array)-last-2].op1);
-   } else {
-   dummy_opline.op1_type = IS_UNUSED;
-   }
zend_stack_push(CG(foreach_copy_stack), (void *) dummy_opline, 
sizeof(zend_op));
 
/* save the location of FE_FETCH */
@@ 

[PHP-CVS] com php-src: such a weird hack probably helps in finding regressions in the future: ext/standard/tests/serialize/bug65806.phpt

2013-10-04 Thread Michael Wallner
Commit:e8ae795529eff83482797dff0d1a1de7f0a84c8d
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 16:11:49 +0200
Parents:   f6ff3a28d60c24dea2a05344d9b7eb823f09b4e5
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e8ae795529eff83482797dff0d1a1de7f0a84c8d

Log:
such a weird hack probably helps in finding regressions in the future

Changed paths:
  A  ext/standard/tests/serialize/bug65806.phpt


Diff:
diff --git a/ext/standard/tests/serialize/bug65806.phpt 
b/ext/standard/tests/serialize/bug65806.phpt
new file mode 100644
index 000..19fab95
--- /dev/null
+++ b/ext/standard/tests/serialize/bug65806.phpt
@@ -0,0 +1,83 @@
+--TEST--
+Bug #65806 (unserialize fails with object which is referenced multiple times)
+--FILE--
+?php
+class myObjA {}
+class myObjB {
+public $attrA;
+public $attrB;
+}
+class myObjC {
+public $attrC;
+public $attrD;
+}
+class myList {
+private $_serialized;
+private $_obj;
+
+public function __construct($obj)
+{
+$this-_obj = $obj;
+$this-_serialized = serialize($this-_obj);
+}
+public function get()
+{
+return $this-_obj;
+}
+public function __sleep()
+{
+$this-_serialized = serialize($this-_obj);
+return array(
+\0 . __CLASS__ . \0_serialized,
+);
+}
+public function __wakeup()
+{
+   $this-_obj = unserialize($this-_serialized);
+   }
+}
+
+echo SCRIPT START . PHP_EOL;
+
+$objA = new myObjA();
+$objB = new myObjB();
+$objC = new myObjC();
+
+$objB-attrA = new ArrayIterator();
+$objB-attrB = $objA;
+
+$objC-attrC = $objB;
+$objC-attrD = $objA;
+
+$list = new myList($objC);
+
+echo 'check ' . check($list-get()) . PHP_EOL;
+
+echo start serialize/unserialize . PHP_EOL;
+$newList = unserialize(serialize($list));
+echo finish serialize/unserialize . PHP_EOL;
+
+//after unserialize the property myObjC::attrD is null instead of expected 
object
+echo 'check ' . check($newList-get()) . PHP_EOL;
+
+echo SCRIPT END . PHP_EOL ;
+
+function check(myObjC $obj) {
+
+if (!is_object($obj-attrC)) {
+return 'failed (myObjC::attrC = ' . var_export($obj-attrC, true) . 
')';
+}
+if (!is_object($obj-attrD)) {
+return 'failed (myObjC::attrD = ' . var_export($obj-attrD, true) . 
')';
+}
+return 'successful';
+}
+?
+--EXPECT--
+SCRIPT START
+check successful
+start serialize/unserialize
+finish serialize/unserialize
+check successful
+SCRIPT END
+


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/var.c

2013-10-04 Thread Michael Wallner
Commit:d72a4d1634ff8938cf60c57132d36a79b55bbe4d
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 16:17:37 +0200
Parents:   adfb5ab7ced3b0d4456680edb1766f4ad4f279d6 
8973390541faaadfdfc0f838421f037060188e5e
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d72a4d1634ff8938cf60c57132d36a79b55bbe4d

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix bug #64146 (serialize incorrectly saving objects when they are cloned)

Bugs:
https://bugs.php.net/64146

Changed paths:
  MM  ext/standard/var.c


Diff:



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



[PHP-CVS] com php-src: fix bug #64146 (serialize incorrectly saving objects when they are cloned): ext/standard/tests/serialize/bug64146.phpt ext/standard/var.c

2013-10-04 Thread Michael Wallner
Commit:8973390541faaadfdfc0f838421f037060188e5e
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 16:16:15 +0200
Parents:   e8ae795529eff83482797dff0d1a1de7f0a84c8d
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8973390541faaadfdfc0f838421f037060188e5e

Log:
fix bug #64146 (serialize incorrectly saving objects when they are
cloned)

Bugs:
https://bugs.php.net/64146

Changed paths:
  A  ext/standard/tests/serialize/bug64146.phpt
  M  ext/standard/var.c


Diff:
diff --git a/ext/standard/tests/serialize/bug64146.phpt 
b/ext/standard/tests/serialize/bug64146.phpt
new file mode 100644
index 000..18ae78d
--- /dev/null
+++ b/ext/standard/tests/serialize/bug64146.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Bug #64146 (serialize incorrectly saving objects when they are cloned)
+--FILE--
+?php
+
+echo Test\n;
+
+class A
+{
+public $a = array();
+
+public function __construct()
+{
+$this-a[] = new B(1);
+$this-a[] = new B(2);
+}
+}
+
+class B implements Serializable
+{
+public $b;
+
+public function __construct($c)
+{
+$this-b = new C($c);
+}
+
+public function serialize()
+{
+return serialize(clone $this-b);
+}
+
+public function unserialize($data)
+{
+$this-b = unserialize($data);
+}
+}
+
+class C
+{
+public $c;
+
+public function __construct($c)
+{
+$this-c = $c;
+}
+}
+
+$a = unserialize(serialize(new A()));
+
+print $a-a[0]-b-c . \n;
+print $a-a[1]-b-c . \n;
+
+?
+Done
+--EXPECT--
+Test
+1
+2
+Done
diff --git a/ext/standard/var.c b/ext/standard/var.c
index f76a14c..f71c4a4 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -549,11 +549,9 @@ static inline int php_add_var_hash(HashTable *var_hash, 
zval *var, void *var_old
char id[32], *p;
register int len;
 
-   /* relies on (long) being a perfect hash function for data pointers,
-* however the actual identity of an object has had to be determined
-* by its object handle since 5.0. */
if ((Z_TYPE_P(var) == IS_OBJECT)  Z_OBJ_HT_P(var)-get_class_entry) {
-   p = smart_str_print_long(id + sizeof(id) - 1, (long) 
Z_OBJ_HANDLE_P(var));
+   p = smart_str_print_long(id + sizeof(id) - 1,
+   (long) zend_objects_get_address(var TSRMLS_CC));
*(--p) = 'O';
len = id + sizeof(id) - 1 - p;
} else {


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/standard/var.c

2013-10-04 Thread Michael Wallner
Commit:f72ed22749178b9d17455a308cefc523fd85109e
Author:Michael Wallner m...@php.net Fri, 4 Oct 2013 16:17:46 +0200
Parents:   39022ba227af59a7ab040d7b8fa3510747920733 
d72a4d1634ff8938cf60c57132d36a79b55bbe4d
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f72ed22749178b9d17455a308cefc523fd85109e

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  fix bug #64146 (serialize incorrectly saving objects when they are cloned)

Bugs:
https://bugs.php.net/64146

Changed paths:
  MM  ext/standard/var.c


Diff:



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



[PHP-CVS] com php-src: Fix bug #65667: ftp_nb_continue produces segfault: NEWS ext/ftp/php_ftp.c ext/ftp/tests/ftp_nb_continue.phpt ext/ftp/tests/server.inc

2013-10-04 Thread Nikita Popov
Commit:96cc419924c38874f9e2f2e5ccf3cd0430d90f43
Author:Philip Hofstetter phofstet...@sensational.ch Wed, 2 Oct 
2013 08:35:02 +0200
Committer: Nikita Popov ni...@php.net  Fri, 4 Oct 2013 17:25:46 +0200
Parents:   8973390541faaadfdfc0f838421f037060188e5e
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=96cc419924c38874f9e2f2e5ccf3cd0430d90f43

Log:
Fix bug #65667: ftp_nb_continue produces segfault

the idea behind ftp_nb_get is for it to be followed by multiple calls
to ftp_nb_continue in order to download a file piece-by-piece.

As such, it's unwise to close the stream used to write the downloaded
data to when the file hasn't been completely downloaded within the first
call to ftp_nb_get.

This regression was added in a93a462dcefd62e07963dd2da506fbb3409c88b5
and this patch restores the behavior that was seen pre-patch.

Bugs:
https://bugs.php.net/65667

Changed paths:
  M  NEWS
  M  ext/ftp/php_ftp.c
  A  ext/ftp/tests/ftp_nb_continue.phpt
  M  ext/ftp/tests/server.inc


Diff:
diff --git a/NEWS b/NEWS
index 9963714..7a7ceca 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP 
   NEWS
 |||
 ?? ??? 2013, PHP 5.4.22
 
+- FTP:
+  . Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
+
 - Sockets:
   . Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
 (Mike)
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index da22e0b..21e13ea 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -968,7 +968,9 @@ PHP_FUNCTION(ftp_nb_get)
RETURN_LONG(PHP_FTP_FAILED);
}
 
-php_stream_close(outstream);
+   if (ret == PHP_FTP_FINISHED){
+   php_stream_close(outstream);
+   }
 
RETURN_LONG(ret);
 }
diff --git a/ext/ftp/tests/ftp_nb_continue.phpt 
b/ext/ftp/tests/ftp_nb_continue.phpt
new file mode 100644
index 000..1f70339
--- /dev/null
+++ b/ext/ftp/tests/ftp_nb_continue.phpt
@@ -0,0 +1,182 @@
+--TEST--
+Testing whether ftp_nb_continue() fetches more data
+--SKIPIF--
+?php
+require 'skipif.inc';
+?
+--FILE--
+?php
+require 'server.inc';
+
+$file = mediumfile.txt;
+
+$ftp = ftp_connect('127.0.0.1', $port);
+ftp_login($ftp, 'user', 'pass');
+if (!$ftp) die(Couldn't connect to the server);
+
+$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . $file;
+touch($local_file);
+
+$r = ftp_nb_get($ftp, $local_file, $file, FTP_BINARY);
+while ($r == FTP_MOREDATA) {
+$r = ftp_nb_continue($ftp);
+}
+ftp_close($ftp);
+
+echo file_get_contents($local_file);
+?
+--CLEAN--
+?php
+@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . mediumfile.txt);
+?
+--EXPECT--
+This is line 0 of the test data.
+This is line 1 of the test data.
+This is line 2 of the test data.
+This is line 3 of the test data.
+This is line 4 of the test data.
+This is line 5 of the test data.
+This is line 6 of the test data.
+This is line 7 of the test data.
+This is line 8 of the test data.
+This is line 9 of the test data.
+This is line 10 of the test data.
+This is line 11 of the test data.
+This is line 12 of the test data.
+This is line 13 of the test data.
+This is line 14 of the test data.
+This is line 15 of the test data.
+This is line 16 of the test data.
+This is line 17 of the test data.
+This is line 18 of the test data.
+This is line 19 of the test data.
+This is line 20 of the test data.
+This is line 21 of the test data.
+This is line 22 of the test data.
+This is line 23 of the test data.
+This is line 24 of the test data.
+This is line 25 of the test data.
+This is line 26 of the test data.
+This is line 27 of the test data.
+This is line 28 of the test data.
+This is line 29 of the test data.
+This is line 30 of the test data.
+This is line 31 of the test data.
+This is line 32 of the test data.
+This is line 33 of the test data.
+This is line 34 of the test data.
+This is line 35 of the test data.
+This is line 36 of the test data.
+This is line 37 of the test data.
+This is line 38 of the test data.
+This is line 39 of the test data.
+This is line 40 of the test data.
+This is line 41 of the test data.
+This is line 42 of the test data.
+This is line 43 of the test data.
+This is line 44 of the test data.
+This is line 45 of the test data.
+This is line 46 of the test data.
+This is line 47 of the test data.
+This is line 48 of the test data.
+This is line 49 of the test data.
+This is line 50 of the test data.
+This is line 51 of the test data.
+This is line 52 of the test data.
+This is line 53 of the test data.
+This is line 54 of the test data.
+This is line 55 of the test data.
+This is line 56 of the test data.
+This is line 57 of the test data.
+This is line 58 of the test data.
+This is line 59 of the test data.
+This is line 60 of the test data.
+This is line 61 of the test data.
+This is line 62 of the test data.
+This 

[PHP-CVS] com php-src: Allow the ldap extension to be compiled with Oracle's LDAP implementation, if desired. Note the implementations differ so you will see different ldap behavior.: ext/ldap/config

2013-10-04 Thread Christopher Jones
Commit:5bc377457e155ceaddd27a536467a4d353fdcd4f
Author:Christopher Jones s...@php.net Fri, 4 Oct 2013 15:50:16 
-0700
Parents:   fb6f5d2e2d44e205cdde7320a7674e43fdd7980b
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5bc377457e155ceaddd27a536467a4d353fdcd4f

Log:
Allow the ldap extension to be compiled with Oracle's LDAP
implementation, if desired.  Note the implementations differ so you
will see different ldap behavior.

The patch allows configuration similar to:
--with-ldap=$HOME/instantclient --with-oci8=instantclient,$HOME/instantclient

The patch doesn't support configuration similar to:
--with-ldap --with-oci8=instantclient,$HOME/instantclient
since this would try and mix the default LDAP and Oracle LDAP
implementations.

This patch closes out bug #61450 and the associated github PR.

Regardless of this patch, my recommended way to install both OCI8 and
ldap extensions is to statically configure PHP with ldap, and then add
OCI8 as a shared extension from PECL.

Bugs:
https://bugs.php.net/61450

Changed paths:
  M  ext/ldap/config.m4
  M  ext/ldap/ldap.c

diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4
index 3c8e23e..2804cd5 100644
--- a/ext/ldap/config.m4
+++ b/ext/ldap/config.m4
@@ -15,6 +15,28 @@ AC_DEFUN([PHP_LDAP_CHECKS], [
 LDAP_DIR=$1
 LDAP_INCDIR=$1/ldap/public
 LDAP_LIBDIR=$1/$PHP_LIBDIR
+  else
+
+dnl Find Oracle Instant Client RPM header location corresponding to the 
given lib path e.g. for --with-ldap=/usr/lib/oracle/12.1/client64/lib
+AC_CHECK_SIZEOF(long int, 4)
+if test $ac_cv_sizeof_long_int = 4; then
+  PHP_OCI8_IC_LIBDIR_SUFFIX=
+else
+  PHP_OCI8_IC_LIBDIR_SUFFIX=64
+fi
+OCISDKRPMINC=`echo $1 | $SED -e 
's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib[/]*$!/usr/include/oracle/\1/client\2!'`
+
+dnl Check for Oracle Instant Client RPM install
+if test -f $OCISDKRPMINC/ldap.h; then
+  LDAP_DIR=$1
+  LDAP_INCDIR=$OCISDKRPMINC
+  LDAP_LIBDIR=$1
+dnl Check for Oracle Instant Client ZIP install
+elif test -f $1/sdk/include/ldap.h; then
+  LDAP_DIR=$1
+  LDAP_INCDIR=$1/sdk/include
+  LDAP_LIBDIR=$1
+fi
   fi
 ])
 
@@ -143,12 +165,21 @@ if test $PHP_LDAP != no; then
 PHP_ADD_LIBRARY_WITH_PATH(umich_lber, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
 PHP_ADD_LIBRARY_WITH_PATH(umich_ldap, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
 
-  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
+  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.12.1; then
 PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
 AC_DEFINE(HAVE_ORALDAP,1,[ ])
-if test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
-  AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
-fi
+AC_DEFINE(HAVE_ORALDAP_12,1,[ ])
+
+  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
+PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+AC_DEFINE(HAVE_ORALDAP,1,[ ])
+AC_DEFINE(HAVE_ORALDAP_11,1,[ ])
+
+  elif test -f $LDAP_LIBDIR/libclntsh.$SHLIB_SUFFIX_NAME; then
+ PHP_ADD_LIBRARY_WITH_PATH(clntsh, $LDAP_LIBDIR, LDAP_SHARED_LIBADD)
+ AC_DEFINE(HAVE_ORALDAP,1,[ ])
+ AC_DEFINE(HAVE_ORALDAP_10,1,[ ])
+
   else
 AC_MSG_ERROR(Cannot find ldap libraries in $LDAP_LIBDIR.)
   fi
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 71d57d6..e95f898 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -152,7 +152,7 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_LONG_CONSTANT(LDAP_DEREF_FINDING, LDAP_DEREF_FINDING, 
CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT(LDAP_DEREF_ALWAYS, LDAP_DEREF_ALWAYS, 
CONST_PERSISTENT | CONST_CS);
 
-#if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP_10
+#if (LDAP_API_VERSION  2000) || HAVE_NSLDAP || HAVE_ORALDAP
/* LDAP options */
REGISTER_LONG_CONSTANT(LDAP_OPT_DEREF, LDAP_OPT_DEREF, 
CONST_PERSISTENT | CONST_CS);
REGISTER_LONG_CONSTANT(LDAP_OPT_SIZELIMIT, LDAP_OPT_SIZELIMIT, 
CONST_PERSISTENT | CONST_CS);
@@ -361,7 +361,7 @@ PHP_FUNCTION(ldap_connect)
 static int _get_lderrno(LDAP *ldap)
 {
 #if !HAVE_NSLDAP
-#if LDAP_API_VERSION  2000 || HAVE_ORALDAP_10
+#if LDAP_API_VERSION  2000 || HAVE_ORALDAP
int lderr;
 
/* New versions of OpenLDAP do it this way */
@@ -550,7 +550,7 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int 
timelimit, int deref, in
 {
/* sizelimit */
if (sizelimit  -1) {
-#if (LDAP_API_VERSION = 2004) || HAVE_NSLDAP || HAVE_ORALDAP_10
+#if (LDAP_API_VERSION = 2004) || HAVE_NSLDAP || HAVE_ORALDAP
ldap_get_option(ldap, LDAP_OPT_SIZELIMIT, old_sizelimit);
ldap_set_option(ldap, LDAP_OPT_SIZELIMIT, sizelimit);
 #else
@@ -561,7 +561,7 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int 
timelimit, int deref, in
 
/* timelimit */
if (timelimit  -1) {
-#if (LDAP_API_VERSION = 2004) || HAVE_NSLDAP || 

[PHP-CVS] com php-src: Fix Bug #60633 build warning in bcmath: ext/bcmath/libbcmath/src/recmul.c

2013-10-03 Thread Remi Collet
Commit:60d9175280cbab5967966e38f42fced854d10408
Author:Remi Collet r...@php.net Thu, 3 Oct 2013 08:45:31 +0200
Parents:   2ba39268151549f03140ec3d260cf9489336ec93
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=60d9175280cbab5967966e38f42fced854d10408

Log:
Fix Bug #60633 build warning in bcmath

Bugs:
https://bugs.php.net/60633

Changed paths:
  M  ext/bcmath/libbcmath/src/recmul.c


Diff:
diff --git a/ext/bcmath/libbcmath/src/recmul.c 
b/ext/bcmath/libbcmath/src/recmul.c
index c31d09d..64014f3 100644
--- a/ext/bcmath/libbcmath/src/recmul.c
+++ b/ext/bcmath/libbcmath/src/recmul.c
@@ -183,7 +183,6 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num 
*prod,
 int full_scale TSRMLS_DC)
 { 
   bc_num u0, u1, v0, v1;
-  int u0len, v0len;
   bc_num m1, m2, m3, d1, d2;
   int n, prodlen, m1zero;
   int d1len, d2len;
@@ -216,10 +215,8 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, 
bc_num *prod,
 }
   _bc_rm_leading_zeros (u1);
   _bc_rm_leading_zeros (u0);
-  u0len = u0-n_len;
   _bc_rm_leading_zeros (v1);
   _bc_rm_leading_zeros (v0);
-  v0len = v0-n_len;
 
   m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC);


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



[PHP-CVS] com php-src: fix bug #59613 (Crash with clone XMLReader): NEWS ext/xmlreader/php_xmlreader.c ext/xmlreader/tests/bug51963.phpt

2013-10-03 Thread Michael Wallner
Commit:fc3f8a8f54d8b3c864125bf32028d4550882839c
Author:Michael Wallner m...@php.net Thu, 3 Oct 2013 13:28:41 +0200
Parents:   9209c19f8f7eef807cb457b32d3ab517ff8dc178
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=fc3f8a8f54d8b3c864125bf32028d4550882839c

Log:
fix bug #59613 (Crash with clone XMLReader)

Bugs:
https://bugs.php.net/59613

Changed paths:
  M  NEWS
  M  ext/xmlreader/php_xmlreader.c
  A  ext/xmlreader/tests/bug51963.phpt


Diff:
diff --git a/NEWS b/NEWS
index c2086c07..c6961bd 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ PHP
NEWS
   . Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
 (Mike)
 
+- XMLReader:
+  . Fixed bug #59613 (Crash with clone XMLReader). (Mike)
+
+
 ?? ??? 2013, PHP 5.4.21
 
 - Core:
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index f4c2643..8b80320 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -1320,6 +1320,7 @@ PHP_MINIT_FUNCTION(xmlreader)
xmlreader_object_handlers.read_property = xmlreader_read_property;
xmlreader_object_handlers.write_property = xmlreader_write_property;
xmlreader_object_handlers.get_property_ptr_ptr = 
xmlreader_get_property_ptr_ptr;
+   xmlreader_object_handlers.clone_obj = NULL;
 
INIT_CLASS_ENTRY(ce, XMLReader, xmlreader_functions);
ce.create_object = xmlreader_objects_new;
diff --git a/ext/xmlreader/tests/bug51963.phpt 
b/ext/xmlreader/tests/bug51963.phpt
new file mode 100644
index 000..af47f97
--- /dev/null
+++ b/ext/xmlreader/tests/bug51963.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #59613 (Crash with clone XMLReader)
+--SKIPIF--
+?php
+extension_loaded(xmlreader) or die(skip requires xmlreader);
+?
+--FILE--
+?php
+echo Test\n;
+
+$xmlreader = new XMLReader();
+$xmlreader-xml(ab//a);
+
+$xmlreader-next();
+$xmlreader2 = clone $xmlreader;
+$xmlreader2-next();
+?
+Done
+--EXPECTF--
+Test
+
+Fatal error: Trying to clone an uncloneable object of class XMLReader in %s on 
line %d


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/xmlreader/php_xmlreader.c

2013-10-03 Thread Michael Wallner
Commit:86f2b336294b2ceaac76b9d0f5ed4eaf05e73156
Author:Michael Wallner m...@php.net Thu, 3 Oct 2013 13:29:18 +0200
Parents:   60d9175280cbab5967966e38f42fced854d10408 
fc3f8a8f54d8b3c864125bf32028d4550882839c
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=86f2b336294b2ceaac76b9d0f5ed4eaf05e73156

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix bug #59613 (Crash with clone XMLReader)

Bugs:
https://bugs.php.net/59613

Changed paths:
  MM  ext/xmlreader/php_xmlreader.c


Diff:



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



[PHP-CVS] com php-src: typo: really fix bug #51936 Crash with clone xmlreader: NEWS ext/xmlreader/tests/bug51936.phpt ext/xmlreader/tests/bug51963.phpt

2013-10-03 Thread Michael Wallner
Commit:dc3d360a0ff8c17cb2ce2030813d30b578249be9
Author:Michael Wallner m...@php.net Thu, 3 Oct 2013 13:34:31 +0200
Parents:   fc3f8a8f54d8b3c864125bf32028d4550882839c
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=dc3d360a0ff8c17cb2ce2030813d30b578249be9

Log:
typo: really fix bug #51936 Crash with clone xmlreader

Bugs:
https://bugs.php.net/51936

Changed paths:
  M  NEWS
  A  ext/xmlreader/tests/bug51936.phpt
  D  ext/xmlreader/tests/bug51963.phpt


Diff:
diff --git a/NEWS b/NEWS
index c6961bd..ffde301 100644
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,7 @@ PHP 
   NEWS
 (Mike)
 
 - XMLReader:
-  . Fixed bug #59613 (Crash with clone XMLReader). (Mike)
+  . Fixed bug #51936 (Crash with clone XMLReader). (Mike)
 
 
 ?? ??? 2013, PHP 5.4.21
diff --git a/ext/xmlreader/tests/bug51936.phpt 
b/ext/xmlreader/tests/bug51936.phpt
new file mode 100644
index 000..4b5f101
--- /dev/null
+++ b/ext/xmlreader/tests/bug51936.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #51936 (Crash with clone XMLReader)
+--SKIPIF--
+?php
+extension_loaded(xmlreader) or die(skip requires xmlreader);
+?
+--FILE--
+?php
+echo Test\n;
+
+$xmlreader = new XMLReader();
+$xmlreader-xml(ab//a);
+
+$xmlreader-next();
+$xmlreader2 = clone $xmlreader;
+$xmlreader2-next();
+?
+Done
+--EXPECTF--
+Test
+
+Fatal error: Trying to clone an uncloneable object of class XMLReader in %s on 
line %d
diff --git a/ext/xmlreader/tests/bug51963.phpt 
b/ext/xmlreader/tests/bug51963.phpt
deleted file mode 100644
index af47f97..000
--- a/ext/xmlreader/tests/bug51963.phpt
+++ /dev/null
@@ -1,22 +0,0 @@
---TEST--
-Bug #59613 (Crash with clone XMLReader)
---SKIPIF--
-?php
-extension_loaded(xmlreader) or die(skip requires xmlreader);
-?
---FILE--
-?php
-echo Test\n;
-
-$xmlreader = new XMLReader();
-$xmlreader-xml(ab//a);
-
-$xmlreader-next();
-$xmlreader2 = clone $xmlreader;
-$xmlreader2-next();
-?
-Done
---EXPECTF--
-Test
-
-Fatal error: Trying to clone an uncloneable object of class XMLReader in %s on 
line %d


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



[PHP-CVS] com php-src: fix bug #55285 XMLReader::getAttribute/No/Ns methods inconsistency: NEWS UPGRADING ext/xmlreader/php_xmlreader.c

2013-10-03 Thread Michael Wallner
Commit:c7b1d76eb9d09b0331272143e44e5024468b0fea
Author:Michael Wallner m...@php.net Thu, 3 Oct 2013 15:23:05 +0200
Parents:   2a1bd123d6397781082e00ccdfe2ff3ebd0d57fe
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c7b1d76eb9d09b0331272143e44e5024468b0fea

Log:
fix bug #55285 XMLReader::getAttribute/No/Ns methods inconsistency

Bugs:
https://bugs.php.net/55285

Changed paths:
  M  NEWS
  M  UPGRADING
  M  ext/xmlreader/php_xmlreader.c


Diff:
diff --git a/NEWS b/NEWS
index 95acaa6..e1a191f 100644
--- a/NEWS
+++ b/NEWS
@@ -55,4 +55,8 @@ PHP   
 NEWS
   . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
 1.1). (Adam)
 
+- XMLReader:
+  . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). 
+(Mike)
+
  NOTE: Insert NEWS from last stable release here prior to actual release! 

diff --git a/UPGRADING b/UPGRADING
index 87b9eef..f413887 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -61,6 +61,10 @@ PHP X.Y UPGRADE NOTES
   CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file 
   do not work unless it is explicitly set to false.
 
+- XMLReader:
+  XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
+  the attribute could not be found, just like XMLReader::getAttribute.
+
 
 5. New Functions
 
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 464998c..6ef25a2 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -588,9 +588,6 @@ PHP_METHOD(xmlreader, getAttributeNo)
if (retchar) {
RETVAL_STRING(retchar, 1);
xmlFree(retchar);
-   return;
-   } else {
-   RETURN_EMPTY_STRING();
}
 }
 /* }}} */
@@ -622,9 +619,6 @@ PHP_METHOD(xmlreader, getAttributeNs)
if (retchar) {
RETVAL_STRING(retchar, 1);
xmlFree(retchar);
-   return;
-   } else {
-   RETURN_EMPTY_STRING();
}
 }
 /* }}} */


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



[PHP-CVS] com php-src: fix indention: ext/hash/hash_gost.c

2013-10-03 Thread Michael Wallner
Commit:0be6ecb8621e32f6bb039dd178f4db17220de6e9
Author:Manuel Mausz man...@mausz.at Thu, 5 Sep 2013 01:19:00 +0200
Parents:   8ca43527e8b7e076779560f1472518bd1fe4d6ca
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0be6ecb8621e32f6bb039dd178f4db17220de6e9

Log:
fix indention

Changed paths:
  M  ext/hash/hash_gost.c


Diff:
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index 7546c8d..da65bb5 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -243,13 +243,13 @@ static inline void GostTransform(PHP_GOST_CTX *context, 
const unsigned char inpu
 PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *context)
 {
memset(context, 0, sizeof(*context));
-context-tables = tables_test;
+   context-tables = tables_test;
 }
 
 PHP_HASH_API void PHP_GOSTInitCrypto(PHP_GOST_CTX *context)
 {
-PHP_GOSTInit(context);
-context-tables = tables_crypto;
+   PHP_GOSTInit(context);
+   context-tables = tables_crypto;
 }
 
 static const php_hash_uint32 MAX32 = 0xLU;


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



[PHP-CVS] com php-src: fix failing tests: ext/hash/tests/hash_algos.phpt ext/hash/tests/hash_copy_001.phpt

2013-10-03 Thread Michael Wallner
Commit:7dbb1bba64c8a90df683e1a69df03cb2931f547a
Author:Manuel Mausz man...@mausz.at Thu, 5 Sep 2013 09:32:12 +0200
Parents:   0be6ecb8621e32f6bb039dd178f4db17220de6e9
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7dbb1bba64c8a90df683e1a69df03cb2931f547a

Log:
fix failing tests

Changed paths:
  M  ext/hash/tests/hash_algos.phpt
  M  ext/hash/tests/hash_copy_001.phpt


Diff:
diff --git a/ext/hash/tests/hash_algos.phpt b/ext/hash/tests/hash_algos.phpt
index 55796ec..7773fe9 100644
--- a/ext/hash/tests/hash_algos.phpt
+++ b/ext/hash/tests/hash_algos.phpt
@@ -18,7 +18,7 @@ var_dump(hash_algos());
 ===Done===
 --EXPECTF--
 *** Testing hash_algos() : basic functionality ***
-array(43) {
+array(44) {
   [%d]=
   string(3) md2
   [%d]=
@@ -64,6 +64,8 @@ array(43) {
   [%d]=
   string(4) gost
   [%d]=
+  string(11) gost-crypto
+  [%d]=
   string(7) adler32
   [%d]=
   string(5) crc32
@@ -106,4 +108,4 @@ array(43) {
   [%d]=
   string(10) haval256,5
 }
-===Done===
\ No newline at end of file
+===Done===
diff --git a/ext/hash/tests/hash_copy_001.phpt 
b/ext/hash/tests/hash_copy_001.phpt
index 638b7f5..bb4a49d 100644
--- a/ext/hash/tests/hash_copy_001.phpt
+++ b/ext/hash/tests/hash_copy_001.phpt
@@ -97,6 +97,9 @@ string(64) 
fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26
 string(4) gost
 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5
 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5
+string(11) gost-crypto
+string(64) f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043
+string(64) f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043
 string(7) adler32
 string(8) 6f7c0928
 string(8) 6f7c0928
@@ -226,6 +229,9 @@ string(64) 
614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0
 string(4) gost
 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5
 string(64) a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b
+string(11) gost-crypto
+string(64) f7c4e35548d66aabe2b106f20515d289fde90969225d3d7b83f6dd12d694f043
+string(64) 68ca9aea6729dc07d995fbe071a4b5c6490bb27fc4dc65ec0e96200d5e082996
 string(7) adler32
 string(8) 6f7c0928
 string(8) d9141747


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



[PHP-CVS] com php-src: add NEWS and UPGRADING about gost-crypto: NEWS UPGRADING

2013-10-03 Thread Michael Wallner
Commit:099b295646b108ad56d1ec3b37dfcb5812fd378c
Author:Michael Wallner m...@php.net Thu, 3 Oct 2013 16:23:59 +0200
Parents:   05f847da453fd14440df908d7bfca877142ed8fa
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=099b295646b108ad56d1ec3b37dfcb5812fd378c

Log:
add NEWS and UPGRADING about gost-crypto

Changed paths:
  M  NEWS
  M  UPGRADING


Diff:
diff --git a/NEWS b/NEWS
index e1a191f..8113514 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ PHP   
 NEWS
 improvements based on this.
 (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
 
+- Hash:
+  . Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz)
+
 - mysqlnd:
   . Disabled flag for SP OUT variables for 5.5+ servers as they are not 
natively
 supported by the overlying APIs. (Andrey)
diff --git a/UPGRADING b/UPGRADING
index f413887..fb8daab 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -40,6 +40,8 @@ PHP X.Y UPGRADE NOTES
 - The php://input stream is now re-usable and can be used concurrently with 
   enable_post_data_reading=0.
 
+- Added gost-crypto (CryptoPro S-box) hash algo.
+
 
 2. Changes in SAPI modules
 


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



[PHP-CVS] com php-src: Add support for CryptoPro S-box for GOST: ext/hash/hash.c ext/hash/hash_gost.c ext/hash/php_hash.h ext/hash/php_hash_gost.h ext/hash/php_hash_gost_tables.h ext/hash/tests/gost.p

2013-10-03 Thread Michael Wallner
Commit:8ca43527e8b7e076779560f1472518bd1fe4d6ca
Author:Manuel Mausz man...@mausz.at Thu, 5 Sep 2013 01:04:25 +0200
Parents:   6ece5503942a1d8c4a78504161f9466e9e14fed2
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8ca43527e8b7e076779560f1472518bd1fe4d6ca

Log:
Add support for CryptoPro S-box for GOST

This adds a new hash identifier gost-crypto which uses the CryptoPro
S-box tables as specified by RFC 4357, section 11.2.

Changed paths:
  M  ext/hash/hash.c
  M  ext/hash/hash_gost.c
  M  ext/hash/php_hash.h
  M  ext/hash/php_hash_gost.h
  M  ext/hash/php_hash_gost_tables.h
  M  ext/hash/tests/gost.phpt

diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 1172214..87f19c5 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -986,6 +986,7 @@ PHP_MINIT_FUNCTION(hash)
php_hash_register_algo(snefru,php_hash_snefru_ops);
php_hash_register_algo(snefru256, php_hash_snefru_ops);
php_hash_register_algo(gost,  php_hash_gost_ops);
+   php_hash_register_algo(gost-crypto,   
php_hash_gost_crypto_ops);
php_hash_register_algo(adler32,   php_hash_adler32_ops);
php_hash_register_algo(crc32, php_hash_crc32_ops);
php_hash_register_algo(crc32b,php_hash_crc32b_ops);
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index 3961c4f..7546c8d 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -27,7 +27,7 @@
  * derived from gost_compress() by Markku-Juhani Saarinen m...@ssh.fi
  */
 
-#define round(k1, k2) \
+#define round(tables, k1, k2) \
t = (k1) + r; \
l ^= tables[0][t  0xff] ^ tables[1][(t  8)  0xff] ^ \
tables[2][(t  16)  0xff] ^ tables[3][t  24]; \
@@ -35,25 +35,25 @@
r ^= tables[0][t  0xff] ^ tables[1][(t  8)  0xff] ^ \
tables[2][(t  16)  0xff] ^ tables[3][t  24];
 
-#define R(key, h, i, t, l, r) \
+#define R(tables, key, h, i, t, l, r) \
r = h[i]; \
l = h[i + 1]; \
-   round(key[0], key[1]) \
-   round(key[2], key[3]) \
-   round(key[4], key[5]) \
-   round(key[6], key[7]) \
-   round(key[0], key[1]) \
-   round(key[2], key[3]) \
-   round(key[4], key[5]) \
-   round(key[6], key[7]) \
-   round(key[0], key[1]) \
-   round(key[2], key[3]) \
-   round(key[4], key[5]) \
-   round(key[6], key[7]) \
-   round(key[7], key[6]) \
-   round(key[5], key[4]) \
-   round(key[3], key[2]) \
-   round(key[1], key[0]) \
+   round(tables, key[0], key[1]) \
+   round(tables, key[2], key[3]) \
+   round(tables, key[4], key[5]) \
+   round(tables, key[6], key[7]) \
+   round(tables, key[0], key[1]) \
+   round(tables, key[2], key[3]) \
+   round(tables, key[4], key[5]) \
+   round(tables, key[6], key[7]) \
+   round(tables, key[0], key[1]) \
+   round(tables, key[2], key[3]) \
+   round(tables, key[4], key[5]) \
+   round(tables, key[6], key[7]) \
+   round(tables, key[7], key[6]) \
+   round(tables, key[5], key[4]) \
+   round(tables, key[3], key[2]) \
+   round(tables, key[1], key[0]) \
t = r; \
r = l; \
l = t; \
@@ -194,10 +194,10 @@
(v[3]  16) ^ v[3] ^ (v[4]  16) ^ v[4] ^ (v[5]  16) ^ v[5] 
^ \
(v[6]  16) ^ (v[6]  16) ^ (v[7]  16) ^ v[7];
 
-#define PASS \
+#define PASS(tables) \
X(w, u, v); \
P(key, w); \
-   R(key, h, i, t, l, r); \
+   R((tables), key, h, i, t, l, r); \
S(s, l, r); \
if (i != 6) { \
A(u, l, r); \
@@ -207,16 +207,16 @@
AA(v, l, r); \
}
 
-static inline void Gost(php_hash_uint32 state[8], php_hash_uint32 data[8])
+static inline void Gost(PHP_GOST_CTX *context, php_hash_uint32 data[8])
 {
int i;
-   php_hash_uint32 l, r, t, key[8], u[8], v[8], w[8], s[8], *h = state, *m 
= data;
+   php_hash_uint32 l, r, t, key[8], u[8], v[8], w[8], s[8], *h = 
context-state, *m = data;

-   memcpy(u, state, sizeof(u));
+   memcpy(u, context-state, sizeof(u));
memcpy(v, data, sizeof(v));

for (i = 0; i  8; i += 2) {
-   PASS;
+   PASS(*context-tables);
}
SHIFT12(u, m, s);
SHIFT16(h, v, u);
@@ -237,12 +237,19 @@ static inline void GostTransform(PHP_GOST_CTX *context, 
const unsigned char inpu
temp = ((context-state[i + 8]  data[i]) || (context-state[i 
+ 8]  save)) ? 1 : 0; 
}

-   Gost(context-state, data);
+   Gost(context, data);
 }
 
 PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *context)
 {
memset(context, 0, sizeof(*context));
+context-tables = tables_test;
+}
+
+PHP_HASH_API void PHP_GOSTInitCrypto(PHP_GOST_CTX *context)
+{
+PHP_GOSTInit(context);
+context-tables = tables_crypto;
 }
 
 static const php_hash_uint32 MAX32 = 

[PHP-CVS] svn: /SVNROOT/ global_avail

2013-10-02 Thread Pierre Joye
pajoye   Wed, 02 Oct 2013 06:16:13 +

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

Log:
- anaotol access

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2013-10-02 00:55:37 UTC (rev 331641)
+++ SVNROOT/global_avail2013-10-02 06:16:13 UTC (rev 331642)
@@ -109,7 +109,7 @@
 avail|grossolini|web/wiki.git

 # access to the pecl website etc
-avail|dufuz,pajoye,wez,pollita,tal,mj,helly,john,iliaa,edink,jan,derick,jon,cellog,philip,jani,johannes,sfox,gloob,till,tyrael,jedibc|web/pecl.git,pecl
+avail|dufuz,pajoye,wez,pollita,tal,mj,helly,john,iliaa,edink,jan,derick,jon,cellog,philip,jani,johannes,sfox,gloob,till,tyrael,jedibc,ab|web/pecl.git,pecl

 # access to the newly cut pecl4win website
 avail|edink,derick|web/pecl4win
@@ -413,7 +413,7 @@
 # php-internals-win karma
 avail|szarkos,pajoye,rrichards,auroraeosrose|php/php-internals-win
 
avail|pajoye,guilhermeblanco,auroraeosrose,rrichards,kalle,sascham78,szarkos|web/windows.git
-avail|szarkos|web/rmtools.git
+avail|szarkos,ab|web/rmtools.git

 # php-benchmarks karma
 avail|nlopess,pbiggar,olafurw,hjalle|php/php-benchmarks

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

[PHP-CVS] com php-src: fix bug #65808 the socket_connect() won't work with IPv6 address: NEWS ext/sockets/sockets.c

2013-10-02 Thread Michael Wallner
Commit:9209c19f8f7eef807cb457b32d3ab517ff8dc178
Author:Michael Wallner m...@php.net Wed, 2 Oct 2013 15:19:25 +0200
Parents:   b2f8f35a889e77c3123ade348907e73bf6d6689e
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9209c19f8f7eef807cb457b32d3ab517ff8dc178

Log:
fix bug #65808  the socket_connect() won't work with IPv6 address

Bugs:
https://bugs.php.net/65808

Changed paths:
  M  NEWS
  M  ext/sockets/sockets.c


Diff:
diff --git a/NEWS b/NEWS
index 9bef174..c2086c07 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP
NEWS
 |||
 ?? ??? 2013, PHP 5.4.22
 
+- Sockets:
+  . Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
+(Mike)
+
 ?? ??? 2013, PHP 5.4.21
 
 - Core:
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index d0d0294..d094b3c 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -607,6 +607,8 @@ static char *php_strerror(int error TSRMLS_DC) /* {{{ */
 /* }}} */
 
 #if HAVE_IPV6
+static int php_get_if_index_from_string(const char *val, unsigned *out 
TSRMLS_DC);
+
 /* Sets addr by hostname, or by ip in string form (AF_INET6) */
 static int php_set_inet6_addr(struct sockaddr_in6 *sin6, char *string, 
php_socket *php_sock TSRMLS_DC) /* {{{ */
 {
@@ -615,6 +617,7 @@ static int php_set_inet6_addr(struct sockaddr_in6 *sin6, 
char *string, php_socke
struct addrinfo hints;
struct addrinfo *addrinfo = NULL;
 #endif
+   char *scope = strchr(string, '%');
 
if (inet_pton(AF_INET6, string, tmp)) {
memcpy((sin6-sin6_addr.s6_addr), (tmp.s6_addr), 
sizeof(struct in6_addr));
@@ -649,6 +652,22 @@ static int php_set_inet6_addr(struct sockaddr_in6 *sin6, 
char *string, php_socke
 
}
 
+   if (scope++) {
+   long lval = 0;
+   double dval = 0;
+   unsigned scope_id = 0;
+
+   if (IS_LONG == is_numeric_string(scope, strlen(scope), lval, 
dval, 0)) {
+   if (lval  0  lval = UINT_MAX) {
+   scope_id = lval;
+   }
+   } else {
+   php_get_if_index_from_string(scope, scope_id 
TSRMLS_CC);
+   }
+
+   sin6-sin6_scope_id = scope_id;
+   }
+
return 1;
 }
 /* }}} */
@@ -714,6 +733,28 @@ static int php_set_inet46_addr(php_sockaddr_storage *ss, 
socklen_t *ss_len, char
return 0;
 }
 
+static int php_get_if_index_from_string(const char *val, unsigned *out 
TSRMLS_DC)
+{
+#if HAVE_IF_NAMETOINDEX
+   unsigned int ind;
+
+   ind = if_nametoindex(val);
+   if (ind == 0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING,
+   no interface with name \%s\ could be found, val);
+   return FAILURE;
+   } else {
+   *out = ind;
+   return SUCCESS;
+   }
+#else
+   php_error_docref(NULL TSRMLS_CC, E_WARNING,
+   this platform does not support looking up an interface 
by 
+   name, an integer interface index must be supplied 
instead);
+   return FAILURE;
+#endif
+}
+
 static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
 {
int ret;
@@ -729,26 +770,10 @@ static int php_get_if_index_from_zval(zval *val, unsigned 
*out TSRMLS_DC)
ret = SUCCESS;
}
} else {
-#if HAVE_IF_NAMETOINDEX
-   unsigned int ind;
zval_add_ref(val);
convert_to_string_ex(val);
-   ind = if_nametoindex(Z_STRVAL_P(val));
-   if (ind == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING,
-   no interface with name \%s\ could be found, 
Z_STRVAL_P(val));
-   ret = FAILURE;
-   } else {
-   *out = ind;
-   ret = SUCCESS;
-   }
+   ret = php_get_if_index_from_string(Z_STRVAL_P(val), out 
TSRMLS_CC);
zval_ptr_dtor(val);
-#else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING,
-   this platform does not support looking up an 
interface by 
-   name, an integer interface index must be 
supplied instead);
-   ret = FAILURE;
-#endif
}
 
return ret;


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/sockets/multicast.c ext/sockets/multicast.h ext/sockets/sockaddr_conv.c

2013-10-02 Thread Michael Wallner
Commit:2ba39268151549f03140ec3d260cf9489336ec93
Author:Michael Wallner m...@php.net Wed, 2 Oct 2013 15:55:38 +0200
Parents:   60e38b3243577abc80ce6bbcfb0b4125b08acb85 
9209c19f8f7eef807cb457b32d3ab517ff8dc178
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=2ba39268151549f03140ec3d260cf9489336ec93

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix bug #65808the socket_connect() won't work with IPv6 address
  5.4.22-dev now

Conflicts:
configure.in
ext/sockets/sockets.c
main/php_version.h

Bugs:
https://bugs.php.net/65808

Changed paths:
  MM  ext/sockets/multicast.c
  MM  ext/sockets/multicast.h
  MA  ext/sockets/sockaddr_conv.c

diff --cc ext/sockets/multicast.c
index 7466c62,43b6f7d..ecf3a65
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@@ -63,309 -73,6 +63,317 @@@ static const char *_php_source_op_to_st
  static int _php_source_op_to_ipv4_op(enum source_op sop);
  #endif
  
++int php_string_to_if_index(const char *val, unsigned *out TSRMLS_DC)
++{
++#if HAVE_IF_NAMETOINDEX
++  unsigned int ind;
++
++  ind = if_nametoindex(val);
++  if (ind == 0) {
++  php_error_docref(NULL TSRMLS_CC, E_WARNING,
++  no interface with name \%s\ could be found, val);
++  return FAILURE;
++  } else {
++  *out = ind;
++  return SUCCESS;
++  }
++#else
++  php_error_docref(NULL TSRMLS_CC, E_WARNING,
++  this platform does not support looking up an interface 
by 
++  name, an integer interface index must be supplied 
instead);
++  return FAILURE;
++#endif
++}
++
 +static int php_get_if_index_from_zval(zval *val, unsigned *out TSRMLS_DC)
 +{
 +  int ret;
 +
 +  if (Z_TYPE_P(val) == IS_LONG) {
 +  if (Z_LVAL_P(val)  0 || Z_LVAL_P(val)  UINT_MAX) {
 +  php_error_docref(NULL TSRMLS_CC, E_WARNING,
 +  the interface index cannot be negative or 
larger than %u;
 +   given %ld, UINT_MAX, Z_LVAL_P(val));
 +  ret = FAILURE;
 +  } else {
 +  *out = Z_LVAL_P(val);
 +  ret = SUCCESS;
 +  }
 +  } else {
- #if HAVE_IF_NAMETOINDEX
-   unsigned int ind;
 +  zval_add_ref(val);
 +  convert_to_string_ex(val);
-   ind = if_nametoindex(Z_STRVAL_P(val));
-   if (ind == 0) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING,
-   no interface with name \%s\ could be found, 
Z_STRVAL_P(val));
-   ret = FAILURE;
-   } else {
-   *out = ind;
-   ret = SUCCESS;
-   }
++  ret = php_string_to_if_index(Z_STRVAL_P(val), out TSRMLS_CC);
 +  zval_ptr_dtor(val);
- #else
-   php_error_docref(NULL TSRMLS_CC, E_WARNING,
-   this platform does not support looking up an 
interface by 
-   name, an integer interface index must be 
supplied instead);
-   ret = FAILURE;
- #endif
 +  }
 +
 +  return ret;
 +}
 +
++
++
 +static int php_get_if_index_from_array(const HashTable *ht, const char *key,
 +  php_socket *sock, unsigned int *if_index TSRMLS_DC)
 +{
 +  zval **val;
 +
 +  if (zend_hash_find(ht, key, strlen(key) + 1, (void **)val) == FAILURE) 
{
 +  *if_index = 0; /* default: 0 */
 +  return SUCCESS;
 +  }
 +
 +  return php_get_if_index_from_zval(*val, if_index TSRMLS_CC);
 +}
 +
 +static int php_get_address_from_array(const HashTable *ht, const char *key,
 +  php_socket *sock, php_sockaddr_storage *ss, socklen_t *ss_len TSRMLS_DC)
 +{
 +  zval **val,
 +   *valcp;
 +
 +  if (zend_hash_find(ht, key, strlen(key) + 1, (void **)val) == FAILURE) 
{
 +  php_error_docref(NULL TSRMLS_CC, E_WARNING, no key \%s\ 
passed in optval, key);
 +  return FAILURE;
 +  }
 +  valcp = *val;
 +  zval_add_ref(valcp);
 +  convert_to_string_ex(val);
 +  if (!php_set_inet46_addr(ss, ss_len, Z_STRVAL_P(valcp), sock 
TSRMLS_CC)) {
 +  zval_ptr_dtor(valcp);
 +  return FAILURE;
 +  }
 +  zval_ptr_dtor(valcp);
 +  return SUCCESS;
 +}
 +
 +static int php_do_mcast_opt(php_socket *php_sock, int level, int optname, 
zval **arg4 TSRMLS_DC)
 +{
 +  HashTable   *opt_ht;
 +  unsigned intif_index;
 +  int retval;
 +  int (*mcast_req_fun)(php_socket *, int, struct sockaddr *, socklen_t,
 +  unsigned TSRMLS_DC);
 +#ifdef HAS_MCAST_EXT
 +  int (*mcast_sreq_fun)(php_socket *, int, struct sockaddr *, socklen_t,
 +  

Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/sockets/multicast.c ext/sockets/multicast.h ext/sockets/sockaddr_conv.c

2013-10-02 Thread Michael Wallner
Gustavo, feel free to improve the aesthetics of my merge.
I was quite surprised by the amount of difference of the source layout :)

On 2 October 2013 15:55, Michael Wallner m...@php.net wrote:
 Commit:2ba39268151549f03140ec3d260cf9489336ec93
 Author:Michael Wallner m...@php.net Wed, 2 Oct 2013 15:55:38 
 +0200
 Parents:   60e38b3243577abc80ce6bbcfb0b4125b08acb85 
 9209c19f8f7eef807cb457b32d3ab517ff8dc178
 Branches:  PHP-5.5 master

 Link:   
 http://git.php.net/?p=php-src.git;a=commitdiff;h=2ba39268151549f03140ec3d260cf9489336ec93

 Log:
 Merge branch 'PHP-5.4' into PHP-5.5

 * PHP-5.4:
   fix bug #65808the socket_connect() won't work with IPv6 address
   5.4.22-dev now

 Conflicts:
 configure.in
 ext/sockets/sockets.c
 main/php_version.h

 Bugs:
 https://bugs.php.net/65808

 Changed paths:
   MM  ext/sockets/multicast.c
   MM  ext/sockets/multicast.h
   MA  ext/sockets/sockaddr_conv.c


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



-- 
Regards,
Mike

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



[PHP-CVS] com php-src: Reverted patch (it was used for internal testing and was committed by accident): sapi/cgi/cgi_main.c

2013-10-01 Thread Dmitry Stogov
Commit:51fca2b4b35c5db11a7136087fbf8cf3651200c1
Author:Dmitry Stogov dmi...@zend.com Tue, 1 Oct 2013 11:32:11 
+0400
Parents:   aeb6e9c264fc0054fb829da13c739cdafa276115
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=51fca2b4b35c5db11a7136087fbf8cf3651200c1

Log:
Reverted patch (it was used for internal testing and was committed by accident)

Changed paths:
  M  sapi/cgi/cgi_main.c


Diff:
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 4f3d504..4c78fca 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -154,7 +154,6 @@ static const opt_struct OPTIONS[] = {
{'?', 0, usage},/* help alias (both '?' and 'usage') */
{'v', 0, version},
{'z', 1, zend-extension},
-   {'W', 1, warmup},
{'T', 1, timing},
{'-', 0, NULL} /* end of args */
 };
@@ -1755,7 +1754,6 @@ int main(int argc, char *argv[])
int fcgi_fd = 0;
fcgi_request *request = NULL;
int repeats = 1;
-   int warmup_repeats = 0;
int benchmark = 0;
 #if HAVE_GETTIMEOFDAY
struct timeval start, end;
@@ -2105,9 +2103,6 @@ consult the installation file that came with this 
distribution, or visit \n\
time(start);
 #endif
break;
-   case 'W':
-   warmup_repeats = atoi(php_optarg);
-   break;
case 'h':
case '?':
if (request) {
@@ -2521,24 +2516,12 @@ fastcgi_request_done:
 
if (!fastcgi) {
if (benchmark) {
-   if (warmup_repeats) {
-   warmup_repeats--;
-   if (!warmup_repeats) {
-#ifdef HAVE_GETTIMEOFDAY
-   gettimeofday(start, 
NULL);
-#else
-   time(start);   

-#endif
-   }
+   repeats--;
+   if (repeats  0) {
+   script_file = NULL;
+   php_optind = orig_optind;
+   php_optarg = orig_optarg;
continue;
-   } else {
-   repeats--;
-   if (repeats  0) {
-   script_file = NULL;
-   php_optind = 
orig_optind;
-   php_optarg = 
orig_optarg;
-   continue;
-   }
}
}
break;


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.5': sapi/cgi/cgi_main.c

2013-10-01 Thread Dmitry Stogov
Commit:66cd9ef04cf20ead3db58f0bb387bb2070dbc591
Author:Dmitry Stogov dmi...@zend.com Tue, 1 Oct 2013 11:34:19 
+0400
Parents:   954a0f8bf4f8779f509b8361c1bc02246bd1ea20 
51fca2b4b35c5db11a7136087fbf8cf3651200c1
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=66cd9ef04cf20ead3db58f0bb387bb2070dbc591

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Reverted patch (it was used for internal testing and was committed by 
accident)

Changed paths:
  MM  sapi/cgi/cgi_main.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #61548: NEWS ext/standard/http_fopen_wrapper.c ext/standard/tests/http/bug61548.phpt

2013-10-01 Thread Michael Wallner
Commit:18b04b480ebc41841b2004cc11797eda40fb3958
Author:Michael Wallner m...@php.net Tue, 1 Oct 2013 11:07:55 +0200
Parents:   679bf479b63356f977c0bb04b5650b86cd4e15a1
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=18b04b480ebc41841b2004cc11797eda40fb3958

Log:
Fixed bug #61548

Bugs:
https://bugs.php.net/61548

Changed paths:
  M  NEWS
  M  ext/standard/http_fopen_wrapper.c
  A  ext/standard/tests/http/bug61548.phpt


Diff:
diff --git a/NEWS b/NEWS
index 4dc7ef7..9bb6032 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,10 @@ PHP  
  NEWS
   . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
 imap). (ryotakatsuki at gmail dot com)
 
+- Standard:
+  . Fixed bug #61548 (content-type must appear at the end of headers for 201 
+Location to work in http). (Mike)
+
 19 Sep 2013, PHP 5.4.20
 
 - Core:
diff --git a/ext/standard/http_fopen_wrapper.c 
b/ext/standard/http_fopen_wrapper.c
index b8676bb..4605e74 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -84,6 +84,30 @@
 #define HTTP_WRAPPER_HEADER_INIT1
 #define HTTP_WRAPPER_REDIRECTED 2
 
+static inline void strip_header(char *header_bag, char *lc_header_bag,
+   const char *lc_header_name)
+{
+   char *lc_header_start = strstr(lc_header_bag, lc_header_name);
+   char *header_start = header_bag + (lc_header_start - lc_header_bag);
+
+   if (lc_header_start
+(lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n')
+   ) {
+   char *lc_eol = strchr(lc_header_start, '\n');
+   char *eol = header_start + (lc_eol - lc_header_start);
+
+   if (lc_eol) {
+   size_t eollen = strlen(lc_eol);
+
+   memmove(lc_header_start, lc_eol+1, eollen);
+   memmove(header_start, eol+1, eollen);
+   } else {
+   *lc_header_start = '\0';
+   *header_start = '\0';
+   }
+   }
+}
+
 php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char 
*path, char *mode, int options, char **opened_path, php_stream_context 
*context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
 {
php_stream *stream = NULL;
@@ -425,40 +449,17 @@ finish:
if (tmp  strlen(tmp)  0) {
char *s;
 
-   if (!header_init) { /* Remove post headers for 
redirects */
-   int l = strlen(tmp);
-   char *s2, *tmp_c = estrdup(tmp);
-   
-   php_strtolower(tmp_c, l);
-   if ((s = strstr(tmp_c, content-length:))) {
-   if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
-   int b = tmp_c + l - 1 - s2;
-   memmove(tmp, tmp + (s2 + 1 - 
tmp_c), b);
-   memmove(tmp_c, s2 + 1, b);
-   
-   } else {
-   tmp[s - tmp_c] = *s = '\0';
-   }
-   l = strlen(tmp_c);
-   }
-   if ((s = strstr(tmp_c, content-type:))) {
-   if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
-   memmove(tmp, tmp + (s2 + 1 - 
tmp_c), tmp_c + l - 1 - s2);
-   } else {
-   tmp[s - tmp_c] = '\0';
-   }
-   }
-
-   efree(tmp_c);
-   tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, 
NULL, 3 TSRMLS_CC);
-   efree(tmp);
-   tmp = tmp_c;
-   }
-
user_headers = estrdup(tmp);
 
/* Make lowercase for easy comparison against 
'standard' headers */
php_strtolower(tmp, strlen(tmp));
+
+   if (!header_init) {
+   /* strip POST headers on redirect */
+   strip_header(user_headers, tmp, 
content-length:);
+   strip_header(user_headers, tmp, 
content-type:);
+   }
+
if ((s = strstr(tmp, user-agent:))  
(s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || 
 *(s-1) == '\t' || *(s-1) == ' ')) {
diff --git 

[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/standard/http_fopen_wrapper.c

2013-10-01 Thread Michael Wallner
Commit:d29a01de3f35a33c539a805e28a22a6514924a19
Author:Michael Wallner m...@php.net Tue, 1 Oct 2013 11:11:48 +0200
Parents:   66cd9ef04cf20ead3db58f0bb387bb2070dbc591 
ad139d9a00d9de206c7aae4f85eff08eff2c429e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d29a01de3f35a33c539a805e28a22a6514924a19

Log:
Merge branch 'PHP-5.5'

* PHP-5.5:
  Fixed bug #61548

Conflicts:
ext/standard/http_fopen_wrapper.c

Bugs:
https://bugs.php.net/61548

Changed paths:
  MM  ext/standard/http_fopen_wrapper.c


Diff:
diff --cc ext/standard/http_fopen_wrapper.c
index 8762fa4,4605e74..f5184ce
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@@ -85,8 -84,31 +85,33 @@@
  #define HTTP_WRAPPER_HEADER_INIT1
  #define HTTP_WRAPPER_REDIRECTED 2
  
- php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, const 
char *path, const char *mode, int options,
-   
char **opened_path, php_stream_context *context, int redirect_max, int flags 
STREAMS_DC TSRMLS_DC) /* {{{ */
+ static inline void strip_header(char *header_bag, char *lc_header_bag,
+   const char *lc_header_name)
+ {
+   char *lc_header_start = strstr(lc_header_bag, lc_header_name);
+   char *header_start = header_bag + (lc_header_start - lc_header_bag);
+ 
+   if (lc_header_start
+(lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n')
+   ) {
+   char *lc_eol = strchr(lc_header_start, '\n');
+   char *eol = header_start + (lc_eol - lc_header_start);
+ 
+   if (lc_eol) {
+   size_t eollen = strlen(lc_eol);
+ 
+   memmove(lc_header_start, lc_eol+1, eollen);
+   memmove(header_start, eol+1, eollen);
+   } else {
+   *lc_header_start = '\0';
+   *header_start = '\0';
+   }
+   }
+ }
+ 
 -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char 
*path, char *mode, int options, char **opened_path, php_stream_context 
*context, int redirect_max, int flags STREAMS_DC TSRMLS_DC) /* {{{ */
++php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, 
++  const char *path, const char *mode, int options, char 
**opened_path, 
++  php_stream_context *context, int redirect_max, int flags 
STREAMS_DC TSRMLS_DC) /* {{{ */
  {
php_stream *stream = NULL;
php_url *resource = NULL;


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



[PHP-CVS] tag php-src: create tag php-5.5.5RC1

2013-10-01 Thread JulienPauli
Tag php-5.5.5RC1 in php-src.git was created
Tag: cf2a9478a5195840d6cd2acab2541dd8b10dfe03
Tagger:  Julien Paulijpa...@php.net Tue Oct 1 14:26:09 2013 +0200
Log:
Tagged PHP-5.5.5RC1
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAABAgAGBQJSSr9rAAoJEP6FfZqQ2Q7BPvAH/16BC6rZzlBehk89VgRcvNpa
UVzOoWGAhHMK4iBx080zaSbK/sE8cIk/7/g1asfhimNVObphf7kmoERQ9gtaC4XF
xutME9ihf2QL3aY8Gr9Mn0B0Mf9dzh3KmyPvLNBMv8Qvcl9PkDMO4BRxHFdTJO+Q
0vgRj9gNyTFaEMGGqSR79NfSmkuhbrCDSalKDvNGQOhU+uPgclbYVW02ahdb5LLY
hbL5qkKif7K2G4RlWxmfb1UQ8zPLFWcDABcHZml7sz7Ru4LfqUM7nqdKxiH2y6Bu
0Y/hw3d8du33i8EFa+3LaOdLNCcHKUUJVCFODNBw/KczvQRHZ0/ldLMLeTHiBic=
=As+T
-END PGP SIGNATURE-

Link: 
http://git.php.net/?p=php-src.git;a=tag;h=cf2a9478a5195840d6cd2acab2541dd8b10dfe03

Target:  ca4fd954c798e8005e412c0e7f494cfa7c4632c6
Author:  Julien Pauli jpa...@php.net Tue, 1 Oct 2013 14:03:38 
+0200
Parents: ad139d9a00d9de206c7aae4f85eff08eff2c429e
Target link: 
http://git.php.net/?p=php-src.git;a=commitdiff;h=ca4fd954c798e8005e412c0e7f494cfa7c4632c6
Target log:
Preparing PHP5.5.5RC1

Changed paths:
  M  NEWS
  M  configure.in
  M  main/php_version.h



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: run-tests.php

2013-10-01 Thread Michael Wallner
Commit:4b61203b013468992dc86dea74379a5688ba19c7
Author:Michael Wallner m...@php.net Tue, 1 Oct 2013 17:01:44 +0200
Parents:   ad139d9a00d9de206c7aae4f85eff08eff2c429e 
cd1cab3f4726751a0476ac8701ce09cc37cb36df
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4b61203b013468992dc86dea74379a5688ba19c7

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode())

Bugs:
https://bugs.php.net/62396

Changed paths:
  MM  run-tests.php


Diff:



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



[PHP-CVS] com php-src: fix bug #62396 'make test' crashes starting with 5.3.14 (missing gzencode()): NEWS run-tests.php

2013-10-01 Thread Michael Wallner
Commit:cd1cab3f4726751a0476ac8701ce09cc37cb36df
Author:Michael Wallner m...@php.net Tue, 1 Oct 2013 17:01:03 +0200
Parents:   18b04b480ebc41841b2004cc11797eda40fb3958
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=cd1cab3f4726751a0476ac8701ce09cc37cb36df

Log:
fix bug #62396 'make test' crashes starting with 5.3.14
(missing gzencode())

Bugs:
https://bugs.php.net/62396

Changed paths:
  M  NEWS
  M  run-tests.php


Diff:
diff --git a/NEWS b/NEWS
index 9bb6032..b889e66 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,11 @@ PHP  
  NEWS
   . Fixed bug #61548 (content-type must appear at the end of headers for 201 
 Location to work in http). (Mike)
 
+- Build system:
+  . Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing 
+gzencode())). (Mike)
+
+
 19 Sep 2013, PHP 5.4.20
 
 - Core:
diff --git a/run-tests.php b/run-tests.php
index 935f821..317f607 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -455,7 +455,7 @@ $pass_options = '';
 $compression = 0;
 $output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
 
-if ($compression) {
+if ($compression  in_array(compress.zlib, stream_get_filters())) {
$output_file = 'compress.zlib://' . $output_file . '.gz';
 }
 
@@ -1545,6 +1545,16 @@ TEST $file
}
}
}
+   
+   if (!extension_loaded(zlib)
+(array_key_exists(GZIP_POST, $section_text) 
+   ||  array_key_exists(DEFLATE_POST, $section_text))
+   ) {
+   $message = ext/zlib required;
+   show_result('SKIP', $tested, $tested_file, reason: $message, 
$temp_filenames);
+   junit_mark_test_as('SKIP', $shortname, $tested, null, 
![CDATA[\n$message\n]]);
+   return 'SKIPPED';
+   }
 
if (@count($section_text['REDIRECTTEST']) == 1) {
$test_files = array();


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



Re: [PHP-CVS] com php-src: Make 'make distclean' remove the downloaded pear PHAR: Makefile.global

2013-10-01 Thread Christopher Jones



On 09/30/2013 05:07 PM, Johannes Schlüter wrote:

hi,

On Mon, 2013-09-30 at 22:46 +, Christopher Jones wrote:

Commit:d7baf0427fb56cbde55495e5c2071b1cdacb94ce
Author:Christopher Jones s...@php.net Mon, 30 Sep 2013 15:46:22 
-0700
Parents:   d4d6a95105feb3d7a39a5dfea7c4cd3080097295
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=d7baf0427fb56cbde55495e5c2071b1cdacb94ce

Log:
Make 'make distclean' remove the downloaded pear PHAR


My understanding of what distclean should do is clean it up to
distribution state. Distribution tarballs should have the pear file as
bundled by the release script and therefore the pear file should not be
removed.

I agree that we might need an obvious way for git users to update that
file from time to time. (I assume that is the intention with this)


It was to clean up out-of-tree builds, so that the whole build process is 100% 
repeatable.

Not related to the issue I was looking at, the git-clean target uses -X.  Does 
anyone recall why
it doesn't do a full clean?

Separately, I notice that the 5.5 snap is including things like an 
autom4te.cache dir
and various *.orig files.  This could be improved.

Also depending who does release bundling, the bison etc versions used can vary 
between
releases which isn't so good.

--
christopher.jo...@oracle.com  http://twitter.com/ghrd
Free PHP  Oracle book:
http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html

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



<    1   2   3   4   5   6   7   8   9   10   >