[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2008-07-15 Thread Jani Taskinen
janiTue Jul 15 16:10:32 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  MFH: Fixed potentially confusing error message on failure when no errors are 
logged
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.23r2=1.82.2.6.2.24diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.23 
php-src/main/streams/streams.c:1.82.2.6.2.24
--- php-src/main/streams/streams.c:1.82.2.6.2.23Wed Jun 11 09:02:09 2008
+++ php-src/main/streams/streams.c  Tue Jul 15 16:10:32 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.23 2008/06/11 09:02:09 dmitry Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.24 2008/07/15 16:10:32 jani Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -164,7 +164,11 @@
 
free_msg = 1;
} else {
-   msg = strerror(errno);
+   if (wrapper == php_plain_files_wrapper) {
+   msg = strerror(errno);
+   } else {
+   msg = operation failed;
+   }
}
} else {
msg = no suitable wrapper could be found;



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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2008-03-24 Thread Antony Dovgal
tony2001Mon Mar 24 16:28:56 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  MFH: disabled mmap() when copying files to memory
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.21r2=1.82.2.6.2.22diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.21 
php-src/main/streams/streams.c:1.82.2.6.2.22
--- php-src/main/streams/streams.c:1.82.2.6.2.21Mon Dec 31 07:20:15 2007
+++ php-src/main/streams/streams.c  Mon Mar 24 16:28:56 2008
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.21 2007/12/31 07:20:15 sebastian Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.22 2008/03/24 16:28:56 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1217,26 +1217,6 @@
maxlen = 0;
}
 
-   if (php_stream_mmap_possible(src)) {
-   char *p;
-   size_t mapped;
-
-   p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, 
PHP_STREAM_MAP_MODE_SHARED_READONLY, mapped);
-
-   if (p  mapped) {
-   *buf = pemalloc_rel_orig(mapped + 1, persistent);
-
-   if (*buf) {
-   memcpy(*buf, p, mapped);
-   (*buf)[mapped] = '\0';
-   }
-
-   php_stream_mmap_unmap(src);
-
-   return mapped;
-   }
-   }
-
if (maxlen  0) {
ptr = *buf = pemalloc_rel_orig(maxlen + 1, persistent);
while ((len  maxlen)  !php_stream_eof(src)) {



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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2007-08-08 Thread Jani Taskinen
janiWed Aug  8 07:01:49 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  MFH: This is what we get for not doing MFH..or MFB..a mess
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.17r2=1.82.2.6.2.18diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.17 
php-src/main/streams/streams.c:1.82.2.6.2.18
--- php-src/main/streams/streams.c:1.82.2.6.2.17Wed Aug  8 02:16:41 2007
+++ php-src/main/streams/streams.c  Wed Aug  8 07:01:49 2007
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.17 2007/08/08 02:16:41 iliaa Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.18 2007/08/08 07:01:49 jani Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1313,11 +1313,11 @@
p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, 
PHP_STREAM_MAP_MODE_SHARED_READONLY, mapped);
 
if (p) {
-   size_t written = php_stream_write(dest, p, mapped);
+   mapped = php_stream_write(dest, p, mapped);
 
php_stream_mmap_unmap(src);
 
-   return written;
+   return mapped;
}
}
 

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2007-07-11 Thread Dmitry Stogov
dmitry  Wed Jul 11 14:33:30 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  Fixed wrong warning
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.15r2=1.82.2.6.2.16diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.15 
php-src/main/streams/streams.c:1.82.2.6.2.16
--- php-src/main/streams/streams.c:1.82.2.6.2.15Tue Jul 10 11:57:34 2007
+++ php-src/main/streams/streams.c  Wed Jul 11 14:33:30 2007
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.15 2007/07/10 11:57:34 dmitry Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.16 2007/07/11 14:33:30 dmitry Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1557,7 +1557,7 @@
 #ifdef PHP_WIN32
if (localhost == 0  path[n+3] != '\0'  path[n+3] != 
'/'  path[n+4] != ':'){
 #else
-   if (localhost == 0  path[n+3] != '/') {
+   if (localhost == 0  path[n+3] != '\0'  path[n+3] != 
'/') {
 #endif
if (options  REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, 
E_WARNING, remote host file access not supported, %s, path);

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2007-07-10 Thread Dmitry Stogov
dmitry  Tue Jul 10 11:57:34 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  Fixed warning
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.14r2=1.82.2.6.2.15diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.14 
php-src/main/streams/streams.c:1.82.2.6.2.15
--- php-src/main/streams/streams.c:1.82.2.6.2.14Mon Jul  9 17:27:23 2007
+++ php-src/main/streams/streams.c  Tue Jul 10 11:57:34 2007
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.14 2007/07/09 17:27:23 dmitry Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.15 2007/07/10 11:57:34 dmitry Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1609,8 +1609,8 @@
if (wrapperpp  (*wrapperpp)-is_url 
 (options  STREAM_DISABLE_URL_PROTECTION) == 0 
(!PG(allow_url_fopen) || 
-((options  STREAM_OPEN_FOR_INCLUDE) ||
- PG(in_user_include))  !PG(allow_url_include))) {
+(((options  STREAM_OPEN_FOR_INCLUDE) ||
+  PG(in_user_include))  !PG(allow_url_include {
if (options  REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, URL 
file-access is disabled in the server configuration);
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2007-03-03 Thread Marcus Boerger
helly   Sat Mar  3 19:01:35 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  - MFH A stream wrapper might only allow directory access
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.11r2=1.82.2.6.2.12diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.11 
php-src/main/streams/streams.c:1.82.2.6.2.12
--- php-src/main/streams/streams.c:1.82.2.6.2.11Wed Feb 21 21:57:21 2007
+++ php-src/main/streams/streams.c  Sat Mar  3 19:01:34 2007
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.11 2007/02/21 21:57:21 tony2001 Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.12 2007/03/03 19:01:34 helly Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1769,10 +1769,14 @@
}
 
if (wrapper) {
-
-   stream = wrapper-wops-stream_opener(wrapper,
+   if (!wrapper-wops-stream_opener) {
+   php_stream_wrapper_log_error(wrapper, options ^ 
REPORT_ERRORS TSRMLS_CC,
+   wrapper does not support stream open);
+   } else {
+   stream = wrapper-wops-stream_opener(wrapper,
path_to_open, mode, options ^ REPORT_ERRORS,
opened_path, context STREAMS_REL_CC TSRMLS_CC);
+   }
 
/* if the caller asked for a persistent stream but the wrapper 
did not
 * return one, force an error here */

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2006-09-10 Thread Antony Dovgal
tony2001Sun Sep 10 13:01:38 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  fix coverity issue #197
  I can't think of a reason to pass a NULL buf (c) Wez
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.5r2=1.82.2.6.2.6diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.5 
php-src/main/streams/streams.c:1.82.2.6.2.6
--- php-src/main/streams/streams.c:1.82.2.6.2.5 Sun Sep  3 16:32:27 2006
+++ php-src/main/streams/streams.c  Sun Sep 10 13:01:37 2006
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.5 2006/09/03 16:32:27 iliaa Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.6 2006/09/10 13:01:37 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1198,10 +1198,6 @@
int min_room = CHUNK_SIZE / 4;
php_stream_statbuf ssbuf;
 
-   if (buf) { 
-   *buf = NULL;
-   }
-
if (maxlen == 0) { 
return 0;
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2006-06-20 Thread Hannes Magnusson
bjori   Tue Jun 20 18:09:50 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams   streams.c 
  Log:
  MFH: plug memleak
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.2r2=1.82.2.6.2.3diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.2 
php-src/main/streams/streams.c:1.82.2.6.2.3
--- php-src/main/streams/streams.c:1.82.2.6.2.2 Fri Jun 16 14:09:01 2006
+++ php-src/main/streams/streams.c  Tue Jun 20 18:09:50 2006
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.2 2006/06/16 14:09:01 rasmus Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.3 2006/06/20 18:09:50 bjori Exp $ */
 
 #define _GNU_SOURCE
 #include php.h
@@ -1216,7 +1216,7 @@
 
p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, 
PHP_STREAM_MAP_MODE_SHARED_READONLY, mapped);
 
-   if (p) {
+   if (p  mapped) {
*buf = pemalloc_rel_orig(mapped + 1, persistent);
 
if (*buf) {

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2006-06-20 Thread Antony Dovgal

Got any reproduce/test case ?

On 20.06.2006 22:09, Hannes Magnusson wrote:

bjori   Tue Jun 20 18:09:50 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main/streams	streams.c 
  Log:

  MFH: plug memleak
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.2r2=1.82.2.6.2.3diff_format=u

Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.2 
php-src/main/streams/streams.c:1.82.2.6.2.3
--- php-src/main/streams/streams.c:1.82.2.6.2.2 Fri Jun 16 14:09:01 2006
+++ php-src/main/streams/streams.c  Tue Jun 20 18:09:50 2006
@@ -19,7 +19,7 @@
+--+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.2 2006/06/16 14:09:01 rasmus Exp $ */

+/* $Id: streams.c,v 1.82.2.6.2.3 2006/06/20 18:09:50 bjori Exp $ */
 
 #define _GNU_SOURCE

 #include php.h
@@ -1216,7 +1216,7 @@
 
 		p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, mapped);
 
-		if (p) {

+   if (p  mapped) {
*buf = pemalloc_rel_orig(mapped + 1, persistent);
 
 			if (*buf) {





--
Wbr, 
Antony Dovgal


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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /main/streams streams.c

2006-06-20 Thread Antony Dovgal

On 20.06.2006 22:28, Hannes Magnusson wrote:

touch emptyfile; php -r 'file_get_contents(emptyfile);'

/usr/src/clean/php6/main/streams/streams.c(1639) :  Freeing 0x083DB4E4
(1 bytes), script=-
/usr/src/clean/php6/ext/standard/file.c(560) : Actual location
(location was relayed)
=== Total 1 memory leaks detected ===


Cool, thanks.

--
Wbr, 
Antony Dovgal


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