[PHP-CVS] cvs: php4 /ext/standard basic_functions.c file.c file.h fsock.c fsock.h info.c
wez Tue Apr 17 10:06:07 2001 EDT Modified files: /php4/ext/standard basic_functions.c file.c file.h fsock.c fsock.h info.c Log: Changes for streams. Added temporary fopenstream function to PHP so that the streams can be tested. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.323 php4/ext/standard/basic_functions.c:1.324 --- php4/ext/standard/basic_functions.c:1.323 Sat Apr 7 08:43:06 2001 +++ php4/ext/standard/basic_functions.c Tue Apr 17 10:06:06 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.323 2001/04/07 15:43:06 andre Exp $ */ +/* $Id: basic_functions.c,v 1.324 2001/04/17 17:06:06 wez Exp $ */ #include "php.h" #include "php_main.h" @@ -430,6 +430,9 @@ use socket_set_blocking() instead */ PHP_FE(set_socket_blocking, NULL) PHP_FE(socket_set_blocking, NULL) +#if HAVE_PHP_STREAM + PHP_FE(fopenstream, NULL) +#endif #if HAVE_SYS_TIME_H PHP_FE(socket_set_timeout, NULL) #else @@ -2491,11 +2494,11 @@ if (!zend_hash_exists(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1)) { RETURN_FALSE; } - + if (PG(safe_mode) (!php_checkuid(Z_STRVAL_PP(new_path), NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } - + V_UNLINK(Z_STRVAL_PP(new_path)); if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==0) { successful=1; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.152 php4/ext/standard/file.c:1.153 --- php4/ext/standard/file.c:1.152 Sun Apr 15 12:03:12 2001 +++ php4/ext/standard/file.cTue Apr 17 10:06:06 2001 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: file.c,v 1.152 2001/04/15 19:03:12 sasha Exp $ */ +/* $Id: file.c,v 1.153 2001/04/17 17:06:06 wez Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -101,7 +101,10 @@ /* {{{ ZTS-stuff / Globals / Prototypes */ /* sharing globals is *evil* */ -static int le_fopen, le_popen, le_socket; +static int le_fopen, le_popen, le_socket; +/* sorry folks; including this even if you haven't enabled streams + saves a zillion ifdefs */ +static int le_stream = FAILURE; /* }}} */ @@ -116,7 +119,7 @@ } -static void _file_socket_dtor(zend_rsrc_list_entry *rsrc) +static void _file_socket_dtor(zend_rsrc_list_entry *rsrc) { int *sock = (int *)rsrc-ptr; SOCK_FCLOSE(*sock); @@ -126,8 +129,15 @@ efree(sock); } +#if HAVE_PHP_STREAM +static void _file_stream_dtor(zend_rsrc_list_entry * rsrc) +{ + php_stream * stream = (php_stream*)rsrc-ptr; + php_stream_close(stream); +} +#endif -static void _file_fopen_dtor(zend_rsrc_list_entry *rsrc) +static void _file_fopen_dtor(zend_rsrc_list_entry *rsrc) { FILE *fp = (FILE *)rsrc-ptr; fclose(fp); @@ -176,6 +186,10 @@ le_popen = zend_register_list_destructors_ex(_file_popen_dtor, NULL, "pipe", module_number); le_socket = zend_register_list_destructors_ex(_file_socket_dtor, NULL, "socket", module_number); +#if HAVE_PHP_STREAM + le_stream = zend_register_list_destructors_ex(_file_stream_dtor, NULL, +"stream", module_number); +#endif + #ifdef ZTS file_globals_id = ts_allocate_id(sizeof(php_file_globals), (ts_allocate_ctor) file_globals_ctor, (ts_allocate_dtor) file_globals_dtor); #else @@ -217,20 +231,27 @@ pval **arg1, **arg2, **arg3; int type, fd, act, ret, arg_count = ARG_COUNT(ht); void *what; - + if (arg_count 3 || zend_get_parameters_ex(arg_count, arg1, arg2, arg3) == FAILURE) { WRONG_PARAM_COUNT; } - - what = zend_fetch_resource(arg1,-1,"File-Handle",type,3,le_fopen,le_popen,le_socket); + + what = zend_fetch_resource(arg1, -1, "File-Handle", type, 4, le_fopen, +le_popen, le_socket, le_stream); ZEND_VERIFY_RESOURCE(what); - + +#if HAVE_PHP_STREAM + if (type == le_stream) { + if (php_stream_cast((php_stream*)what, PHP_STREAM_AS_FD, (void*)fd, +1) == FAILURE) { + RETURN_FALSE; + } + } else +#endif if (type == le_socket) { fd = *(int *) what; } else { fd = fileno((FILE*) what); } - + convert_to_long_ex(arg2); act = (*arg2)-value.lval 3; @@ -271,7 +292,7 @@ char *token_data=NULL, *name=NULL, *value=NULL, *temp=NULL; php_meta_tags_token tok, tok_last; PLS_FETCH(); - + /* check args */ switch (ARG_COUNT(ht)) { case 1: @@ -290,7 +311,7 @@ WRONG_PARAM_COUNT; } convert_to_string_ex(filename); - +
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c file.c
wez Tue Apr 17 10:08:04 2001 EDT Modified files: /php4/ext/standard basic_functions.c file.c Log: Discovered warn_not_available and used it. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.324 php4/ext/standard/basic_functions.c:1.325 --- php4/ext/standard/basic_functions.c:1.324 Tue Apr 17 10:06:06 2001 +++ php4/ext/standard/basic_functions.c Tue Apr 17 10:08:03 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.324 2001/04/17 17:06:06 wez Exp $ */ +/* $Id: basic_functions.c,v 1.325 2001/04/17 17:08:03 wez Exp $ */ #include "php.h" #include "php_main.h" @@ -432,6 +432,8 @@ PHP_FE(socket_set_blocking, NULL) #if HAVE_PHP_STREAM PHP_FE(fopenstream, NULL) +#else + PHP_FALIAS(fopenstream, warn_not_available, NULL) #endif #if HAVE_SYS_TIME_H PHP_FE(socket_set_timeout, NULL) Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.153 php4/ext/standard/file.c:1.154 --- php4/ext/standard/file.c:1.153 Tue Apr 17 10:06:06 2001 +++ php4/ext/standard/file.cTue Apr 17 10:08:03 2001 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: file.c,v 1.153 2001/04/17 17:06:06 wez Exp $ */ +/* $Id: file.c,v 1.154 2001/04/17 17:08:03 wez Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -576,9 +576,9 @@ } /* }}} */ +#if HAVE_PHP_STREAM PHP_FUNCTION(fopenstream) { -#if HAVE_PHP_STREAM zval ** zfilename, ** zmode; php_stream * stream; @@ -595,11 +595,8 @@ RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, stream, le_stream); -#else - zend_error(E_ERROR, "%s(): no stream support in this PHP build", get_active_function_name()); - RETURN_FALSE; -#endif } +#endif /* {{{ proto int fopen(string filename, string mode [, int use_include_path]) Open a file or a URL and return a file pointer */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c file.c
romolo Fri Mar 23 01:30:51 2001 EDT Modified files: /php4/ext/standard basic_functions.c file.c Log: Added target ownership check in function copy for safe_mode operations Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.320 php4/ext/standard/basic_functions.c:1.321 --- php4/ext/standard/basic_functions.c:1.320 Thu Mar 22 06:43:48 2001 +++ php4/ext/standard/basic_functions.c Fri Mar 23 01:30:51 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.320 2001/03/22 14:43:48 elixer Exp $ */ +/* $Id: basic_functions.c,v 1.321 2001/03/23 09:30:51 romolo Exp $ */ #include "php.h" #include "php_main.h" @@ -2490,7 +2490,11 @@ if (!zend_hash_exists(SG(rfc1867_uploaded_files), Z_STRVAL_PP(path), Z_STRLEN_PP(path)+1)) { RETURN_FALSE; } - + + if (PG(safe_mode) (!php_checkuid(Z_STRVAL_PP(new_path), NULL, +CHECKUID_CHECK_FILE_AND_DIR))) { + RETURN_FALSE; + } + V_UNLINK(Z_STRVAL_PP(new_path)); if (rename(Z_STRVAL_PP(path), Z_STRVAL_PP(new_path))==0) { successful=1; Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.148 php4/ext/standard/file.c:1.149 --- php4/ext/standard/file.c:1.148 Sun Mar 11 02:08:27 2001 +++ php4/ext/standard/file.cFri Mar 23 01:30:51 2001 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: file.c,v 1.148 2001/03/11 10:08:27 sasha Exp $ */ +/* $Id: file.c,v 1.149 2001/03/23 09:30:51 romolo Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1691,7 +1691,7 @@ { pval **source, **target; PLS_FETCH(); - + if (ARG_COUNT(ht) != 2 || zend_get_parameters_ex(2, source, target) == FAILURE) { WRONG_PARAM_COUNT; } @@ -1702,7 +1702,11 @@ if (PG(safe_mode) (!php_checkuid((*source)-value.str.val, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } - + + if (PG(safe_mode) (!php_checkuid((*target)-value.str.val, NULL, +CHECKUID_CHECK_FILE_AND_DIR))) { + RETURN_FALSE; + } + if (php_copy_file(Z_STRVAL_PP(source), Z_STRVAL_PP(target))==SUCCESS) { RETURN_TRUE; } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
sas Fri Mar 23 17:08:14 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Fix ZTS build Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.321 php4/ext/standard/basic_functions.c:1.322 --- php4/ext/standard/basic_functions.c:1.321 Fri Mar 23 01:30:51 2001 +++ php4/ext/standard/basic_functions.c Fri Mar 23 17:08:13 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.321 2001/03/23 09:30:51 romolo Exp $ */ +/* $Id: basic_functions.c,v 1.322 2001/03/24 01:08:13 sas Exp $ */ #include "php.h" #include "php_main.h" @@ -2476,6 +2476,7 @@ zval **path, **new_path; zend_bool successful=0; SLS_FETCH(); + PLS_FETCH(); if (!SG(rfc1867_uploaded_files)) { RETURN_FALSE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
elixer Thu Mar 22 06:43:50 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Fixed prototype. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.319 php4/ext/standard/basic_functions.c:1.320 --- php4/ext/standard/basic_functions.c:1.319 Wed Mar 21 05:53:38 2001 +++ php4/ext/standard/basic_functions.c Thu Mar 22 06:43:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.319 2001/03/21 13:53:38 elixer Exp $ */ +/* $Id: basic_functions.c,v 1.320 2001/03/22 14:43:48 elixer Exp $ */ #include "php.h" #include "php_main.h" @@ -919,7 +919,7 @@ /* }}} */ -/* {{{ proto int ip2long(string ip_address) +/* {{{ proto string ip2long(string ip_address) Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */ PHP_FUNCTION(ip2long) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
elixer Wed Mar 21 05:53:39 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Fix for bug #9698. # Anyone that can think of a way to fix long2ip(), feel free. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.318 php4/ext/standard/basic_functions.c:1.319 --- php4/ext/standard/basic_functions.c:1.318 Mon Mar 19 13:20:02 2001 +++ php4/ext/standard/basic_functions.c Wed Mar 21 05:53:38 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.318 2001/03/19 21:20:02 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.319 2001/03/21 13:53:38 elixer Exp $ */ #include "php.h" #include "php_main.h" @@ -924,6 +924,7 @@ PHP_FUNCTION(ip2long) { zval **str; + char tmp_buff[16]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, str) == FAILURE) { WRONG_PARAM_COUNT; @@ -931,7 +932,9 @@ convert_to_string_ex(str); - RETURN_LONG(ntohl(inet_addr(Z_STRVAL_PP(str; + sprintf(tmp_buff, "%u", ntohl(inet_addr(Z_STRVAL_PP(str; + + RETURN_STRING(tmp_buff,1); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c
SB Fix for bug #9698. SB # Anyone that can think of a way to fix long2ip(), feel free. I don't think there's any good way to fix this - PHP "long" value is signed long, and it cannot hold unsigned long. -- Stanislav Malyshev, Zend Products Engineer [EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.115 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c
How do I merge these changes into the RC2 branch? ""Sean Bright"" [EMAIL PROTECTED] wrote in message news:cvselixer985182819@cvsserver... elixerWed Mar 21 05:53:39 2001 EDT Modified files: /php4/ext/standardbasic_functions.c Log: Fix for bug #9698. # Anyone that can think of a way to fix long2ip(), feel free. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.318 php4/ext/standard/basic_functions.c:1.319 --- php4/ext/standard/basic_functions.c:1.318 Mon Mar 19 13:20:02 2001 +++ php4/ext/standard/basic_functions.c Wed Mar 21 05:53:38 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.318 2001/03/19 21:20:02 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.319 2001/03/21 13:53:38 elixer Exp $ */ #include "php.h" #include "php_main.h" @@ -924,6 +924,7 @@ PHP_FUNCTION(ip2long) { zval **str; + char tmp_buff[16]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, str) == FAILURE) { WRONG_PARAM_COUNT; @@ -931,7 +932,9 @@ convert_to_string_ex(str); - RETURN_LONG(ntohl(inet_addr(Z_STRVAL_PP(str; + sprintf(tmp_buff, "%u", ntohl(inet_addr(Z_STRVAL_PP(str; + + RETURN_STRING(tmp_buff,1); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c
On Wed, 21 Mar 2001, Bright, Sean wrote: How do I merge these changes into the RC2 branch? Please DON'T. Only well-tested fixes for _critical_ bugs should be merged automatically. - Sascha Experience IRCG http://schumann.cx/http://schumann.cx/ircg -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
sniper Fri Mar 16 10:18:02 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: This has got to be the last one.. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.315 php4/ext/standard/basic_functions.c:1.316 --- php4/ext/standard/basic_functions.c:1.315 Sun Mar 11 19:06:53 2001 +++ php4/ext/standard/basic_functions.c Fri Mar 16 10:18:01 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.315 2001/03/12 03:06:53 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.316 2001/03/16 18:18:01 sniper Exp $ */ #include "php.h" #include "php_main.h" @@ -247,7 +247,7 @@ PHP_FE(gethostbyaddr, NULL) PHP_FE(gethostbyname, NULL) PHP_FE(gethostbynamel, NULL) -#if HAVE_LIBBIND !(defined(__BEOS__)||defined(PHP_WIN32)) +#if HAVE_RES_SEARCH !(defined(__BEOS__)||defined(PHP_WIN32)) PHP_FE(checkdnsrr, NULL) PHP_FE(getmxrr, second_and_third_args_force_ref) #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c dns.c dns.h /main config.w32.h
sniper Sat Mar 10 19:49:21 2001 EDT Modified files: /php4/ext/standard basic_functions.c dns.c dns.h /php4/main config.w32.h Log: HAVE_BINDLIB -- HAVE_LIBBIND Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.313 php4/ext/standard/basic_functions.c:1.314 --- php4/ext/standard/basic_functions.c:1.313 Fri Mar 9 13:42:26 2001 +++ php4/ext/standard/basic_functions.c Sat Mar 10 19:49:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.313 2001/03/09 21:42:26 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.314 2001/03/11 03:49:21 sniper Exp $ */ #include "php.h" #include "php_main.h" @@ -247,7 +247,7 @@ PHP_FE(gethostbyaddr, NULL) PHP_FE(gethostbyname, NULL) PHP_FE(gethostbynamel, NULL) -#if HAVE_BINDLIB !(defined(__BEOS__)||defined(PHP_WIN32)) +#if HAVE_LIBBIND !(defined(__BEOS__)||defined(PHP_WIN32)) PHP_FE(checkdnsrr, NULL) PHP_FE(getmxrr, second_and_third_args_force_ref) #else Index: php4/ext/standard/dns.c diff -u php4/ext/standard/dns.c:1.26 php4/ext/standard/dns.c:1.27 --- php4/ext/standard/dns.c:1.26Sun Feb 25 22:07:17 2001 +++ php4/ext/standard/dns.c Sat Mar 10 19:49:21 2001 @@ -16,14 +16,14 @@ +--+ */ -/* $Id: dns.c,v 1.26 2001/02/26 06:07:17 andi Exp $ */ +/* $Id: dns.c,v 1.27 2001/03/11 03:49:21 sniper Exp $ */ #include "php.h" #if HAVE_SYS_SOCKET_H #include sys/socket.h #endif #ifdef PHP_WIN32 -#if HAVE_BINDLIB +#if HAVE_LIBBIND #ifndef WINNT #define WINNT 1 #endif @@ -167,7 +167,7 @@ return estrdup(inet_ntoa(in)); } -#if HAVE_BINDLIB !(defined(__BEOS__)||defined(PHP_WIN32)) +#if HAVE_LIBBIND !(defined(__BEOS__)||defined(PHP_WIN32)) /* {{{ proto int checkdnsrr(string host [, string type]) Check DNS records corresponding to a given Internet host name or IP address */ Index: php4/ext/standard/dns.h diff -u php4/ext/standard/dns.h:1.7 php4/ext/standard/dns.h:1.8 --- php4/ext/standard/dns.h:1.7 Sun Feb 25 22:07:17 2001 +++ php4/ext/standard/dns.h Sat Mar 10 19:49:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dns.h,v 1.7 2001/02/26 06:07:17 andi Exp $ */ +/* $Id: dns.h,v 1.8 2001/03/11 03:49:21 sniper Exp $ */ #ifndef DNS_H #define DNS_H @@ -25,7 +25,7 @@ PHP_FUNCTION(gethostbyaddr); PHP_FUNCTION(gethostbyname); PHP_FUNCTION(gethostbynamel); -#if !defined(PHP_WIN32)||(HAVE_BINDLIB) +#if !defined(PHP_WIN32)||(HAVE_LIBBIND) PHP_FUNCTION(checkdnsrr); PHP_FUNCTION(getmxrr); #endif Index: php4/main/config.w32.h diff -u php4/main/config.w32.h:1.39 php4/main/config.w32.h:1.40 --- php4/main/config.w32.h:1.39 Sun Jan 14 08:36:30 2001 +++ php4/main/config.w32.h Sat Mar 10 19:49:21 2001 @@ -10,7 +10,7 @@ lib33bsd95.lib to the project settings, and add the path to the bind include directory to the preprocessor settings. These libs are availabe in the ntbind distribution */ -#define HAVE_BINDLIB 1 +#define HAVE_LIBBIND 1 /* set to enable bcmath */ #define WITH_BCMATH 1 @@ -231,7 +231,7 @@ #define HAVE_LOCALE_H 1 /* Define if you have the setvbuf function. */ -#ifndef HAVE_BINDLIB +#ifndef HAVE_LIBBIND #define HAVE_SETVBUF 1 #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
andrei Fri Mar 9 13:42:27 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: @- Fixed argument checking for call_user_func* functions and allowed @ specifying array($obj, 'method') syntax for call_user_func_array. (Andrei) Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.312 php4/ext/standard/basic_functions.c:1.313 --- php4/ext/standard/basic_functions.c:1.312 Sat Mar 3 17:17:21 2001 +++ php4/ext/standard/basic_functions.c Fri Mar 9 13:42:26 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.312 2001/03/04 01:17:21 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.313 2001/03/09 21:42:26 andrei Exp $ */ #include "php.h" #include "php_main.h" @@ -1597,12 +1597,17 @@ efree(params); RETURN_FALSE; } - SEPARATE_ZVAL(params[0]); + + if (Z_TYPE_PP(params[0]) != IS_STRING Z_TYPE_PP(params[0]) != IS_ARRAY) { + SEPARATE_ZVAL(params[0]); + convert_to_string_ex(params[0]); + } + if (call_user_function_ex(CG(function_table), NULL, *params[0], retval_ptr, arg_count-1, params+1, 1, NULL)==SUCCESS retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { - php_error(E_WARNING,"Unable to call %s() - function does not exist", Z_STRVAL_PP(params[0])); + php_error(E_WARNING,"Unable to call %s() - function does not exist", +Z_TYPE_PP(params[0]) == IS_STRING ? Z_STRVAL_PP(params[0]) : ""); } efree(params); } @@ -1625,9 +1630,14 @@ zend_get_parameters_ex(2, func_name, params) == FAILURE) { WRONG_PARAM_COUNT; } -convert_to_string_ex(func_name); + SEPARATE_ZVAL(params); convert_to_array_ex(params); + if (Z_TYPE_PP(func_name) != IS_STRING Z_TYPE_PP(func_name) != IS_ARRAY) { + SEPARATE_ZVAL(func_name); + convert_to_string_ex(func_name); + } + params_ar = HASH_OF(*params); num_elems = zend_hash_num_elements(params_ar); @@ -1643,7 +1653,7 @@ retval_ptr) { COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr); } else { -php_error(E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_PP(func_name)); +php_error(E_WARNING, "Unable to call %s() - function does not exist", +Z_TYPE_PP(func_name) == IS_STRING ? Z_STRVAL_PP(func_name) : ""); } efree(func_args); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h
zeevSat Mar 3 17:17:22 2001 EDT Modified files: /php4/ext/standard basic_functions.c basic_functions.h Log: this function will never return true... Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.311 php4/ext/standard/basic_functions.c:1.312 --- php4/ext/standard/basic_functions.c:1.311 Fri Mar 2 12:22:14 2001 +++ php4/ext/standard/basic_functions.c Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.311 2001/03/02 20:22:14 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.312 2001/03/04 01:17:21 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -368,7 +368,6 @@ PHP_FE(headers_sent,NULL) PHP_FE(connection_aborted, NULL) - PHP_FE(connection_timeout, NULL) PHP_FE(connection_status, NULL) PHP_FE(ignore_user_abort, NULL) @@ -2148,16 +2147,6 @@ PLS_FETCH(); RETURN_LONG(PG(connection_status)PHP_CONNECTION_ABORTED); -} -/* }}} */ - -/* {{{ proto int connection_timeout(void) - Returns true if script timed out */ -PHP_FUNCTION(connection_timeout) -{ - PLS_FETCH(); - -RETURN_LONG(PG(connection_status)PHP_CONNECTION_TIMEOUT); } /* }}} */ Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.74 php4/ext/standard/basic_functions.h:1.75 --- php4/ext/standard/basic_functions.h:1.74Sun Feb 25 22:07:16 2001 +++ php4/ext/standard/basic_functions.h Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.h,v 1.74 2001/02/26 06:07:16 andi Exp $ */ +/* $Id: basic_functions.h,v 1.75 2001/03/04 01:17:21 zeev Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -97,7 +97,6 @@ PHP_FUNCTION(print_r); PHP_FUNCTION(connection_aborted); -PHP_FUNCTION(connection_timeout); PHP_FUNCTION(connection_status); PHP_FUNCTION(ignore_user_abort); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h
Am I right that your removing this function? uu, backwards compat?? ;-) -Sterling zeev Sat Mar 3 17:17:22 2001 EDT Modified files: /php4/ext/standard basic_functions.c basic_functions.h Log: this function will never return true... Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.311 php4/ext/standard/basic_functions.c:1.312 --- php4/ext/standard/basic_functions.c:1.311 Fri Mar 2 12:22:14 2001 +++ php4/ext/standard/basic_functions.c Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.311 2001/03/02 20:22:14 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.312 2001/03/04 01:17:21 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -368,7 +368,6 @@ PHP_FE(headers_sent, NULL) PHP_FE(connection_aborted, NULL) - PHP_FE(connection_timeout, NULL) PHP_FE(connection_status, NULL) PHP_FE(ignore_user_abort, NULL) @@ -2148,16 +2147,6 @@ PLS_FETCH(); RETURN_LONG(PG(connection_status)PHP_CONNECTION_ABORTED); -} -/* }}} */ - -/* {{{ proto int connection_timeout(void) - Returns true if script timed out */ -PHP_FUNCTION(connection_timeout) -{ - PLS_FETCH(); - -RETURN_LONG(PG(connection_status)PHP_CONNECTION_TIMEOUT); } /* }}} */ Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.74 php4/ext/standard/basic_functions.h:1.75 --- php4/ext/standard/basic_functions.h:1.74 Sun Feb 25 22:07:16 2001 +++ php4/ext/standard/basic_functions.h Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.h,v 1.74 2001/02/26 06:07:16 andi Exp $ */ +/* $Id: basic_functions.h,v 1.75 2001/03/04 01:17:21 zeev Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -97,7 +97,6 @@ PHP_FUNCTION(print_r); PHP_FUNCTION(connection_aborted); -PHP_FUNCTION(connection_timeout); PHP_FUNCTION(connection_status); PHP_FUNCTION(ignore_user_abort); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c basic_functions.h
Heh, well, if everyone has any logic relying on this function, they should know that it's faulty :) At 03:25 4/3/2001, Sterling Hughes wrote: Am I right that your removing this function? uu, backwards compat?? ;-) -Sterling zeev Sat Mar 3 17:17:22 2001 EDT Modified files: /php4/ext/standard basic_functions.c basic_functions.h Log: this function will never return true... Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.311 php4/ext/standard/basic_functions.c:1.312 --- php4/ext/standard/basic_functions.c:1.311 Fri Mar 2 12:22:14 2001 +++ php4/ext/standard/basic_functions.c Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.311 2001/03/02 20:22:14 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.312 2001/03/04 01:17:21 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -368,7 +368,6 @@ PHP_FE(headers_sent, NULL) PHP_FE(connection_aborted, NULL) - PHP_FE(connection_timeout, NULL) PHP_FE(connection_status, NULL) PHP_FE(ignore_user_abort, NULL) @@ -2148,16 +2147,6 @@ PLS_FETCH(); RETURN_LONG(PG(connection_status)PHP_CONNECTION_ABORTED); -} -/* }}} */ - -/* {{{ proto int connection_timeout(void) - Returns true if script timed out */ -PHP_FUNCTION(connection_timeout) -{ - PLS_FETCH(); - -RETURN_LONG(PG(connection_status)PHP_CONNECTION_TIMEOUT); } /* }}} */ Index: php4/ext/standard/basic_functions.h diff -u php4/ext/standard/basic_functions.h:1.74 php4/ext/standard/basic_functions.h:1.75 --- php4/ext/standard/basic_functions.h:1.74 Sun Feb 25 22:07:16 2001 +++ php4/ext/standard/basic_functions.h Sat Mar 3 17:17:21 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.h,v 1.74 2001/02/26 06:07:16 andi Exp $ */ +/* $Id: basic_functions.h,v 1.75 2001/03/04 01:17:21 zeev Exp $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -97,7 +97,6 @@ PHP_FUNCTION(print_r); PHP_FUNCTION(connection_aborted); -PHP_FUNCTION(connection_timeout); PHP_FUNCTION(connection_status); PHP_FUNCTION(ignore_user_abort); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
andrei Fri Mar 2 12:22:14 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: @- Forced call_user_method() and call_user_method_array() to take the @ object argument by reference. (Andrei) * Forced call_user_method() and call_user_method_array() to take the object argument by reference. * Also cleaned up the protos for those functions and brought call_user_method_array() into functional equivalence with call_user_method(). Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.310 php4/ext/standard/basic_functions.c:1.311 --- php4/ext/standard/basic_functions.c:1.310 Mon Feb 26 12:26:07 2001 +++ php4/ext/standard/basic_functions.c Fri Mar 2 12:22:14 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.310 2001/02/26 20:26:07 sas Exp $ */ +/* $Id: basic_functions.c,v 1.311 2001/03/02 20:22:14 andrei Exp $ */ #include "php.h" #include "php_main.h" @@ -340,8 +340,8 @@ PHP_FE(error_log, NULL) PHP_FE(call_user_func, NULL) PHP_FE(call_user_func_array,NULL) - PHP_FE(call_user_method,NULL) - PHP_FE(call_user_method_array, NULL) + PHP_FE(call_user_method, +second_arg_force_ref) + PHP_FE(call_user_method_array, second_arg_force_ref) PHP_FE(var_dump, NULL) PHP_FE(serialize, first_arg_allow_ref) @@ -1651,8 +1651,8 @@ } /* }}} */ -/* {{{ proto mixed call_user_method(string method_name, object object [, mixed parameter] [, mixed ...]) - Call a user method, on a specific object where the first argument is the method name, the second argument is the object and the subsequent arguments are the parameters */ +/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed +parameter] [, mixed ...]) + Call a user method on a specific object or class */ PHP_FUNCTION(call_user_method) { pval ***params; @@ -1675,7 +1675,6 @@ RETURN_FALSE; } SEPARATE_ZVAL(params[0]); - SEPARATE_ZVAL(params[1]); convert_to_string(*params[0]); if (call_user_function_ex(CG(function_table), params[1], *params[0], retval_ptr, arg_count-2, params+2, 1, NULL)==SUCCESS retval_ptr) { @@ -1687,8 +1686,8 @@ } /* }}} */ -/* {{{ proto mixed call_user_method_array(object obj, string methodname, array params) - Call a user method using a parameter array */ +/* {{{ proto mixed call_user_method_array(string method_name, mixed object, array +params) + Call a user method on a specific object or class using a parameter array */ PHP_FUNCTION(call_user_method_array) { zval **method_name, @@ -1705,9 +1704,15 @@ zend_get_parameters_ex(3, method_name, obj, params) == FAILURE) { WRONG_PARAM_COUNT; } + + if (Z_TYPE_PP(obj) != IS_OBJECT Z_TYPE_PP(obj) != IS_STRING) { + php_error(E_WARNING,"2nd argument is not an object or class name\n"); + RETURN_FALSE; + } + + SEPARATE_ZVAL(method_name); + SEPARATE_ZVAL(params); convert_to_string_ex(method_name); - if (Z_TYPE_PP(obj) != IS_OBJECT Z_TYPE_PP(obj) != IS_STRING) - convert_to_object_ex(obj); convert_to_array_ex(params); params_ar = HASH_OF(*params); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
sas Mon Feb 26 12:26:07 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Provide proper function aliases, if the sendmail functions don't exist. Submitted by: Nadir Amra [EMAIL PROTECTED] Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.309 php4/ext/standard/basic_functions.c:1.310 --- php4/ext/standard/basic_functions.c:1.309 Sun Feb 25 22:07:16 2001 +++ php4/ext/standard/basic_functions.c Mon Feb 26 12:26:07 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.309 2001/02/26 06:07:16 andi Exp $ */ +/* $Id: basic_functions.c,v 1.310 2001/02/26 20:26:07 sas Exp $ */ #include "php.h" #include "php_main.h" @@ -503,8 +503,13 @@ PHP_FE(diskfreespace, NULL) /* functions from mail.c */ +#ifdef HAVE_SENDMAIL PHP_FE(mail,NULL) PHP_FE(ezmlm_hash, NULL) +#else + PHP_FALIAS(mail,warn_not_available, NULL) + PHP_FALIAS(ezmlm_hash, warn_not_available, NULL) +#endif /* functions from syslog.c */ #ifdef HAVE_SYSLOG_H -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c php_ext_syslog.h syslog.c /main php_syslog.h
sas Sat Feb 24 13:08:15 2001 EDT Modified files: /php4/ext/standard basic_functions.c php_ext_syslog.h syslog.c /php4/main php_syslog.h Log: Actually compile on systems without syslog. PR: #9412 Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.307 php4/ext/standard/basic_functions.c:1.308 --- php4/ext/standard/basic_functions.c:1.307 Tue Feb 20 06:23:03 2001 +++ php4/ext/standard/basic_functions.c Sat Feb 24 13:08:15 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.307 2001/02/20 14:23:03 andrei Exp $ */ +/* $Id: basic_functions.c,v 1.308 2001/02/24 21:08:15 sas Exp $ */ #include "php.h" #include "php_main.h" @@ -507,10 +507,12 @@ PHP_FE(ezmlm_hash, NULL) /* functions from syslog.c */ +#ifdef HAVE_SYSLOG_H PHP_FE(openlog, NULL) PHP_FE(syslog, NULL) PHP_FE(closelog,NULL) PHP_FE(define_syslog_variables, NULL) +#endif /* functions from lcg.c */ PHP_FE(lcg_value, NULL) Index: php4/ext/standard/php_ext_syslog.h diff -u php4/ext/standard/php_ext_syslog.h:1.3 php4/ext/standard/php_ext_syslog.h:1.4 --- php4/ext/standard/php_ext_syslog.h:1.3 Sun Jul 23 18:39:49 2000 +++ php4/ext/standard/php_ext_syslog.h Sat Feb 24 13:08:15 2001 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ext_syslog.h,v 1.3 2000/07/24 01:39:49 david Exp $ */ +/* $Id: php_ext_syslog.h,v 1.4 2001/02/24 21:08:15 sas Exp $ */ #ifndef PHP_EXT_SYSLOG_H #define PHP_EXT_SYSLOG_H @@ -25,9 +25,9 @@ #include "php_syslog.h" -extern PHP_MINIT_FUNCTION(syslog); -extern PHP_RINIT_FUNCTION(syslog); -extern PHP_RSHUTDOWN_FUNCTION(syslog); +PHP_MINIT_FUNCTION(syslog); +PHP_RINIT_FUNCTION(syslog); +PHP_RSHUTDOWN_FUNCTION(syslog); PHP_FUNCTION(openlog); PHP_FUNCTION(syslog); Index: php4/ext/standard/syslog.c diff -u php4/ext/standard/syslog.c:1.24 php4/ext/standard/syslog.c:1.25 --- php4/ext/standard/syslog.c:1.24 Sun Jan 21 09:26:43 2001 +++ php4/ext/standard/syslog.c Sat Feb 24 13:08:15 2001 @@ -16,9 +16,11 @@ +--+ */ -/* $Id: syslog.c,v 1.24 2001/01/21 17:26:43 rasmus Exp $ */ +/* $Id: syslog.c,v 1.25 2001/02/24 21:08:15 sas Exp $ */ #include "php.h" + +#ifdef HAVE_SYSLOG_H #include "php_ini.h" #include "zend_globals.h" @@ -261,6 +263,8 @@ RETURN_TRUE; } /* }}} */ + +#endif /* * Local variables: Index: php4/main/php_syslog.h diff -u php4/main/php_syslog.h:1.4 php4/main/php_syslog.h:1.5 --- php4/main/php_syslog.h:1.4 Fri Jun 9 10:21:40 2000 +++ php4/main/php_syslog.h Sat Feb 24 13:08:15 2001 @@ -4,7 +4,10 @@ #ifdef PHP_WIN32 #include "win32/syslog.h" #else +#include "php_config.h" +#ifdef HAVE_SYSLOG_H #include syslog.h +#endif #endif /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c dir.c php_dir.h
derick Wed Feb 14 02:48:49 2001 EDT Modified files: /php4/ext/standard basic_functions.c dir.c php_dir.h Log: - Added the chroot function for changing root in a script. #- This can be usefull when using PHP in a shell environment, or when PHP # runs as CGI which needs a little more security Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.302 php4/ext/standard/basic_functions.c:1.303 --- php4/ext/standard/basic_functions.c:1.302 Mon Feb 5 13:59:16 2001 +++ php4/ext/standard/basic_functions.c Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.302 2001/02/05 21:59:16 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.303 2001/02/14 10:48:48 derick Exp $ */ #include "php.h" #include "php_main.h" @@ -465,6 +465,7 @@ PHP_FE(opendir, NULL) PHP_FE(closedir,NULL) PHP_FE(chdir, NULL) + PHP_FE(chroot, NULL) PHP_FE(getcwd, NULL) PHP_FE(rewinddir, NULL) PHP_STATIC_FE("readdir", php_if_readdir, NULL) Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.52 php4/ext/standard/dir.c:1.53 --- php4/ext/standard/dir.c:1.52Sat Dec 16 12:52:43 2000 +++ php4/ext/standard/dir.c Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dir.c,v 1.52 2000/12/16 20:52:43 andi Exp $ */ +/* $Id: dir.c,v 1.53 2001/02/14 10:48:48 derick Exp $ */ /* {{{ includes/startup/misc */ @@ -219,6 +219,30 @@ if (dirp-id == DIRG(default_dir)) { php_set_default_dir(-1 DIRLS_CC); } +} + +/* }}} */ +/* {{{ proto int chroot(string directory) + Change root directory */ + +PHP_FUNCTION(chroot) +{ + pval **arg; + int ret; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) { + WRONG_PARAM_COUNT; + } + convert_to_string_ex(arg); + + ret = chroot((*arg)-value.str.val); + + if (ret != 0) { + php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno); + RETURN_FALSE; + } + + RETURN_TRUE; } /* }}} */ Index: php4/ext/standard/php_dir.h diff -u php4/ext/standard/php_dir.h:1.11 php4/ext/standard/php_dir.h:1.12 --- php4/ext/standard/php_dir.h:1.11Thu Dec 7 04:09:38 2000 +++ php4/ext/standard/php_dir.h Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_dir.h,v 1.11 2000/12/07 12:09:38 sas Exp $ */ +/* $Id: php_dir.h,v 1.12 2001/02/14 10:48:48 derick Exp $ */ #ifndef PHP_DIR_H #define PHP_DIR_H @@ -28,6 +28,7 @@ PHP_FUNCTION(opendir); PHP_FUNCTION(closedir); PHP_FUNCTION(chdir); +PHP_FUNCTION(chroot); PHP_FUNCTION(getcwd); PHP_FUNCTION(rewinddir); PHP_NAMED_FUNCTION(php_if_readdir); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/standard basic_functions.c dir.c php_dir.h
Derick, You should not enable this function if ZEND_WIN32 is defined or ZTS=1 (Thread Safety). Andi At 10:48 AM 2/14/2001 +, Derick Rethans wrote: derick Wed Feb 14 02:48:49 2001 EDT Modified files: /php4/ext/standard basic_functions.c dir.c php_dir.h Log: - Added the chroot function for changing root in a script. #- This can be usefull when using PHP in a shell environment, or when PHP # runs as CGI which needs a little more security Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.302 php4/ext/standard/basic_functions.c:1.303 --- php4/ext/standard/basic_functions.c:1.302 Mon Feb 5 13:59:16 2001 +++ php4/ext/standard/basic_functions.c Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.302 2001/02/05 21:59:16 zeev Exp $ */ +/* $Id: basic_functions.c,v 1.303 2001/02/14 10:48:48 derick Exp $ */ #include "php.h" #include "php_main.h" @@ -465,6 +465,7 @@ PHP_FE(opendir, NULL) PHP_FE(closedir,NULL) PHP_FE(chdir, NULL) + PHP_FE(chroot, NULL) PHP_FE(getcwd, NULL) PHP_FE(rewinddir, NULL) PHP_STATIC_FE("readdir", php_if_readdir, NULL) Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.52 php4/ext/standard/dir.c:1.53 --- php4/ext/standard/dir.c:1.52Sat Dec 16 12:52:43 2000 +++ php4/ext/standard/dir.c Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: dir.c,v 1.52 2000/12/16 20:52:43 andi Exp $ */ +/* $Id: dir.c,v 1.53 2001/02/14 10:48:48 derick Exp $ */ /* {{{ includes/startup/misc */ @@ -219,6 +219,30 @@ if (dirp-id == DIRG(default_dir)) { php_set_default_dir(-1 DIRLS_CC); } +} + +/* }}} */ +/* {{{ proto int chroot(string directory) + Change root directory */ + +PHP_FUNCTION(chroot) +{ + pval **arg; + int ret; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) { + WRONG_PARAM_COUNT; + } + convert_to_string_ex(arg); + + ret = chroot((*arg)-value.str.val); + + if (ret != 0) { + php_error(E_WARNING, "chroot: %s (errno %d)", strerror(errno), errno); + RETURN_FALSE; + } + + RETURN_TRUE; } /* }}} */ Index: php4/ext/standard/php_dir.h diff -u php4/ext/standard/php_dir.h:1.11 php4/ext/standard/php_dir.h:1.12 --- php4/ext/standard/php_dir.h:1.11Thu Dec 7 04:09:38 2000 +++ php4/ext/standard/php_dir.h Wed Feb 14 02:48:48 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_dir.h,v 1.11 2000/12/07 12:09:38 sas Exp $ */ +/* $Id: php_dir.h,v 1.12 2001/02/14 10:48:48 derick Exp $ */ #ifndef PHP_DIR_H #define PHP_DIR_H @@ -28,6 +28,7 @@ PHP_FUNCTION(opendir); PHP_FUNCTION(closedir); PHP_FUNCTION(chdir); +PHP_FUNCTION(chroot); PHP_FUNCTION(getcwd); PHP_FUNCTION(rewinddir); PHP_NAMED_FUNCTION(php_if_readdir); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c
andrei Mon Feb 5 09:37:50 2001 EDT Modified files: /php4/ext/standard basic_functions.c Log: Allow calling static methods via call_user_method_* functions. Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.300 php4/ext/standard/basic_functions.c:1.301 --- php4/ext/standard/basic_functions.c:1.300 Sun Jan 21 09:26:43 2001 +++ php4/ext/standard/basic_functions.c Mon Feb 5 09:37:47 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.300 2001/01/21 17:26:43 rasmus Exp $ */ +/* $Id: basic_functions.c,v 1.301 2001/02/05 17:37:47 andrei Exp $ */ #include "php.h" #include "php_main.h" @@ -1656,8 +1656,8 @@ efree(params); RETURN_FALSE; } - if (Z_TYPE_PP(params[1]) != IS_OBJECT) { - php_error(E_WARNING,"2nd argument is not an object\n"); + if (Z_TYPE_PP(params[1]) != IS_OBJECT Z_TYPE_PP(params[1]) != IS_STRING) { + php_error(E_WARNING,"2nd argument is not an object or class name\n"); efree(params); RETURN_FALSE; } @@ -1693,7 +1693,8 @@ WRONG_PARAM_COUNT; } convert_to_string_ex(method_name); - convert_to_object_ex(obj); + if (Z_TYPE_PP(obj) != IS_OBJECT Z_TYPE_PP(obj) != IS_STRING) + convert_to_object_ex(obj); convert_to_array_ex(params); params_ar = HASH_OF(*params); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/standard basic_functions.c file.c file.h fsock.c fsock.h
zeevSat Jan 13 15:49:45 2001 EDT Modified files: /php4/ext/standard basic_functions.c file.c file.h fsock.c fsock.h Log: Both thread-safe and thread-unsafe builds should be ok now Index: php4/ext/standard/basic_functions.c diff -u php4/ext/standard/basic_functions.c:1.295 php4/ext/standard/basic_functions.c:1.296 --- php4/ext/standard/basic_functions.c:1.295 Tue Jan 9 07:11:23 2001 +++ php4/ext/standard/basic_functions.c Sat Jan 13 15:49:44 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.295 2001/01/09 15:11:23 hirokawa Exp $ */ +/* $Id: basic_functions.c,v 1.296 2001/01/13 23:49:44 zeev Exp $ */ #include "php.h" #include "php_main.h" @@ -710,7 +710,6 @@ PHP_MINIT(regex)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU); - PHP_MINIT(fsock)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU); @@ -763,13 +762,13 @@ UNREGISTER_INI_ENTRIES(); PHP_MSHUTDOWN(regex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); - PHP_MSHUTDOWN(fsock)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU); PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #ifdef TRANS_SID PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif + PHP_MSHUTDOWN(file)(SHUTDOWN_FUNC_ARGS_PASSTHRU); return SUCCESS; } Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.133 php4/ext/standard/file.c:1.134 --- php4/ext/standard/file.c:1.133 Sat Jan 13 05:59:22 2001 +++ php4/ext/standard/file.cSat Jan 13 15:49:44 2001 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: file.c,v 1.133 2001/01/13 13:59:22 zeev Exp $ */ +/* $Id: file.c,v 1.134 2001/01/13 23:49:44 zeev Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -149,7 +149,6 @@ } -#ifdef ZTS static void file_globals_ctor(FLS_D) { zend_hash_init(FG(ht_fsock_keys), 0, NULL, NULL, 1); @@ -159,14 +158,16 @@ FG(fgetss_state) = 0; FG(pclose_ret) = 0; } + + static void file_globals_dtor(FLS_D) { zend_hash_destroy(FG(ht_fsock_socks)); zend_hash_destroy(FG(ht_fsock_keys)); php_cleanup_sockbuf(1 FLS_CC); } -#endif + PHP_MINIT_FUNCTION(file) { le_fopen = zend_register_list_destructors_ex(_file_fopen_dtor, NULL, "file", module_number); @@ -191,6 +192,19 @@ } /* }}} */ + +PHP_MSHUTDOWN_FUNCTION(file) +{ +#ifndef ZTS + FLS_FETCH(); + + file_globals_dtor(FLS_C); +#endif + return SUCCESS; +} + + + /* {{{ proto bool flock(int fp, int operation [, int wouldblock]) Portable file locking */ Index: php4/ext/standard/file.h diff -u php4/ext/standard/file.h:1.31 php4/ext/standard/file.h:1.32 --- php4/ext/standard/file.h:1.31 Sat Jan 13 05:59:22 2001 +++ php4/ext/standard/file.hSat Jan 13 15:49:44 2001 @@ -16,14 +16,15 @@ +--+ */ -/* $Id: file.h,v 1.31 2001/01/13 13:59:22 zeev Exp $ */ +/* $Id: file.h,v 1.32 2001/01/13 23:49:44 zeev Exp $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ #ifndef FILE_H #define FILE_H -extern PHP_MINIT_FUNCTION(file); +PHP_MINIT_FUNCTION(file); +PHP_MSHUTDOWN_FUNCTION(file); PHP_FUNCTION(tempnam); PHP_NAMED_FUNCTION(php_if_tmpfile); Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.59 php4/ext/standard/fsock.c:1.60 --- php4/ext/standard/fsock.c:1.59 Sat Jan 13 14:00:23 2001 +++ php4/ext/standard/fsock.c Sat Jan 13 15:49:44 2001 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: fsock.c,v 1.59 2001/01/13 22:00:23 derick Exp $ */ +/* $Id: fsock.c,v 1.60 2001/01/13 23:49:44 zeev Exp $ */ /* Synced with php 3.0 revision 1.121 1999-06-18 [ssb] */ /* Synced with php 3.0 revision 1.133 1999-07-21 [sas] */ @@ -714,19 +714,6 @@ } /* }}} */ - -PHP_MINIT_FUNCTION(fsock) -{ - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(fsock) -{ -#ifndef ZTS - fsock_globals_dtor(FLS_C); -#endif - return SUCCESS; -} PHP_RSHUTDOWN_FUNCTION(fsock) { Index: php4/ext/standard/fsock.h diff -u php4/ext/standard/fsock.h:1.30 php4/ext/standard/fsock.h:1.31 --- php4/ext/standard/fsock.h:1.30 Sat Jan 13 05:59:22 2001 +++ php4/ext/standard/fsock.h Sat Jan 13 15:49:44 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: fsock.h,v 1.30 2001/01/13 13:59:22 zeev Exp $ */ +/* $Id: fsock.h,v 1.31 2001/01/13 23:49:44 zeev Exp $ */ /* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */ @@