[PHP-CVS] cvs: php4 /ext/rpc/java config.m4 /sapi/servlet Makefile.frag config.m4 servlet.c servlet.java

2003-01-12 Thread Sebastian Bergmann
sebastian   Sun Jan 12 03:01:42 2003 EDT

  Modified files:  
/php4/sapi/servlet  Makefile.frag config.m4 servlet.c servlet.java 
/php4/ext/rpc/java  config.m4 
  Log:
  Patch by Giuseppe Tanzilli <[EMAIL PROTECTED]>.
  
Index: php4/sapi/servlet/Makefile.frag
diff -u php4/sapi/servlet/Makefile.frag:1.1 php4/sapi/servlet/Makefile.frag:1.2
--- php4/sapi/servlet/Makefile.frag:1.1 Thu Mar  7 09:19:58 2002
+++ php4/sapi/servlet/Makefile.frag Sun Jan 12 03:01:41 2003
@@ -1,19 +1,19 @@
 
-$(builddir)/java.c : $(srcdir)/../../ext/java/java.c
-   @cp $(srcdir)/../../ext/java/java.c $(builddir)
+sapi/servlet/java.c : sapi/servlet/../../ext/java/java.c sapi/servlet/phpsrvlt.jar
+   @cp sapi/servlet/../../ext/java/java.c sapi/servlet
 
-$(builddir)/phpsrvlt.jar : $(srcdir)/servlet.java 
$(srcdir)/../../ext/java/reflect.java
-   $(mkinstalldirs) $(builddir)/net/php
-   @echo library=php4 > $(builddir)/net/php/reflect.properties
-   @echo library=php4 > $(builddir)/net/php/servlet.properties
-   @cp $(builddir)/formatter.java $(builddir)/net/php
-   @cp $(builddir)/servlet.java $(builddir)/net/php
-   @cp $(srcdir)/../../ext/java/reflect.java $(builddir)/net/php
-   cd $(builddir) && javac net/php/reflect.java
-   @test ! -f $(builddir)/reflect.class || mv $(builddir)/reflect.class 
$(builddir)/net/php # bug in KJC javac
-   javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) 
$(builddir)/net/php/servlet.java
-   @test ! -f $(builddir)/servlet.class || mv $(builddir)/servlet.class 
$(builddir)/net/php # bug in KJC javac
-   javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH) 
$(builddir)/net/php/formatter.java
-   @test ! -f $(builddir)/formatter.class || mv $(builddir)/formatter.class 
$(builddir)/net/php # bug in KJC javac
-   cd $(builddir)/ && $(JAVA_JAR) phpsrvlt.jar net/php/*.class 
net/php/*.properties
-   @rm -rf $(builddir)/net
+sapi/servlet/phpsrvlt.jar : sapi/servlet/servlet.java 
+sapi/servlet/../../ext/java/reflect.java
+   $(mkinstalldirs) sapi/servlet/net/php
+   @echo library=php4 > sapi/servlet/net/php/reflect.properties
+   @echo library=php4 > sapi/servlet/net/php/servlet.properties
+   @cp sapi/servlet/formatter.java sapi/servlet/net/php
+   @cp sapi/servlet/servlet.java sapi/servlet/net/php
+   @cp sapi/servlet/../../ext/java/reflect.java sapi/servlet/net/php
+   cd sapi/servlet && javac net/php/reflect.java
+   @test ! -f sapi/servlet/reflect.class || mv sapi/servlet/reflect.class 
+sapi/servlet/net/php # bug in KJC javac
+   cd sapi/servlet && javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH):. 
+net/php/servlet.java
+   @test ! -f sapi/servlet/servlet.class || mv sapi/servlet/servlet.class 
+sapi/servlet/net/php # bug in KJC javac
+   cd sapi/servlet && javac -classpath .:$(SERVLET_CLASSPATH):$(CLASSPATH):. 
+net/php/formatter.java
+   @test ! -f sapi/servlet/formatter.class || mv sapi/servlet/formatter.class 
+sapi/servlet/net/php # bug in KJC javac
+   cd sapi/servlet/ && $(JAVA_JAR) phpsrvlt.jar net/php/*.class 
+net/php/*.properties
+   @rm -rf sapi/servlet/net
Index: php4/sapi/servlet/config.m4
diff -u php4/sapi/servlet/config.m4:1.13 php4/sapi/servlet/config.m4:1.14
--- php4/sapi/servlet/config.m4:1.13Thu Mar  7 09:20:00 2002
+++ php4/sapi/servlet/config.m4 Sun Jan 12 03:01:41 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.13 2002/03/07 14:20:00 sas Exp $
+dnl $Id: config.m4,v 1.14 2003/01/12 08:01:41 sebastian Exp $
 dnl
 
 AC_MSG_CHECKING(for Servlet support)
@@ -34,13 +34,15 @@
 AC_DEFINE(SAPI_SERVLET, 1, [Whether you use Servlet])
 
 INSTALL_IT="\$(mkinstalldirs) \$(libdir)"
-INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 \$(srcdir)/sapi/servlet/phpsrvlt.jar 
\$(libdir)"
+INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 
+\$(top_srcdir)/sapi/servlet/phpsrvlt.jar \$(libdir)"
 INSTALL_IT="$INSTALL_IT; \$(INSTALL) -m 0755 $SAPI_SHARED \$(libdir)"
 PHP_SAPI=servlet
 PHP_BUILD_THREAD_SAFE
+EXTRA_INCLUDES="$EXTRA_INCLUDES \$(JAVA_INCLUDE)"
 PHP_SELECT_SAPI(servlet, shared, servlet.c)
-PHP_ADD_SOURCES(/sapi/servlet, java.c,,sapi)
+PHP_ADD_SOURCES(/sapi/servlet, java.c,, sapi)
 PHP_ADD_MAKEFILE_FRAGMENT(sapi/servlet/Makefile.frag)
+
 AC_MSG_RESULT(yes)
   else
 AC_MSG_RESULT(no)
Index: php4/sapi/servlet/servlet.c
diff -u php4/sapi/servlet/servlet.c:1.67 php4/sapi/servlet/servlet.c:1.68
--- php4/sapi/servlet/servlet.c:1.67Tue Dec 31 10:59:13 2002
+++ php4/sapi/servlet/servlet.c Sun Jan 12 03:01:41 2003
@@ -258,7 +258,7 @@
 
sapi_startup(&servlet_sapi_module);
 
-   if (php_module_startup(&servlet_sapi_module, additional_php_extensions, 
EXTCOUNT)==FAILURE) {
+   if (php_module_startup(&servlet_sapi_module, &java_module_entry, 1)==FAILURE) {
ThrowServletException(jenv,"module startup failure");
return;
}
Index: php4/sapi/se

[PHP-CVS] cvs: php4 /sapi/servlet servlet.c

2003-01-12 Thread Sebastian Bergmann
sebastian   Sun Jan 12 03:03:18 2003 EDT

  Modified files:  
/php4/sapi/servlet  servlet.c 
  Log:
  Patch by Giuseppe Tanzilli <[EMAIL PROTECTED]>.
  
Index: php4/sapi/servlet/servlet.c
diff -u php4/sapi/servlet/servlet.c:1.68 php4/sapi/servlet/servlet.c:1.69
--- php4/sapi/servlet/servlet.c:1.68Sun Jan 12 03:01:41 2003
+++ php4/sapi/servlet/servlet.c Sun Jan 12 03:03:17 2003
@@ -71,12 +71,6 @@
 
 extern zend_module_entry java_module_entry;
 
-static zend_module_entry *additional_php_extensions[] = {
-  &java_module_entry
-};
-
-#define EXTCOUNT (sizeof(additional_php_extensions)/sizeof(zend_module_entry *))
-
 /***/
 
 /*



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




[PHP-CVS] cvs: php4 / run-tests.php

2003-01-12 Thread Jan Lehnardt
jan Sun Jan 12 06:42:30 2003 EDT

  Modified files:  
/php4   run-tests.php 
  Log:
   - fix typo
  
  
Index: php4/run-tests.php
diff -u php4/run-tests.php:1.137 php4/run-tests.php:1.138
--- php4/run-tests.php:1.137Tue Jan  7 10:21:34 2003
+++ php4/run-tests.php  Sun Jan 12 06:42:29 2003
@@ -366,7 +366,7 @@

/* Ask the user to provide an email address, so that QA team can 
contact the user */
if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 
0) {
-   echo "\nPlease enter your email address.\n(You address will be 
mangled so that it will not go out on any\nmailinglist in plain text): ";
+   echo "\nPlease enter your email address.\n(Your address will 
+be mangled so that it will not go out on any\nmailinglist in plain text): ";
flush();
$fp = fopen("php://stdin", "r+");
$user_email = trim(fgets($fp, 1024));



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




[PHP-CVS] cvs: php4 / NEWS phpdoc-zh/reference/filesystem/functions flock.xml fread.xml rename.xml rmdir.xml unlink.xml

2003-01-12 Thread Derick Rethans
derick  Sun Jan 12 07:45:19 2003 EDT

  Modified files:  
/phpdoc-zh/reference/filesystem/functions   flock.xml fread.xml 
rename.xml rmdir.xml 
unlink.xml 
/php4   NEWS 
  Log:
  - Update NEWS to show 5.0.0
  
  
Index: phpdoc-zh/reference/filesystem/functions/flock.xml
diff -u phpdoc-zh/reference/filesystem/functions/flock.xml:1.2 
phpdoc-zh/reference/filesystem/functions/flock.xml:1.3
--- phpdoc-zh/reference/filesystem/functions/flock.xml:1.2  Sun Dec 22 04:17:53 
2002
+++ phpdoc-zh/reference/filesystem/functions/flock.xml  Sun Jan 12 07:45:17 2003
@@ -1,6 +1,7 @@
-
-
-
+
+
+
+
   

 flock
Index: phpdoc-zh/reference/filesystem/functions/fread.xml
diff -u phpdoc-zh/reference/filesystem/functions/fread.xml:1.2 
phpdoc-zh/reference/filesystem/functions/fread.xml:1.3
--- phpdoc-zh/reference/filesystem/functions/fread.xml:1.2  Sat Nov  9 21:22:55 
2002
+++ phpdoc-zh/reference/filesystem/functions/fread.xml  Sun Jan 12 07:45:18 2003
@@ -1,6 +1,7 @@
-
-
-
+
+
+
+
   

 fread
Index: phpdoc-zh/reference/filesystem/functions/rename.xml
diff -u phpdoc-zh/reference/filesystem/functions/rename.xml:1.2 
phpdoc-zh/reference/filesystem/functions/rename.xml:1.3
--- phpdoc-zh/reference/filesystem/functions/rename.xml:1.2 Sat Nov  9 21:03:15 
2002
+++ phpdoc-zh/reference/filesystem/functions/rename.xml Sun Jan 12 07:45:18 2003
@@ -1,6 +1,7 @@
-
-
-
+
+
+
+
   

 rename
Index: phpdoc-zh/reference/filesystem/functions/rmdir.xml
diff -u phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.3 
phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.4
--- phpdoc-zh/reference/filesystem/functions/rmdir.xml:1.3  Sat Nov  9 20:55:56 
2002
+++ phpdoc-zh/reference/filesystem/functions/rmdir.xml  Sun Jan 12 07:45:18 2003
@@ -1,6 +1,7 @@
 
-
-
+
+
+
   

 rmdir
Index: phpdoc-zh/reference/filesystem/functions/unlink.xml
diff -u phpdoc-zh/reference/filesystem/functions/unlink.xml:1.2 
phpdoc-zh/reference/filesystem/functions/unlink.xml:1.3
--- phpdoc-zh/reference/filesystem/functions/unlink.xml:1.2 Sat Nov  9 20:59:23 
2002
+++ phpdoc-zh/reference/filesystem/functions/unlink.xml Sun Jan 12 07:45:18 2003
@@ -1,6 +1,7 @@
 
-
-
+
+
+
   

 unlink
Index: php4/NEWS
diff -u php4/NEWS:1.1307 php4/NEWS:1.1308
--- php4/NEWS:1.1307Fri Jan 10 20:34:56 2003
+++ php4/NEWS   Sun Jan 12 07:45:18 2003
@@ -1,6 +1,6 @@
 PHP 4  NEWS
 |||
-? ? ??? 200?, Version 4.4.0
+? ? ??? 200?, Version 5.0.0
 - Fixed bug #20155: xmlrpc compile problem with zendengine2 (Derick, Jan
   Schneider)
 - Implemented string.base64 stream filter. (Moriyoshi)



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




Re: [PHP-CVS] cvs: php4 / NEWS phpdoc-zh/reference/filesystem/functionsflock.xml fread.xml rename.xml rmdir.xml unlink.xml

2003-01-12 Thread Derick Rethans
Hey

On Sun, 12 Jan 2003, Derick Rethans wrote:

> derickSun Jan 12 07:45:19 2003 EDT
> 
>   Modified files:  
> /phpdoc-zh/reference/filesystem/functions flock.xml fread.xml 
>   rename.xml rmdir.xml 
>   unlink.xml 
> /php4 NEWS 
>   Log:
>   - Update NEWS to show 5.0.0

erm? CVS is bugging again? :)
I only committed NEWS here.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


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




[PHP-CVS] cvs: php4 /ext/standard filters.c

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 07:48:13 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c 
  Log:
  . Updated quoted-printable filter by a neater implementation.
  . Changed emalloc family functions to pemalloc ones for persistent filters. 
  . Changed base64 and quoted-printable filter names to "convert.base64-encode",
"convert.base64-decode", "convert.quoted-printable-encode", and
"convert.quoted-printable-decode" respectively for the consistency that
may be requested later.
  
  
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.9 php4/ext/standard/filters.c:1.10
--- php4/ext/standard/filters.c:1.9 Wed Jan  8 18:44:38 2003
+++ php4/ext/standard/filters.c Sun Jan 12 07:48:13 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: filters.c,v 1.9 2003/01/08 23:44:38 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.10 2003/01/12 12:48:13 moriyoshi Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -206,7 +206,7 @@
 };
 /* }}} */
 
-/* {{{ base64 stream filter implementation */
+/* {{{ base64 / quoted_printable stream filter implementation */
 
 typedef enum _php_conv_err_t {
PHP_CONV_ERR_SUCCESS = SUCCESS,
@@ -552,69 +552,258 @@
 }
 /* }}} */
 
-typedef struct _php_base64_filter {
+/* {{{ php_conv_qprint_encode */
+typedef struct _php_conv_qprint_encode {
+   php_conv _super;
+} php_conv_qprint_encode;
+
+static void php_conv_qprint_encode_dtor(php_conv_qprint_encode *inst);
+static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *inst, 
+const char **in_pp, size_t *in_left_p, char **out_pp, size_t *out_left_p);
+
+static void php_conv_qprint_encode_dtor(php_conv_qprint_encode *inst)
+{
+   /* do nothing */
+}
+
+static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *inst, 
+const char **in_pp, size_t *in_left_p, char **out_pp, size_t *out_left_p)
+{
+   php_conv_err_t err = PHP_CONV_ERR_SUCCESS;
+   unsigned char *ps, *pd;
+   size_t icnt, ocnt;
+   unsigned int c;
+   static char qp_digits[] = "0123456789ABCDEF";
+
+   if (in_pp == NULL || in_left_p == NULL) {
+   return PHP_CONV_ERR_SUCCESS;
+   }
+
+   ps = (unsigned char *)(*in_pp);
+   icnt = *in_left_p;
+   pd = (unsigned char *)(*out_pp);
+   ocnt = *out_left_p;
+ 
+   for (; icnt > 0; icnt--, ps++) {
+   c = *ps;
+
+   if ((c >= 33 && c <= 60) || (c >= 62 && c <= 126)) { 
+   if (ocnt < 1) {
+   err = PHP_CONV_ERR_TOO_BIG;
+   break;
+   }
+   *(pd++) = c;
+   ocnt--;
+   } else {
+   if (ocnt < 3) {
+   err = PHP_CONV_ERR_TOO_BIG;
+   break;
+   }
+   *(pd++) = '=';
+   *(pd++) = qp_digits[(c >> 4)];
+   *(pd++) = qp_digits[(c & 0x0f)]; 
+   ocnt -= 3;
+   }
+   }
+
+   *in_pp = (const char *)ps;
+   *in_left_p = icnt;
+   *out_pp = (char *)pd;
+   *out_left_p = ocnt; 
+
+   return err;
+}
+
+static php_conv_err_t php_conv_qprint_encode_ctor(php_conv_qprint_encode *inst)
+{
+   inst->_super.convert_op = (php_conv_convert_func) 
+php_conv_qprint_encode_convert;
+   inst->_super.dtor = (php_conv_dtor_func) php_conv_qprint_encode_dtor;
+   return PHP_CONV_ERR_SUCCESS;
+}
+/* }}} */
+
+/* {{{ php_conv_qprint_decode */
+typedef struct _php_conv_qprint_decode {
+   php_conv _super;
+
+   int scan_stat;
+   unsigned int next_char;
+} php_conv_qprint_decode;
+
+static void php_conv_qprint_decode_dtor(php_conv_qprint_decode *inst)
+{
+   /* do nothing */
+}
+
+static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *inst, 
+const char **in_pp, size_t *in_left_p, char **out_pp, size_t *out_left_p)
+{
+   php_conv_err_t err = PHP_CONV_ERR_SUCCESS;
+   size_t icnt, ocnt;
+   unsigned char *ps, *pd;
+   unsigned int scan_stat;
+   unsigned int v;
+
+   if (in_pp == NULL || in_left_p == NULL) {
+   if (inst->scan_stat != 0) {
+   return PHP_CONV_ERR_UNEXPECTED_EOS;
+   }
+   return PHP_CONV_ERR_SUCCESS;
+   }
+
+   ps = (unsigned char *)(*in_pp);
+   icnt = *in_left_p;
+   pd = (unsigned char *)(*out_pp);
+   ocnt = *out_left_p;
+   scan_stat = inst->scan_stat;
+
+   v = 0;
+
+   for (;icnt > 0; icnt--) {
+   switch (scan_stat) {
+   case 0: {
+   if (*ps == '=') {
+   scan_stat = 1;
+   } else {
+   if (ocnt < 1) {
+   

[PHP-CVS] cvs: php4 /ext/session mod_files.c

2003-01-12 Thread Sascha Schumann
sas Sun Jan 12 08:05:33 2003 EDT

  Modified files:  
/php4/ext/session   mod_files.c 
  Log:
  handle ERANGE from strtol properly
  
  
Index: php4/ext/session/mod_files.c
diff -u php4/ext/session/mod_files.c:1.86 php4/ext/session/mod_files.c:1.87
--- php4/ext/session/mod_files.c:1.86   Fri Jan  3 09:24:07 2003
+++ php4/ext/session/mod_files.cSun Jan 12 08:05:32 2003
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: mod_files.c,v 1.86 2003/01/03 14:24:07 hyanantha Exp $ */
+/* $Id: mod_files.c,v 1.87 2003/01/12 13:05:32 sas Exp $ */
 
 #include "php.h"
 
@@ -239,7 +239,12 @@
 
data->fd = -1;
if ((p = strchr(save_path, ';'))) {
+   errno = 0;
data->dirdepth = (size_t) strtol(save_path, NULL, 10);
+   if (errno == ERANGE) {
+   efree(data);
+   return FAILURE;
+   }
save_path = p + 1;
}
data->basedir_len = strlen(save_path);



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




[PHP-CVS] cvs: php4 / php.ini-dist php.ini-recommended /ext/session php_session.h session.c

2003-01-12 Thread Sascha Schumann
sas Sun Jan 12 08:07:15 2003 EDT

  Modified files:  
/php4   php.ini-dist php.ini-recommended 
/php4/ext/session   php_session.h session.c 
  Log:
  add INI setting session.hash_function
  add support for creating session ids using SHA-1
  source more entropy for session ids
  
  
Index: php4/php.ini-dist
diff -u php4/php.ini-dist:1.175 php4/php.ini-dist:1.176
--- php4/php.ini-dist:1.175 Thu Dec 26 08:40:32 2002
+++ php4/php.ini-dist   Sun Jan 12 08:07:14 2003
@@ -896,6 +896,11 @@
 ;   always using URL stored in browser's history or bookmarks.
 session.use_trans_sid = 0
 
+; Select a hash function
+; 0: MD5   (128 bits, 32 characters, [0-9a-f])
+; 1: SHA-1 (160 bits, 32 characters, [0-9a-z])
+session.hash_function = 0
+
 ; The URL rewriter will look for URLs in a defined set of HTML tags.
 ; form/fieldset are special; if you include them here, the rewriter will
 ; add a hidden  field with the info which is otherwise appended
Index: php4/php.ini-recommended
diff -u php4/php.ini-recommended:1.122 php4/php.ini-recommended:1.123
--- php4/php.ini-recommended:1.122  Thu Dec 26 08:40:32 2002
+++ php4/php.ini-recommendedSun Jan 12 08:07:14 2003
@@ -891,6 +891,11 @@
 ;   always using URL stored in browser's history or bookmarks.
 session.use_trans_sid = 0
 
+; Select a hash function
+; 0: MD5   (128 bits, 32 characters, alphabet [0-9a-f])
+; 1: SHA-1 (160 bits, 32 characters, alphabet [0-9a-v])
+session.hash_function = 0
+
 ; The URL rewriter will look for URLs in a defined set of HTML tags.
 ; form/fieldset are special; if you include them here, the rewriter will
 ; add a hidden  field with the info which is otherwise appended
Index: php4/ext/session/php_session.h
diff -u php4/ext/session/php_session.h:1.85 php4/ext/session/php_session.h:1.86
--- php4/ext/session/php_session.h:1.85 Tue Dec 31 11:07:26 2002
+++ php4/ext/session/php_session.h  Sun Jan 12 08:07:14 2003
@@ -118,6 +118,8 @@
zend_bool use_only_cookies;
zend_bool use_trans_sid;/* contains the INI value of whether to use 
trans-sid */
zend_bool apply_trans_sid;  /* whether or not to enable trans-sid for the 
current request */
+
+   long hash_func;
 } php_ps_globals;
 
 typedef php_ps_globals zend_ps_globals;
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.344 php4/ext/session/session.c:1.345
--- php4/ext/session/session.c:1.344Wed Jan  8 08:28:16 2003
+++ php4/ext/session/session.c  Sun Jan 12 08:07:14 2003
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: session.c,v 1.344 2003/01/08 13:28:16 zeev Exp $ */
+/* $Id: session.c,v 1.345 2003/01/12 13:07:14 sas Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -38,6 +38,7 @@
 #include "SAPI.h"
 #include "php_session.h"
 #include "ext/standard/md5.h"
+#include "ext/standard/sha1.h"
 #include "ext/standard/php_var.h"
 #include "ext/standard/datetime.h"
 #include "ext/standard/php_lcg.h"
@@ -151,7 +152,7 @@
STD_PHP_INI_ENTRY("session.cache_limiter",  "nocache",   PHP_INI_ALL, 
OnUpdateString, cache_limiter,  php_ps_globals,ps_globals)
STD_PHP_INI_ENTRY("session.cache_expire",   "180",   PHP_INI_ALL, 
OnUpdateInt,cache_expire,   php_ps_globals,ps_globals)
STD_PHP_INI_BOOLEAN("session.use_trans_sid","0", 
PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool,   use_trans_sid,  php_ps_globals,
ps_globals)
-
+   STD_PHP_INI_ENTRY("session.hash_function",  "0", PHP_INI_ALL, 
+OnUpdateInt,hash_func,  php_ps_globals,ps_globals)
/* Commented out until future discussion */
/* PHP_INI_ENTRY("session.encode_sources", "globals,track", PHP_INI_ALL, NULL) 
*/
 PHP_INI_END()
@@ -535,55 +536,129 @@
}
 }
 
-static char hexconvtab[] = "0123456789abcdef";
+static char hexconvtab[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+
+enum {
+   PS_HASH_FUNC_MD5,
+   PS_HASH_FUNC_SHA1
+};
 
 char *php_session_create_id(PS_CREATE_SID_ARGS)
 {
-   PHP_MD5_CTX context;
-   unsigned char digest[16];
-   char buf[256];
+   PHP_MD5_CTX md5_context;
+   PHP_SHA1_CTX sha1_context;
+   unsigned char digest[21];
+   int digest_len;
+   char *buf;
struct timeval tv;
int i;
int j = 0;
unsigned char c;
+   unsigned int w;
+   zval **array;
+   zval **token;
+   char *remote_addr = NULL;
 
gettimeofday(&tv, NULL);
-   PHP_MD5Init(&context);

-   sprintf(buf, "%ld%ld%0.8f", tv.tv_sec, tv.tv_usec, php_combined_lcg(TSRMLS_C) 
* 10);
-   PHP_MD5Update(&context, buf, strlen(buf));
+   if (zend_hash_find(&EG(symbol_table), "_SERVER",
+   sizeof("_SERVER"), (void **) &array) == SUCCESS &&
+   Z_TYPE_PP(array) == IS_ARRAY &&
+   zend_hash_find(Z_ARRVAL_PP(array), "REMOTE_A

[PHP-CVS] cvs: php4 / php.ini-dist

2003-01-12 Thread Sascha Schumann
sas Sun Jan 12 08:09:55 2003 EDT

  Modified files:  
/php4   php.ini-dist 
  Log:
  sync entries
  
Index: php4/php.ini-dist
diff -u php4/php.ini-dist:1.176 php4/php.ini-dist:1.177
--- php4/php.ini-dist:1.176 Sun Jan 12 08:07:14 2003
+++ php4/php.ini-dist   Sun Jan 12 08:09:54 2003
@@ -898,7 +898,7 @@
 
 ; Select a hash function
 ; 0: MD5   (128 bits, 32 characters, [0-9a-f])
-; 1: SHA-1 (160 bits, 32 characters, [0-9a-z])
+; 1: SHA-1 (160 bits, 32 characters, [0-9a-v])
 session.hash_function = 0
 
 ; The URL rewriter will look for URLs in a defined set of HTML tags.



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




[PHP-CVS] cvs: php4 / php.ini-recommended

2003-01-12 Thread Sascha Schumann
sas Sun Jan 12 08:26:47 2003 EDT

  Modified files:  
/php4   php.ini-recommended 
  Log:
  recommending SHA-1 as hash function
  
Index: php4/php.ini-recommended
diff -u php4/php.ini-recommended:1.123 php4/php.ini-recommended:1.124
--- php4/php.ini-recommended:1.123  Sun Jan 12 08:07:14 2003
+++ php4/php.ini-recommendedSun Jan 12 08:26:47 2003
@@ -894,7 +894,7 @@
 ; Select a hash function
 ; 0: MD5   (128 bits, 32 characters, alphabet [0-9a-f])
 ; 1: SHA-1 (160 bits, 32 characters, alphabet [0-9a-v])
-session.hash_function = 0
+session.hash_function = 1
 
 ; The URL rewriter will look for URLs in a defined set of HTML tags.
 ; form/fieldset are special; if you include them here, the rewriter will



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




[PHP-CVS] cvs: php4 /ext/standard filters.c

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 08:41:35 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c 
  Log:
  Fixed error msg format so it correctly reports the actual filter name
  
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.10 php4/ext/standard/filters.c:1.11
--- php4/ext/standard/filters.c:1.10Sun Jan 12 07:48:13 2003
+++ php4/ext/standard/filters.c Sun Jan 12 08:41:35 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: filters.c,v 1.10 2003/01/12 12:48:13 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.11 2003/01/12 13:41:35 moriyoshi Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -869,15 +869,15 @@
break;
 
case PHP_CONV_ERR_UNKNOWN:
-   php_error(E_WARNING, "stream filter(%s): 
unknown error", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+unknown error", inst->filtername, err);
return 0;
 
case PHP_CONV_ERR_INVALID_SEQ:
-   php_error(E_WARNING, "stream filter(%s): 
invalid base64 sequence", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+invalid base64 sequence", inst->filtername, err);
return 0;

case PHP_CONV_ERR_UNEXPECTED_EOS:
-   php_error(E_WARNING, "stream filter(%s): 
unexpected end of stream", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+unexpected end of stream", inst->filtername, err);
return 0;
 
default:
@@ -923,15 +923,15 @@
 
switch (err) {
case PHP_CONV_ERR_UNKNOWN:
-   php_error(E_WARNING, "stream filter(%s): 
unknown error", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+unknown error", inst->filtername, err);
return 0;
 
case PHP_CONV_ERR_INVALID_SEQ:
-   php_error(E_WARNING, "stream filter(%s): 
invalid base64 sequence", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+invalid base64 sequence", inst->filtername, err);
return 0;
 
case PHP_CONV_ERR_UNEXPECTED_EOS:
-   php_error(E_WARNING, "stream filter(%s): 
unexpected end of stream", thisfilter->fops->label, err);
+   php_error(E_WARNING, "stream filter (%s): 
+unexpected end of stream", inst->filtername, err);
return 0;
 
default:
@@ -968,7 +968,7 @@
out_p = bucket_buf;
out_left = sizeof(bucket_buf);
} else {
-   php_error(E_WARNING, "stream filter(%s): 
unknown error", thisfilter->fops->label);
+   php_error(E_WARNING, "stream filter (%s): 
+unknown error", inst->filtername);
return 0;
}
}



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




[PHP-CVS] cvs: php4 /ext/standard filters.c

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 08:46:11 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c 
  Log:
  Fixed infinite loop bug when an invalid quoted-printable escape sequence
  appears in the streem.
  
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.11 php4/ext/standard/filters.c:1.12
--- php4/ext/standard/filters.c:1.11Sun Jan 12 08:41:35 2003
+++ php4/ext/standard/filters.c Sun Jan 12 08:46:11 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: filters.c,v 1.11 2003/01/12 13:41:35 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.12 2003/01/12 13:46:11 moriyoshi Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -675,7 +675,8 @@
unsigned int nbl = (*ps >= 'A' ? *ps - 0x37 : *ps - 
0x30);
 
if (nbl > 15) {
-   return 0;
+   err = PHP_CONV_ERR_INVALID_SEQ;
+   goto out;
}
v = (v << 4) | nbl;
 



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




[PHP-CVS] cvs: php4 /ext/standard var.c

2003-01-12 Thread Stanislav Malyshev
stasSun Jan 12 08:50:18 2003 EDT

  Modified files:  
/php4/ext/standard  var.c 
  Log:
  remove unneeded var
  
  
Index: php4/ext/standard/var.c
diff -u php4/ext/standard/var.c:1.152 php4/ext/standard/var.c:1.153
--- php4/ext/standard/var.c:1.152   Tue Dec 31 11:07:57 2002
+++ php4/ext/standard/var.c Sun Jan 12 08:50:17 2003
@@ -60,7 +60,6 @@
 void php_var_dump(zval **struc, int level TSRMLS_DC)
 {
HashTable *myht = NULL;
-   zend_object *object = NULL;
 
if (level > 1) {
php_printf("%*c", level - 1, ' ');
@@ -93,7 +92,6 @@
php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht));
goto head_done;
case IS_OBJECT:
-   object = Z_OBJ_PP(struc);
myht = Z_OBJPROP_PP(struc);
if (myht->nApplyCount > 1) {
PUTS("*RECURSION*\n");



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




[PHP-CVS] cvs: CVSROOT / cvswrappers

2003-01-12 Thread Gabor Hojtsy
gobaSun Jan 12 12:28:30 2003 EDT

  Modified files:  
/CVSROOTcvswrappers 
  Log:
  Add some more compressed formats to be handled binary, and not to be diffed...
  
  
Index: CVSROOT/cvswrappers
diff -u CVSROOT/cvswrappers:1.4 CVSROOT/cvswrappers:1.5
--- CVSROOT/cvswrappers:1.4 Mon Apr  2 11:03:11 2001
+++ CVSROOT/cvswrappers Sun Jan 12 12:28:30 2003
@@ -1,5 +1,5 @@
 #
-#ident "@(#)cvs/examples:$Name:  $:$Id: cvswrappers,v 1.4 2001/04/02 15:03:11 rasmus 
Exp $"
+#ident "@(#)cvs/examples:$Name:  $:$Id: cvswrappers,v 1.5 2003/01/12 17:28:30 goba 
+Exp $"
 #
 # This file describes wrappers and other binary files to CVS.
 #
@@ -50,3 +50,6 @@
 *.lha  -k 'b' -m 'COPY'
 *.pdf  -k 'b' -m 'COPY'
 *.chm  -k 'b' -m 'COPY'
+*.tar  -k 'b' -m 'COPY'
+*.bz2  -k 'b' -m 'COPY'
+*.zip  -k 'b' -m 'COPY'



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




[PHP-CVS] cvs: CVSROOT / cvswrappers

2003-01-12 Thread Gabor Hojtsy
gobaSun Jan 12 12:40:05 2003 EDT

  Modified files:  
/CVSROOTcvswrappers 
  Log:
  OK, two *.dsw and two *.zip is a bit too much :)
  
  
Index: CVSROOT/cvswrappers
diff -u CVSROOT/cvswrappers:1.5 CVSROOT/cvswrappers:1.6
--- CVSROOT/cvswrappers:1.5 Sun Jan 12 12:28:30 2003
+++ CVSROOT/cvswrappers Sun Jan 12 12:40:05 2003
@@ -1,5 +1,5 @@
 #
-#ident "@(#)cvs/examples:$Name:  $:$Id: cvswrappers,v 1.5 2003/01/12 17:28:30 goba 
Exp $"
+#ident "@(#)cvs/examples:$Name:  $:$Id: cvswrappers,v 1.6 2003/01/12 17:40:05 goba 
+Exp $"
 #
 # This file describes wrappers and other binary files to CVS.
 #
@@ -33,7 +33,6 @@
 *.png  -k 'b' -m 'COPY'
 *.gz   -k 'b' -m 'COPY'
 *.dsw  -k 'b' -m 'COPY'
-*.dsw  -k 'b' -m 'COPY'
 *.dsp  -k 'b' -m 'COPY'
 *.zip  -k 'b' -m 'COPY'
 *.ide  -k 'b' -m 'COPY'
@@ -52,4 +51,3 @@
 *.chm  -k 'b' -m 'COPY'
 *.tar  -k 'b' -m 'COPY'
 *.bz2  -k 'b' -m 'COPY'
-*.zip  -k 'b' -m 'COPY'



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




Re: [PHP-CVS] cvs: CVSROOT / cvswrappers

2003-01-12 Thread Jon Parise
On Sun, Jan 12, 2003 at 05:40:05PM -, Gabor Hojtsy wrote:

> goba  Sun Jan 12 12:40:05 2003 EDT
> 
>   Modified files:  
> /CVSROOT  cvswrappers 
>   Log:
>   OK, two *.dsw and two *.zip is a bit too much :)
   
.dsw (Visual Studio workspace) files are plain text files.

-- 
Jon Parise ([EMAIL PROTECTED]) :: The PHP Project (http://www.php.net/)

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




[PHP-CVS] cvs: php4 /ext/standard aggregation.c

2003-01-12 Thread Stanislav Malyshev
stasSun Jan 12 13:42:16 2003 EDT

  Modified files:  
/php4/ext/standard  aggregation.c 
  Log:
  ZE2 compatibility
  
  
Index: php4/ext/standard/aggregation.c
diff -u php4/ext/standard/aggregation.c:1.14 php4/ext/standard/aggregation.c:1.15
--- php4/ext/standard/aggregation.c:1.14Sun Jan 12 09:43:04 2003
+++ php4/ext/standard/aggregation.c Sun Jan 12 13:42:16 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: aggregation.c,v 1.14 2003/01/12 14:43:04 stas Exp $ */
+/* $Id: aggregation.c,v 1.15 2003/01/12 18:42:16 stas Exp $ */
 
 #include "php.h"
 #include "basic_functions.h"
@@ -399,10 +399,15 @@
new_ce->clone = Z_OBJCE_P(obj)->clone;
 #endif
new_ce->builtin_functions = Z_OBJCE_P(obj)->builtin_functions;
+#ifndef ZEND_ENGINE_2
new_ce->handle_function_call = Z_OBJCE_P(obj)->handle_function_call;
new_ce->handle_property_get  = Z_OBJCE_P(obj)->handle_property_get;
new_ce->handle_property_set  = Z_OBJCE_P(obj)->handle_property_set;
-
+#else
+   new_ce->__call = Z_OBJCE_P(obj)->__call;
+   new_ce->__get  = Z_OBJCE_P(obj)->__get;
+   new_ce->__set  = Z_OBJCE_P(obj)->__set;
+#endif
/*
 * Okay, that was kind of exhausting. Let's invoke programmer virtue #1
 * and stuff this where it belongs so we don't have to work so hard 
next



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




Re: [PHP-CVS] cvs: php4 /ext/session mod_files.c

2003-01-12 Thread Jani Taskinen

MFH?

--Jani


On Sun, 12 Jan 2003, Sascha Schumann wrote:

>sasSun Jan 12 08:05:33 2003 EDT
>
>  Modified files:  
>/php4/ext/session  mod_files.c 
>  Log:
>  handle ERANGE from strtol properly
>  
>  
>Index: php4/ext/session/mod_files.c
>diff -u php4/ext/session/mod_files.c:1.86 php4/ext/session/mod_files.c:1.87
>--- php4/ext/session/mod_files.c:1.86  Fri Jan  3 09:24:07 2003
>+++ php4/ext/session/mod_files.c   Sun Jan 12 08:05:32 2003
>@@ -16,7 +16,7 @@
>+--+
>  */
> 
>-/* $Id: mod_files.c,v 1.86 2003/01/03 14:24:07 hyanantha Exp $ */
>+/* $Id: mod_files.c,v 1.87 2003/01/12 13:05:32 sas Exp $ */
> 
> #include "php.h"
> 
>@@ -239,7 +239,12 @@
> 
>   data->fd = -1;
>   if ((p = strchr(save_path, ';'))) {
>+  errno = 0;
>   data->dirdepth = (size_t) strtol(save_path, NULL, 10);
>+  if (errno == ERANGE) {
>+  efree(data);
>+  return FAILURE;
>+  }
>   save_path = p + 1;
>   }
>   data->basedir_len = strlen(save_path);
>
>
>
>

-- 
<- For Sale! ->


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




[PHP-CVS] cvs: php4 /ext/standard filters.c

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 16:05:23 2003 EDT

  Modified files:  
/php4/ext/standard  filters.c 
  Log:
  Fixed a bug of the base64 decoder that a sequence of intervening
  characters that are supposed to be ignored by the decoder cause output
  corruption. 
  
  
Index: php4/ext/standard/filters.c
diff -u php4/ext/standard/filters.c:1.12 php4/ext/standard/filters.c:1.13
--- php4/ext/standard/filters.c:1.12Sun Jan 12 08:46:11 2003
+++ php4/ext/standard/filters.c Sun Jan 12 16:05:22 2003
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: filters.c,v 1.12 2003/01/12 13:46:11 moriyoshi Exp $ */
+/* $Id: filters.c,v 1.13 2003/01/12 21:05:22 moriyoshi Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -526,9 +526,6 @@
}
if ((pack_bcnt | ustat) == 0) {
if (ocnt < 1) {
-   urem |= (pack << urem_nbits);
-   urem_nbits += 8;
-
err = PHP_CONV_ERR_TOO_BIG;
break;
}
@@ -537,6 +534,14 @@
pack = 0;
pack_bcnt = nbitsof_pack;
}
+   }
+
+   if (urem_nbits >= pack_bcnt) {
+   urem |= (pack << (urem_nbits - pack_bcnt));
+   urem_nbits += (nbitsof_pack - pack_bcnt);
+   } else {
+   urem |= (pack >> (pack_bcnt - urem_nbits));
+   urem_nbits += (nbitsof_pack - pack_bcnt);
}
 
inst->urem = urem;



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




[PHP-CVS] cvs: php4 /tests/lang bug21600.phpt

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 18:56:04 2003 EDT

  Added files: 
/php4/tests/langbug21600.phpt 
  Log:
  Added test case for bug #21600
  
  

Index: php4/tests/lang/bug21600.phpt
+++ php4/tests/lang/bug21600.phpt
--TEST--
Bug #21600 (assign by reference function call changes variable contents)
--FILE--

--EXPECT--
array(1) {
  ["foo"]=>
  string(4) "test"
}




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




[PHP-CVS] cvs: php4(PHP_4_3) /tests/lang bug21600.phpt

2003-01-12 Thread Moriyoshi Koizumi
moriyoshi   Sun Jan 12 18:57:20 2003 EDT

  Added files: (Branch: PHP_4_3)
/php4/tests/langbug21600.phpt 
  Log:
  MFH
  
  

Index: php4/tests/lang/bug21600.phpt
+++ php4/tests/lang/bug21600.phpt
--TEST--
Bug #21600 (assign by reference function call changes variable contents)
--FILE--

--EXPECT--
array(1) {
  ["foo"]=>
  string(4) "test"
}




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