[PHP-DEV] Bug #14143 Updated: Apache2 PATH_INFO var (was:Segmentation fun)

2002-01-21 Thread teo

ID: 14143
User updated by: [EMAIL PROTECTED]
Old Summary: Segmentation fun
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Apache2 related
Old Operating System: SuSE7.1
Operating System: Mandrake8.1
Old PHP Version: 4.0CVS-2001-11-20
PHP Version: php4-200201202100
New Comment:

After some hassle with compilation I tried again w/ a recent
snapshot.Path info still doesn't get set :(.




Previous Comments:


[2002-01-18 02:04:14] [EMAIL PROTECTED]

Teo: Can you download a CVS snapshot, and see if it works?

http://snaps.php.net



[2002-01-17 13:44:09] [EMAIL PROTECTED]

to solve the problem related to cgi var setting (PATH_INFO and so on)
you need the latest cvs, the one in 4.1.1
has bugs (at least when used with apache-2.0.28).

Roberto.



[2002-01-17 13:27:12] [EMAIL PROTECTED]

Tested again on Mandrake8.1 / php-4.1.1 / Apache-2.0.28-beta.
for a page like i.php/something the PATH_INFO still doesn't get set,
but least it doesn't segfault anymore.

PHP config line: --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-dom --disable-posix --disable-pic --with-zlib --enable-wddx
--enable-debug





[2002-01-17 06:01:00] [EMAIL PROTECTED]

Does the same happen on 4.1.1 or current CVS?



[2001-11-20 06:49:34] [EMAIL PROTECTED]

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok-h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 BYTERANGE, ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 BYTERANGE,
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at
http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at
connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at
http_core.c:310
310 ap_add_output_filter(BYTERANGE, NULL, r,
r-connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac GET /i.php/a HTTP/1.1, assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc HTTP/1.1,
  proto_num = 1001, hostname = 0x813ef6c teo,
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 GET, method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct =
0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0, 
read_chunked = 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 application/x-httpd-php, handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator =
0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc /i.php/a, uri = 0x813ecec /i.php/a,
  filename = 0x813f1d4 /usr/local/apache2/htdocs/i.php,
  canonical_filename = 0x813f0e4 /usr/local/apache2/htdocs/i.php/a,
  path_info = 0x813f133 /a, args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17,
csize = 24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 /usr/local/apache2/htdocs

[PHP-DEV] Bug #14209: tux sapi doesn't work when using virtual hosts

2001-11-24 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.1/kernel-2.4.10/tux-2.1.0
PHP version:  4.0CVS-2001-11-24
PHP Bug Type: Other web server
Bug description:  tux sapi doesn't work when using virtual hosts

[yep, I know it's quite experimental that extension,just want to contribute
to make it work]

If I do virtual_server=0 then it works just fine. When it's on (1) it
cannot resolve the filename.
I guess when doing:
file_handle.filename = SG(request_info).path_translated; [php_tux.c:279]

that path is only relative to document root and doesn't contain the virtual
server name?


-- 
Edit bug report at: http://bugs.php.net/?id=14209edit=1


-- 
PHP Development 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-DEV] Bug #14143: Segmentation fun

2001-11-20 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.1
PHP version:  4.0CVS-2001-11-20
PHP Bug Type: Apache related
Bug description:  Segmentation fun

related to #12691

Configuration: same as in #12691 except Apache is using prefork mpm.

The request: GET /i.php/a

Backtrace and request info are:

Program received signal SIGSEGV, Segmentation fault.
0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at apr_pools.c:1214
1214first_avail = blok-h.first_avail;
(gdb) bt
#0  0x4004bb1e in apr_palloc (a=0x813e4cc, reqsize=10) at
apr_pools.c:1214
#1  0x80910d8 in add_any_filter (name=0x80aac34 BYTERANGE, ctx=0x0,
r=0x813e51c, c=0x813a5cc, reg_filter_set=0x80ca19c,
r_filters=0x813e688,
c_filters=0x813a610) at util_filter.c:151
#2  0x809131f in ap_add_output_filter (name=0x80aac34 BYTERANGE,
ctx=0x0,
r=0x813e51c, c=0x813a5cc) at util_filter.c:201
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at http_core.c:310
#4  0x809ca63 in ap_run_insert_filter (r=0x813e51c) at request.c:120
#5  0x809d23d in ap_process_request_internal (r=0x813e51c) at
request.c:279
#6  0x806f779 in ap_process_request (r=0x813e51c) at http_request.c:284
#7  0x8069e96 in ap_process_http_connection (c=0x813a5cc) at
http_core.c:289
#8  0x808f2f7 in ap_run_process_connection (c=0x813a5cc) at
connection.c:82
#9  0x808f58d in ap_process_connection (c=0x813a5cc) at connection.c:219
#10 0x80804bc in child_main (child_num_arg=0) at prefork.c:803
#11 0x80805b3 in make_child (s=0x80cae44, slot=0) at prefork.c:839
#12 0x8080725 in startup_children (number_to_start=1) at prefork.c:913
#13 0x8080c45 in ap_mpm_run (_pconf=0x80c9cec, plog=0x80fde8c,
s=0x80cae44)
at prefork.c:1129
#14 0x8087ce6 in main (argc=2, argv=0xb674) at main.c:432


(gdb) f 3
#3  0x8069f67 in ap_http_insert_filter (r=0x813e51c) at http_core.c:310
310 ap_add_output_filter(BYTERANGE, NULL, r,
r-connection);
(gdb) p *r
$8 = {pool = 0x813e4ec, connection = 0x813a5cc, server = 0x80cae44,
  next = 0x0, prev = 0x0, main = 0x0,
  the_request = 0x813ecac GET /i.php/a HTTP/1.1, assbackwards = 0,
  proxyreq = 0, header_only = 0, protocol = 0x813ecfc HTTP/1.1,
  proto_num = 1001, hostname = 0x813ef6c teo,
  request_time = 1006255730034262, status_line = 0x0, status = 200,
  method = 0x813ecc4 GET, method_number = 0, allowed = 0,
  allowed_xmethods = 0x0, allowed_methods = 0x813e694, sent_bodyct = 0,
  bytes_sent = 0, mtime = 0, chunked = 0, boundary = 0x0, range = 0x0,
  clength = 0, remaining = 0, read_length = 0, read_body = 0,  read_chunked
= 0, expecting_100 = 0, headers_in = 0x813e6c4,
  headers_out = 0x813ea14, err_headers_out = 0x813ea8c,
  subprocess_env = 0x813e86c, notes = 0x813eacc,
  content_type = 0x813f604 application/x-httpd-php, handler = 0x0,
  content_encoding = 0x0, content_languages = 0x0, vlist_validator = 0x0,
  user = 0x0, ap_auth_type = 0x0, no_cache = 0, no_local_copy = 0,
  unparsed_uri = 0x813ecdc /i.php/a, uri = 0x813ecec /i.php/a,
  filename = 0x813f1d4 /usr/local/apache2/htdocs/i.php,
  canonical_filename = 0x813f0e4 /usr/local/apache2/htdocs/i.php/a,
  path_info = 0x813f133 /a, args = 0x0, finfo = {cntxt = 0x813e4ec,
valid = 7598448, protection = 1604, filetype = APR_REG, user = 0,
group = 0, inode = 314593, device = 773, nlink = 1, size = 17, csize =
24,
atime = 100625296900, mtime = 99740411000,
ctime = 99740411000,
fname = 0x813f1d4 /usr/local/apache2/htdocs/i.php,
name = 0x80c23cc O,\f\b, filehand = 0x13f0e4}, parsed_uri = {
scheme = 0x0, hostinfo = 0x0, user = 0x0, password = 0x0, hostname =
0x0,
port_str = 0x0, path = 0x813ecec /i.php/a, query = 0x0, fragment =
0x0,
hostent = 0x0, port = 0, is_initialized = 1, dns_looked_up = 0,
dns_resolved = 0}, per_dir_config = 0x813f474, request_config =
0x813eb0c,
  htaccess = 0x0, output_filters = 0x813f62c, input_filters = 0x813f654,
  eos_sent = 0}







-- 
Edit bug report at: http://bugs.php.net/?id=14143edit=1


-- 
PHP Development 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-DEV] Bug #12691 Updated: Apache 2: Server variables don't get set

2001-11-19 Thread teo

ID: 12691
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Old Status: Feedback
Status: Open
Bug Type: Apache related
Operating System: SuSE7.1
PHP Version: 4.0CVS-2001-08-10
New Comment:

ok, here's what I tried:

o PHP4.0.2-dev (php4-2009 from snaps)
o config line is:
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-dom' 
'--disable-posix' '--disable-pic' '--with-zlib' '--enable-wddx'

o Apache2.0.28-beta
o config line is:
CFLAGS=-g; export CFLAGS
./configure \
--enable-layout=Apache \
--enable-auth-digest \
--enable-ext-filter \
--disable-include \
--enable-headers \
--enable-so \
--enable-ssl=shared \
--with-mpm=threaded \
--enable-http \
--enable-dav=shared \
--disable-asis \
--enable-info=shared \
--enable-suexec \
--enable-cgi=shared \
--enable-cgid=shared \
--enable-dav-fs=shared \
--enable-vhost-alias=shared \
--disable-imap \
--enable-rewrite=shared \
--with-suexec-uidmin=30 \
--with-suexec-gidmin=65534 

Now env vars are set ok (either with or without seting I/O filters, just with an 
AddType), *BUT* :) I still found that one very important one is missing, namely 
PATH_INFO.

If I say http://teo.gecadsoftware.com/i.php/x it gives a file not found error (where 
i.php exists and contains a phpinfo() call).

I tried to catch that with FilesMatch, but couldn't figure (I think the test for 
$DOCUMENT_ROOT/i.php/x to exist is done before applying matches, which makes sense).

I am having a look into it but my experience with Apache2 is  less that epsilon :) so 
maybe somebody can have a look too?

Previous Comments:


[2001-11-17 12:10:10] [EMAIL PROTECTED]

There has been a patch regarding this three days ago. Please try the latest snapshot 
from http://snaps.php.net/ and report, if the problem still comes up.



[2001-11-03 21:53:17] [EMAIL PROTECTED]

updated short desc.




[2001-08-10 11:08:15] [EMAIL PROTECTED]

hi alindeman,

erm, you missed the essential 2 :)
it's with Apache2 (apxs2)

Additional note:
 printenv from /cgi-bin shows them just right.




[2001-08-10 10:49:39] [EMAIL PROTECTED]

works fine for me (Apache 1.3.20 + PHP Latest CVS).

Try running ?phpinfo()? and see what variables are defined..



[2001-08-10 10:42:38] [EMAIL PROTECTED]

Apache 2.0.24-dev
PHP4-200108091635

CFLAGS='-O6 -fomit-frame-pointer' \
'./configure' \

'--with-apxs2=/usr/local/apache2/bin/apxs' \   

'--with-mysql' \   

'--disable-posix' \

'--disable-pic' \  

'--with-zlib' \

'--enable-wddx' \

Looks like PHP doesn't import SERVER_* environment variables:
e.g.
?php print getenv('SERVER_NAME')?
or
?php print $_SERVER['SERVER_NAME']?

yeilds nothin'

-- tedor





Edit this bug report at http://bugs.php.net/?id=12691edit=1


-- 
PHP Development 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-DEV] Re: Bug #13616 Updated: Compiler complains about function declaration after return is called

2001-10-18 Thread teo

Hi jeroen!
On Wed, 17 Oct 2001, [EMAIL PROTECTED] wrote:

 
 Brian Moon [EMAIL PROTECTED] wrote in message
 news:00c601c15725$d00cf0c0$[EMAIL PROTECTED]...
  This is a huge compatibility breaker.  The sad part is that you did not
  properly fix the bug in 9884.  The bug is that the compiler looks past a
  return when compiling.
 
 That is not the bug, all languages do that. PHP4 has always parsed the whole
 script, and will probably remain doing so.
 
 The issue here is that a functiondefinition isn't put in the function table
 until the function definition is executed.
 
 This allows conditional function declaration.
 
 Zeev's bugfix fixed bug 9884 by changing semantics of return, by making
 'return'-ing from a script simply not possible anymore.
 
  Does it look past an exit?
 
 It looks past everything, but _return_ in the body of a script is ignored,
 but exit isn't. Using exit, nothing changed. Only return changed.
 
so if i want to do
function f() { return include_once('big_function_body.php'); }

[big_function_body.php]
// stuff
return $object;

it won't work?

I was considering doing that for some classes that have pretty big methods,
but do I understand correctly that due to this change it cannot be used
anymore?

-- teodor

-- 
PHP Development 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-DEV] Re: [Zend Engine 2] namespaces ambiguity

2001-10-03 Thread teo

Hi Andrei!
On Tue, 02 Oct 2001, Andrei Zmievski wrote:

 On Tue, 02 Oct 2001, Jason Greene wrote:
  This easy to understand, efficient (no time consuming code to interpret whether
  a class was intended), no backwards compatibility issues,
  no ambiguity, and its not the first 3 symbol operator to hit php.
 
 Yeah, I wonder what we'll be saying when 4- and 5-symbol operators come
 along.. %%:..
 
Jumping into discussion...

How about `@'. Everybody reads it as `at' so FOO@Namespace reads quite
familiar, and it doesn't mess with `supress warnings' that much cause you can
make a difference very easily (any other character before it?).

Still, I wonder how much runtime overhead can `::' bring, and how complicated
it would be to implement namespaces as classes (it was a proposal some time
ago, IIRC).

-- teodor

-- 
PHP Development 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-DEV] Add function aliases at runtime?

2001-10-02 Thread teo

Hi Emiliano!
On Tue, 02 Oct 2001, Emiliano wrote:

 Is it possible to add a function entry for a C-coded funtion at
 runtime?

I once was interested in that and Sascha said it's possible to do that. 
It was quite a while back ,so I dunno if recent changes changed also the
situation.

It would be neat though.

-- teodor

-- 
PHP Development 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-DEV] Add function aliases at runtime?

2001-10-02 Thread teo

Hi Emiliano!
On Tue, 02 Oct 2001, Emiliano wrote:

 [EMAIL PROTECTED] wrote:
 
   Is it possible to add a function entry for a C-coded funtion at
   runtime?
  
  I once was interested in that and Sascha said it's possible to do that. 
  It was quite a while back ,so I dunno if recent changes changed also the
  situation.
 
 Any pointers into the mailinglist archives?
 
uh, sorry, it was on #php :)

ideas anyone? I have too lille clue (still browsing the sources w/ lxr to
figure out stuff).

-- teodor

-- 
PHP Development 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-DEV] A couple of session issues

2001-08-27 Thread teo

Hi Zeev!
On Mon, 27 Aug 2001, Zeev Suraski wrote:

 At 13:40 27-08-01, Thies C. Arntzen wrote:
 On 27 Aug 2001 01:33:46 +0300, Zeev Suraski wrote:
   The other issue is a suggestion I want to pitch - right now, if sessions
   are started after the headers are already sent, we'll get a nice
   headers-already-sent error.  If we have trans_sid enabled (which we will
   most probably, from now on) - we can check whether the headers are already
   sent, and if they are, move to use trans_sid instead.  Any comments?
  
 i tend not to do that. trans-sid is a very different thing from cookies
 (session id's are populated to foreign-sites via HTTP_REFERRER). i don't 
 think
 we should default to it. developers should decide themself if they want 
 trans-sid
 or not.
 
 You lost your caps too? :)
 
 I'm not sure what you meant in the HTTP_REFERRER issue - can you explain 

I guess if I am in a page generated by
http://www.example.com/foo/bar.php?SID=32x[0-f]

and in this page, there is a link to www.foo.com/malicious.php

malicious.php will see in HTTP_REFERER what is your SID.

-- teodor

-- 
PHP Development 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-DEV] Anybody tested the Apache module recently?

2001-08-26 Thread teo

Hi Rasmus!
On Sun, 26 Aug 2001, Rasmus Lerdorf wrote:

 Ok, it is working again now.
 

How about Apache2? Is any eye on it?

just askin'

-- teodor

-- 
PHP Development 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-DEV] for the php-gtk people

2001-08-24 Thread teo

Hi Marc!
On Fri, 24 Aug 2001, Marc Boeren wrote:

 
 Hi,
 
 I've been looking at crossplatform gui-development, and one of the 
 things that is easily found is the wxWindows tools (www.wxwindows.org).
 
 This looks to be sort of the same as php-gtk, but it does windows, motif
 os/2 and mac as well (aside from gtk).
 
 There exists wxPython and wxPerl... why not wxPHP? 
 
Marc, it would be an absolutely cool idea :)
I've been playing with wxPython and saw how easy was to do very neat apps
in few lines of code.

Fact is, it needs somebody to take the time and start such a project, put
some initial effort in it, then I guess volunteers will follow
[I for one, would be interested to get my C++ skills out of the dust ;) ]

So actually the question is, who has the time to start it?

-- teodor

-- 
PHP Development 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-DEV] for the php-gtk people

2001-08-24 Thread teo

Hi Marc!
On Fri, 24 Aug 2001, Marc Boeren wrote:

 
 
   There exists wxPython and wxPerl... why not wxPHP? 
   
  Marc, it would be an absolutely cool idea :)
 
 That's what I thought :-)
 
  So actually the question is, who has the time to start it?
 
 Well, not right now...
 But I will probably be using wxWin over the next couple of months for some
 other development projects. 
 Perhaps after I have a bit of mileage using wxWin I'll look into setting up
 wxPHP (if somebody beats me to it, I'd be more than happy to help once I
 find some time)
 
 Just as a thought, should this go into the php cvs somewhere, or should a
 project be set up as sourceforge or something?
 
well, AFAIK php-gtk is a different beast; so  sourceforge I guess.

-- teodor

-- 
PHP Development 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-DEV] apache 2 environment

2001-08-23 Thread teo

Hi Lenar!
On Wed, 22 Aug 2001, Lenar wrote:

 Hi,
 
 Can anybody say something about progress made finding and fixing the
 unfortunate problem about apache 2 and php 407-dev, where server and
 environment variables are not accessible under php?
 
I filed a bug report and still watching for updates to it :)

-- teodor

-- 
PHP Development 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-DEV] Bug #12272 Updated: Handling of file submissions from Opera incorrect

2001-08-21 Thread teo

Hi sniper!
On Mon, 20 Aug 2001, [EMAIL PROTECTED] wrote:

 ID: 12272
 Updated by: sniper
 Reported By: [EMAIL PROTECTED]
 Old Status: Feedback
 Status: Closed
 Bug Type: HTTP related
 Operating System: Linux RedHat
 PHP Version: 4.0.5
 New Comment:
 
 No feedback. Reopen if you still have this problem
 with PHP 4.0.7 (soon to be released) or with latest CVS 
 snapshot from http://snaps.php.net/
 
 
 
 Previous Comments:
 
 
 [2001-07-26 21:49:34] [EMAIL PROTECTED]
 
 Does this happen with latest CVS snapshot from http://snaps.php.net/ ?
 
 
 
 
 [2001-07-20 04:35:15] [EMAIL PROTECTED]
 
 When you use a FILE form element in opera and ask for multipart encoding, PHP does 
not extract the data into the array HTTP_POST_FILES as it does with other browsers 
but leaves it packed up in HTTP_POST_VARS
 
 
 

Actually Opera does buggy posts of type multipart/form-data. 
So the bug is in Opera.

-- teodor

-- 
PHP Development 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-DEV] Chora and CVSWeb problems

2001-08-19 Thread teo

Hi Anil!
On Sun, 19 Aug 2001, Anil Madhavapeddy wrote:
 Guessing the file-type from the first few magic bytes is
 probably a good thing (especially in the case where other
 methods have failed, and the MIME type has fallen back to
 application/octet-stream or something equally unhelpful).
 
uhm,
well, but if I send foo.gif and it starts with some friendly
VBScript I won't bet you'll think the same.

Apache does same guessing on the server, which is safer (and
does not do it by default, iirc.)

 The bug here is that it ignores the explicit Content-Type
 header instead of its own detection mechanisms, which is
 clearly bad.
 
 Anyone want to file a Microsoft bug report? :-)

was already discussed on bugtraq not too long ago; I remember
a link pointing that it's actually a documented feature :) 

-- teodor

-- 
PHP Development 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-DEV] Bug #12826 Updated: session_unregister() array_walk() immune? :)

2001-08-18 Thread teo

Hi mfischer!
On Sat, 18 Aug 2001, [EMAIL PROTECTED] wrote:

 ID: 12826
 Updated by: mfischer
 Reported By: [EMAIL PROTECTED]
 Status: Bogus
 Bug Type: Session related
 Operating System: Win2000 SP2
 PHP Version: 4.0.6
 New Comment:
 
 If you want to stick to a one-liner, you can use
 
- array_walk($foo,create_function('$e','session_unregister($i);'));
+ array_walk($foo,create_function('$e','session_unregister($e);'));

;)

anywayz

-- teodor

-- 
PHP Development 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-DEV] Setting up RFC

2001-08-15 Thread teo

Hi Andrei!
On Wed, 15 Aug 2001, Andrei Zmievski wrote:

 On Wed, 15 Aug 2001, Zeev Suraski wrote:
  like.  That's why the situation wouldn't change radically if/when the 
  engine license changes, much like it wasn't any different *before* the 
  engine license was even introduced, in the PHP 3.0 days.  Having regulators 
  over the 'kernel' of the project is certainly not very unique to the PHP, 
  and had a significant role in bringing PHP to where it is today, and not 
  where Perl is today, for example.
 
 You always compare PHP to Perl. How about Python? It's a well designed
 language that's pretty open for development.. Look at their PEPs system.
 
maybe cause PHP it's better than Perl but not than Python? :)

-- teodor

-- 
PHP Development 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-DEV] Bug #12735: Shorthand for X ? X : Y

2001-08-14 Thread teo

Hi david!
On Tue, 14 Aug 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: 
 PHP version:  4.0.6
 PHP Bug Type: Feature/Change Request
 Bug description:  Shorthand for X ? X : Y
 
 Providing default values for fields, I find myself using the following
 syntax a lot:
 
 $a = $result-f('asd'); if (!$a) $a = 'nothing';
 
 $a = ($result-f('asd') ? $result-f('asd') : 'nothing');
 
 Generally:
 
 $a = ($x ? $x : $y);
($a = $x) || ($a = $y);
there u go, only one eval of $x;

 i.e. if 'value if true' is empty, use 'condition value'.
can be done with expressions I guess.
I do that most of the time, but usually the syntax ends up a bit weird
to read.

-- teodor

-- 
PHP Development 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-DEV] Reserved keywords in PHP

2001-08-13 Thread teo

Are there any reserved keywords in PHP put aside for future development?

I am looking for some guidelines of avoiding name clashes with future PHP
development. For example, if I write a function named import() and then
suddenly the import() becomes a language construct it will suck.

So, any names set aside with don't use stuck on them? Any rules (a la _NAMES
in C) ?

-- teodor

-- 
PHP Development 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-DEV] Bug #12691: Server variables don't get set

2001-08-10 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.1
PHP version:  4.0CVS-2001-08-10
PHP Bug Type: Apache related
Bug description:  Server variables don't get set

Apache 2.0.24-dev
PHP4-200108091635

CFLAGS='-O6 -fomit-frame-pointer' \
'./configure' \
  

'--with-apxs2=/usr/local/apache2/bin/apxs' \   
  

'--with-mysql' \   
  

'--disable-posix' \
  

'--disable-pic' \  
  

'--with-zlib' \
  

'--enable-wddx' \

Looks like PHP doesn't import SERVER_* environment variables:
e.g.
?php print getenv('SERVER_NAME')?
or
?php print $_SERVER['SERVER_NAME']?

yeilds nothin'

-- tedor
-- 
Edit bug report at: http://bugs.php.net/?id=12691edit=1


-- 
PHP Development 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-DEV] Re: The new $_GET/POST/ENV (was: Re: [PHP-CVS] cvs: php4 / NEWS...)

2001-08-09 Thread teo

Hi Jason!
On Wed, 08 Aug 2001, Jason Greene wrote:

 From: Zeev Suraski [EMAIL PROTECTED]
  My top of the list is:
  
  $_REQUEST
  $_EVIL (Andi and I think it's really pretty good, but we both figured we'll 
  end up going with a different alternative :)
 
 What about $_TAINTED ?
 
for non-english ppl REQUEST is a more familiar word that TAINTED. I only
encountered it when studying JS security.

-- teodor

-- 
PHP Development 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-DEV] php+apache2 anyone?

2001-07-30 Thread teo

Hi Ramsi!
On Mon, 30 Jul 2001, Ramsi Sras wrote:

 UNSUBSCRIBE ME PLEASE!! 
 
geez dude, drink less coffee :)
then just jump with your eyes to the bottom of this mail.
see something? if not, save the mail and grep unsubscribe mail
or just write a PHP script to find the magic word.

[ you can always use www.php.net/support.php though ]
 
 [EMAIL PROTECTED] schrieb: 
 
 
 Anyone got an Apache2 running (which one) with PHP (which one) ? 
 thx 
 
 ciao 
 
 
 -- teodor 
 
 
 -- 
 PHP Development Mailing List  http://www.php.net/ 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]
 
 
-- teodor

-- 
PHP Development 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-DEV] Security Issues

2001-07-30 Thread teo

Hi Zeev!
On Sun, 29 Jul 2001, Zeev Suraski wrote:

 Generally I agree, except I don't think we should go as far as changing the 
 theme of PHP.  Putting form variables into a different space would be the 
 simplest and equally secure way to do the trick.
 
yes, but a Request class can be enriched with lots of nifty utility functions.
I'm not saying that it must be done in the language (though a Request class
would be nice :), it can be done in PHP too (which I did).

OTOH let me say I noticed two main tendencies here:
on one hand Rasmus wants the language same easy and appealing it always
been, so new users can jump in easily and have a fast start

on the other you, Kristian and others, who want the language focus more on 
supporting large applications, far more complex programs than a mysql query
displaying a table with results and such (i.e. 10 liners or such)

We have a team of VB programmers here, and I can say big projects in
Visual Basic suck raw eggs; can lead to suicidal tendencies of the programmers :) 
and that's why every time PHP start going in that direction I start looking
arround scared (maybe Python will save me? Java? neah, I'll stay a bit longer
with good ol' pal)
 

The `security issue' thread just uncovered this divergence in the view of
the language; I guess there should be a balance there, and most of the support
for large apps go in PEAR as well designed components (so far I love Stig :)

So, call me ignorant but besides the plans for the new zend2 I haven't seen
a paper to try to clearely state where is PHP going. Like Larry Wall wrote for
Perl6 (or something). Perl is already icky :) I know.
 
thanks for your time,
ciao

-- teodor

-- 
PHP Development 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-DEV] Security Issues (isset stuff)

2001-07-30 Thread teo

Hi Phil!
On Mon, 30 Jul 2001, Phil Driscoll wrote:

 On Sunday 29 July 2001 19:13, [EMAIL PROTECTED] wrote:
 ...stuff pointing out how you'd get no warning messages when the evil guy 
 sets the variables from outside.
 
 You missed my point, which is the good guy would get the warning messages 
 when he tested the code himself without sending in the 'bad' variables. 
 There's no point showing the warning messages to the bad guy!
 
Yes Phil, but does your codes rely on warnings messages alone?
I test every and each variable I'm about to use in the program that 
contains data from the user.
My point was that doing that way, you save isset() tests and go ahead and
test them. To be more explicit, in the case of register_globals off you won't
have to fear that if you forgot to properly initialize a variable that can be
set in request by the user. 

The only concerns are:
- if the user sends less variables than you expect
- if the content of those variable is illegal for their meaning.

In the 1st case most of the programmers (in globals on) test it with isset()  
The second one is so seldomly seen that can be said it's a legend.

In web programming there are more complicated security issues that we can
imagine, and not addressing the small ones means we're a bit ignorant on the
consequences.

For instance look for : The Dangers of Allowing Users to Post Images and
Cross-Site Request Forgeries (derived from the first) threads on Bugtraq.
It was quite an interesting security issue I've never thought of, and now
gives me hard times :)

-- teodor

-- 
PHP Development 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-DEV] Bug #12464: IIS5.0 header problems

2001-07-30 Thread teo

Hi j.gray!
On Mon, 30 Jul 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: win 2k
 PHP version:  4.0.6
 PHP Bug Type: Session related
 Bug description:  IIS5.0 header problems
 
 The below message is getting spewed from an IIS5.0 win2k PHP 4.06 MySQL
 3.23.39a App. when it shouldn't
 
 
 HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Mon, 30 Jul 2001 10:24:55
 GMT Content-type: text/html X-Powered-By: PHP/4.0.6 Expires: Thu, 19 Nov
 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate,
 post-check=0, pre-check=0 Pragma: no-cache 
 
 See the line
 PHP/4.0.6 Expires: Thu, 19 Nov 1981
 what is with that. To me it looks like it is sending expired headings
 
 If I turn off keep alives all is well. This isn't caused by proxies or
 firewalls.
 
I can confirmed it happened to me several times:
Linux/Apache 1.3.17/PHP4.0.6 (using output buffering)/Netscape4.7

namely, some headers of the response appeared on the page in NS.

-- teodor

-- 
PHP Development 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-DEV] TSRM change

2001-07-30 Thread teo

Hi Andrei!
On Mon, 30 Jul 2001, Andrei Zmievski wrote:

 Zeev,
 
 Since you've been updating TSRM stuff, I've noticed some
 inconsistencies. For example, php_ldap.h says:
 
  # define LDAPG(v) TSRMG(ldap_globals_id, zend_ldap_globals *, v)
 
 But ldap_globals_id is not declared anywhere. Should it be?
 
It may be me, but I think it's related to TSRM:

Making all in Zend
make[1]: Entering directory `/usr/src/php4-200107300435/Zend'
/bin/sh ../libtool --mode=compile c++ -DHAVE_CONFIG_H -I. -I. -I../main   -D_REENTRANT 
-I../TSRM -I../TSRM  -g -O2 -pthread -prefer-pic -c zend_language_scanner_cc.cc
c++ -DHAVE_CONFIG_H -I. -I. -I../main -D_REENTRANT -I../TSRM -I../TSRM -g -O2 -pthread 
-c zend_language_scanner_cc.cc   -fPIC -DPIC
-o zend_language_scanner_cc.lo
zend_language_scanner_cc.cc: In function `int highlight_file(char *, 
zend_syntax_highlighter_ini *, void ***)':
zend_highlight.h:42: too few arguments to function `void 
zend_highlight(zend_syntax_highlighter_ini *, void ***)'
zend_language_scanner_cc.cc:3138: at this point in file
zend_language_scanner_cc.cc: In function `int highlight_string(zval *, 
zend_syntax_highlighter_ini *, char *, void ***)':
zend_highlight.h:42: too few arguments to function `void 
zend_highlight(zend_syntax_highlighter_ini *, void ***)'
zend_language_scanner_cc.cc:3162: at this point in file
make[1]: *** [zend_language_scanner_cc.lo] Error 1
make[1]: Leaving directory `/usr/src/php4-200107300435/Zend'
make: *** [all-recursive] Error 1

teo:/usr/src/php4-200107300435 # cat config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--enable-debug' \
'--with-xslt-sablot' \
'--with-zlib' \
'--with-dom' \
'--with-mysql=/usr/local' \
'--disable-posix' \
'--enable-trans-sid' \
'--enable-shmop' \
'--enable-sockets' \
'--enable-wddx' \
$@

And this is because of the TSRMLS_DC (which I dunno what it is :)
Shall I file a bug report of wait for more work from Zeev w/ his patch?

-- teodor

-- 
PHP Development 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-DEV] Security Issues (isset stuff)

2001-07-29 Thread teo

Hi Phil!
On Sat, 28 Jul 2001, Phil Driscoll wrote:

  That's not going to find half, or a quarter, or whatever of the problems,
  since PHP has tools to cleanly handle undefined variables - namely isset()
  and empty().  They, or at least isset(), are quite popular.
 
 I always use something like:
 
 if(!isset($Thing) /*and possibly some range checking*/))
  $Thing=sensible default;
 
 In no way is
 
 if(!isset(_GET['Thing']) /*and possibly some range checking*/))
 {
  $Thing=sensible default;

well, lemme tell you my favourite:
$defRequest = array ('thing1' = '', 'thing2'='' /* ... */);
$myRequest = array_merge ($defRequest, $HTTP_GET_VARS); /* or POST*/;

This way you'll be able to simply say:
if ($myRequest[var] != default) {
// do something
}

and be sure you have something there.

 any more secure (nor would it be if I wrote sensible default back to _GET.
 
 Anyway, to check my sanity i have reread the security advisory which I first 
 read on the day it was published, and I am even more conviced now that 
 register globals=off has the tiniest of effects for gpc variables wheras 
 E_NOTICE has a massive effect.
 
 Here are the examples from the advisory:
 
 --
  ?php
   if ($pass === hello) //= corrected to ===
$auth = 1;
   ...
   if ($auth == 1)
echo some important information;
  ?
 
 replace $pass with _GET['pass']  and the code is 
 equally insecure. Turn E_NOTICE on and the novice programmer will get a 
nope,
in the first case I can say http://your.site/your_page.php?pass=whateverauth=1

 warning message for the unset $pass.
 --
  ?php
   if (!($fd = fopen($filename, r))
echo(Could not open file: $filenameBR\n);
  ?
 
 replace $filename with _GET['filename'] and this lunatic piece of code 
 remains a lunatic piece of code. If $filename is not meant to be coming from 
 the outside world then with E_NOTICE on there would be a warning message for 
 the unset filename.
The issue here was as always 'untrusted user data' used as trusted (I can say
?fielname='../../../etc/passwd' etc.)
And *maybe* seeing :
$fd = fopen ($_GET['filename'],'r');

something will click in the mind of the programmer ('geez, wait, this is
 *straight* form the request[is sais GET], what if...)

 --
  ?php
   include($libdir . /languages.php);
  ?
 Ok, with register_globals=off then $libdir could not be directly overwritten 
 from outside (unless there was some code which made that happen) however 
 E_NOTICE would generate a warning for an unset $libdir
Again, it will be set, and no notice will pop up, but it will be set by the
evil guy.

The advisory was not like one from eEye as clear and professional, but had a
very well defined point. And sadly, it was right.

-- teodor

-- 
PHP Development 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-DEV] function basename()

2001-07-29 Thread teo

Hi Marcus!
On Thu, 26 Jul 2001, Marcus wrote:

 shouldn't the function basename() return only the
 script part and not the query part?
I guess basename() is a filesistem function, and hence it doesn't make sense
to care about `query string' cause in the file systems there are no such
things.

I guess you are trying to determine the name of the script from the query
string or what exactly? If so, it's quite simple to use basename(__FILE__);

-- teodor

-- 
PHP Development 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-DEV] Bug #12453: comparing 0==null is true?

2001-07-29 Thread teo

Hi btanner!
On Sun, 29 Jul 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: Win2k
 PHP version:  4.0.6
 PHP Bug Type: Scripting Engine problem
 Bug description:  comparing 0==null is true?
 
 If you compare the integer(0) to the string null, PHP thinks they are the
 same.
 
 Am I hopped up on goofballs, or whats up here?
 
 $MyVar=0;
 if($MyVar==null)
   print(apparently $MyVar is equal to \null\);
try intval(null) to see why 
$MyVar isn't converted to string, null is converted to int.

-- teodor

-- 
PHP Development 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-DEV] Security Issues

2001-07-29 Thread teo

Hi Zeev!
On Thu, 26 Jul 2001, Zeev Suraski wrote:

 At 02:18 26/07/2001, Ron Chmara wrote:
If most of the PHP apps out there are or were vulnerable to 
  register_globals=on attacks, we can't (shouldn't) blame the whole world, 
  but fix the language instead.
 
 I'd suggest fixing the code religion instead, but changing faiths is hard. 
 :-) If they aren't checking their vars before processing, no language 
 would fix it, would it?
 
 Most would, actually.  Pretty much any language which requires you to 
 declare variables, or, that doesn't allow external sources to declare 
 variables, does not have this problem.  PHP is quite unique in that sense, 
 which is why I agree that the language is at fault.  Of course, declaring 
 and not initializing your variable is still a programming error, but it's 
 much less severe and much less prone to exploits than this problem.
 
May I jump in? :)

As I see it, the security issue is Untrusted data coming from the user,
which collects under the request term.

What is overwritten? Server vars or user vars, and that's because there's no
hard separation between them in the register globals on case (all in the
same pot).

So why wouldn't PHP propose a Reques-Response paradigm like ASP,JSP or Zope,
before we have namespaces and such?

If I say $Request-getAttribute('geez') I am damn sure it comes from the user
and I consider the value inherently suspicious (i.e. don't just stuck it in
a mysql_query() string w/o testing.)

This can be done at PHP level or language level (where other security tests
can be addressed.)

The best teaching the pear/php devs can give to the user in the security issue
is to promote best programming practices, and IMO this is one of them;
otherwise they'll have to gulp bitter advisories about this and that popular
PHP application having an ungly bug (see phpMyAdmin, IMP, Phorum, etc.)


my 2c

-- teodor

-- 
PHP Development 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-DEV] Security Issues (backward fix)

2001-07-29 Thread teo

Hi Ron!
On Sat, 28 Jul 2001, Ron Chmara wrote:

 On Saturday, July 28, 2001, at 12:52  PM, Zeev Suraski wrote:
  At 06:01 28/07/2001, Phil Driscoll wrote:
   I and no doubt thousands of others will turn
  register_globals on because it gives much more readable code, 
  much less
  typing and does not IMHO add one jot to the security of my 
  applications.
  I have no doubt that thousands would turn it back on.  I can't 
  do anything about it, and as I said numerous times in numerous 
  metaphors, I'm quite alright with that.
 
 I have roughly 2,000 files to fix before I can use it with my 
 biggest client :-)
Directory /old/apps
php_value auto_prepend_file globals_fix.php
/Directory

[globals_fix.php]

extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
etc.
now they all work with register_globals off
erm? :)

-- teodor

-- 
PHP Development 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-DEV] php+apache2 anyone?

2001-07-29 Thread teo

Anyone got an Apache2 running (which one) with PHP (which one) ?
thx

ciao

-- teodor

-- 
PHP Development 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-DEV] Bug #12350: Referencing multiple arrays in classes from inside methods doesn't work

2001-07-25 Thread teo

Hi m.stenzel!
On Tue, 24 Jul 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: W2K
 PHP version:  4.0.6
 PHP Bug Type: Class/Object related
 Bug description:  Referencing multiple arrays in classes from inside methods doesn't 
work
 
 Configuration: IIS 4 dll with Win32 binaries
 
 Okay I'm new to the game so forgive me a small mistake but I have tested
 and reproduced this weird behavior for more than 6 hours.
 
 A class wrapping multiple array variables doesn't allow to access both
 arrays as individual references from inside a function.
 
 The following code does not what I expected from the language:
 
 class test {
   VAR $firstarray;  // defining one array
   VAR $secondarray; // defining another array
   
   function testit () {
 $i = 0;
 while ($i  14) {
   $this-$firstarray[$i] = uniqid (test, false);
 $this-$secondarray[$i] = uniqid (different, false);
that should be $this-firstarray and $this-secondarray.
the manual (www.php.net/manual/ I guess) is quite clear about it.

   echo Set array #1, item $i to .$this-$firstarray[$i]. and array
 
 I think i read the manual thorougly and haven't found a hint about this
 behavior :(
 
Chapter 13. Classes and Objects
class Cart {
var $items; 
 ...

 function remove_item ($artnr, $num) {
 if ($this-items[$artnr]  $num) {
 $this-items[$artnr] -= $num;
^... no $ here



-- teodor

-- 
PHP Development 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-DEV] Bug #12325 Updated: Query_string not defined

2001-07-25 Thread teo

Hi danradigan!
On Tue, 24 Jul 2001, [EMAIL PROTECTED] wrote:

 ID: 12325
 User updated by: [EMAIL PROTECTED]
 Reported By: [EMAIL PROTECTED]
 Status: Feedback
 Bug Type: Unknown/Other Function
 Operating System: Win 2k
 PHP Version: 4.0.6
 New Comment:
 
 I think this is the relevant section:
well, how is your register_globals? If it's off, then that's it.

 However, since QUERY_STRING is a PHP variable, I think it should be defined as  if 
there is no querystring specified.
 
 
 Previous Comments:
 
 
 [2001-07-24 09:24:54] [EMAIL PROTECTED]
 
 Can you include a copy of your php.ini file?
 
 
 
 [2001-07-23 21:30:26] [EMAIL PROTECTED]
 
 Here is the code I am trying to run:
 
 if ($QUERY_STRING != ) {
 $insertFormAction .= ? . $QUERY_STRING;
 
 When I call the page from the browser with no querystring I get:
 
 Warning: Undefined variable: QUERY_STRING in
 c:\inetpub\wwwroot\gabe\deleteParam.php on line 3
 
 This only reproduces when using the installer for windows
 from the download section at php.net.  I cannot reproduce on
 Linux or OSX.  Also I installed the zip version and cannot
 reproduce it.  Only the installer.
 
-- teodor

-- 
PHP Development 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-DEV] Bug #11970: SEPARATE_ZVAL_TO_MAKE_IS_REF doesn't like 0x0

2001-07-09 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.0
PHP version:  4.0.6
PHP Bug Type: Scripting Engine problem
Bug description:  SEPARATE_ZVAL_TO_MAKE_IS_REF doesn't like 0x0

function erm($key) { 
  return @$arr[$key];
}

$foo = erm('foo');
$bar = erm('bar');

(gdb) run bug3.php
Starting program: /usr/local/bin/php bug3.php

Program received signal SIGSEGV, Segmentation fault.
0x80a29e9 in execute (op_array=0x81d3348) at ./zend_execute.c:1592
1592 SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
(gdb) p retval_ptr_ptr
$1 = (zval **) 0x0
(gdb) bt
#0  0x80a29e9 in execute (op_array=0x81d3348) at ./zend_execute.c:1592
#1  0x80a26a8 in execute (op_array=0x81cdf5c) at ./zend_execute.c:1544
#2  0x8097234 in zend_execute_scripts (type=8, file_count=3) at
zend.c:752
#3  0x8065b4f in php_execute_script (primary_file=0xb694) at
main.c:1206
#4  0x8061173 in main (argc=2, argv=0xb724) at cgi_main.c:718
(gdb) list
1587(opline-op1.op_type != IS_CONST)  
1588(opline-op1.op_type != IS_TMP_VAR)) {
1589  
1590retval_ptr_ptr = get_zval_ptr_ptr(opline-op1, Ts, BP_VAR_W);
1591
1592SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
1593
1594(*retval_ptr_ptr)-refcount++;
1595(*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr);
1596 } else {

notice that the second call [ erm('bar')] actually trigger the segfault.

patch: I dunno, Zeev somebody? :)


-- 
Edit bug report at: http://bugs.php.net/?id=11970edit=1


-- 
PHP Development 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-DEV] (change request) PHP 4.0 Bug Summary Report

2001-05-05 Thread teo

Hi Joe!
On Sat, 05 May 2001, Joe Brown wrote:

 Is it possible to include www.php.net/bugs.php?id= at the front of these, or
 on a second line trailing each bug listed?
 
 Would make the list twice as long, but a lot simpler to follow up on, w/mail
 reader that recognises links.
 
[justa-hint]
make yourself a script which replaces the bug id with that.
or define a mapping for a reformating key to do it (in ~.vimrc)

map ^[[24~ :/==/,$!awk '{gsub(/^[0-9]+/,http://www.php.net/bugs.php?id=;
$1,$1);print $0} ' -^M

so if you edit the message with vim and hit f12 you get what you want.

-- teodor


-- 
PHP Development 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-DEV] php got stomped on in shootout, but shouldn't have...

2001-05-04 Thread teo

Hi Sean!
On Fri, 04 May 2001, Sean Chittenden wrote:

   Howdy.  So I was checking out Perl, Ruby, and Java's
 performance specs on a language shootout, and PHP got stomped on.  It
 was safely sitting at the bottom of the list (check out the score card
 page).
 
 http://www.bagley.org/~doug/shootout/
 
 
   The good news is, the reason it got stomped on wasn't because
 of the language, it was because it wasn't represented.  So what's the
 deal here?  The only test that PHP was enrolled in was the Ackermann's
 Function.  How could 25 other languages (some I'd never heard of
 before), have better community support than the beast that is PHP?
 I'd really like to know how well PHP would stack up compared to these
 other languages (esp Java) if well represented.
 
 
   Hacking in C (grudgingly),
 Sean
 
 
   PS What really happened was I just had PHP nuked as a viable
 language for a contract job I was doing (now doing it in C) because
 the CTO came back and referenced PHP's performance on this page.  The
 CTO's bright, but an old stodgy UNIX/C programmer that wouldn't give.
 
uhm, I think your CTO shows serious I/O errors, as he failed to read some
interesting sectors of the main page:
e.g.

Disclaimer No. 1: I'm just a beginner in many of these languages, so if you can help me
  improve any of the tests, please drop me an email.  Thanks.
  
Disclaimer No. 2: These pages are provided for novelty
  purposes only.  Any other use voids the manufacturer's warranty.
  Do not mix with alchohol.  Some contents may consist of recycled
  materials.

The flaw was so evident that he didn't see it.
  
-- teodor

-- 
PHP Development 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-DEV] PHP 4.0 Bug #8889 Updated: Memory is not being freed.

2001-05-01 Thread teo

Hi Brian!
On Mon, 30 Apr 2001, Brian Foddy wrote:

 Perhaps another possible solution is this...
 For those 1 in 300 web hits that the developer knows is
 going to use gobs of memory and assuming they can't
 be re-engineered to use less (through temp files, etc),
 create a simple function that is callable in PHP that
 will cause the parent apache process to exit (if it doesn't
 exist already) It will be immediately replaced by another much smaller
 version ready to handle the remaining 299 web hits.
like:

// expesive memory processing 

function cleanup() 
{
  posix_kill (posix_getpid(), 15) || posix_kill (posix_getpid(), 9);
}

register_shutdown_function(cleanup);

eventually, in a auto_apend file, if all the scripts are eating much mem.

IIRC, Posix support is compiled by default, so it looks like a nice
workarround for the memory problem...

I was wondering, could a SIGHUP to the current child make it to release
the memory? TERM is a bit harsh.

-- teodor

-- 
PHP Development 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-DEV] Bug #10551: array_switch ( permute the keys w/ values)

2001-04-29 Thread teo

From: [EMAIL PROTECTED]
Operating system: 
PHP version:  4.0 Latest CVS (29/04/2001)
PHP Bug Type: Feature/Change Request
Bug description:  array_switch ( permute the keys w/ values)

I found myself with an array like
$a = array (0 = Foo, 1 = Bar );

and thought it would be cool to be able to say 
$a = array_permute/switch ($a);

a being now: array (Foo = 0 , Bar=1);
the value colision can use the style of extract() 3rd parameter.

what do you think?

-- teodor


-- 
Edit Bug report at: http://bugs.php.net/?id=10551edit=1



-- 
PHP Development 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-DEV] Bug #10496: segfault on parse error

2001-04-25 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.0
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  segfault on parse error

Given the complexity of the whole app, I couldn't make a small script. 
The offending code was:
$tplBoxes = array ();
?php foreach ($tplBoxes as $box) {
option value=?=$box['idb']??=$box['title']?/option
 ?php } ?

[note the missing ? after foreach]

And the logs were:
Wed Apr 25 22:01:12 2001] [error] PHP Parse error:  parse error in 
/usr/local/cvsdevel/php/aol/htdocs/Admin/editTemplat
/usr/local/cvsdevel/php/aol/htdocs/Admin/editTemplates.php(40) : Parse error - parse 
error
[Wed Apr 25 22:01:12 2001] [notice] child pid 7245 exit signal Segmentation fault (11)

line 40 is exactly the line with the missing ?

The backtrace is:
Program received signal SIGSEGV, Segmentation fault.
0x40185cc8 in _zval_ptr_dtor () at zend_execute_API.c:103
103 }
(gdb) bt
#0  0x40185cc8 in _zval_ptr_dtor () at zend_execute_API.c:103
#1  0x40184792 in zend_switch_free (opline=0x824b94c, Ts=0xbfffd074) at 
./zend_execute.c:236
#2  0x401811c1 in execute () at ./zend_execute.c:877
#3  0x40181e85 in execute () at ./zend_execute.c:877
#4  0x40181e85 in execute () at ./zend_execute.c:877
#5  0x40191880 in zend_execute_scripts () at zend.c:259
#6  0x401a99b3 in php_execute_script () at main.c:1153
#7  0x401a503e in apache_php_module_main () at sapi_apache.c:98
#8  0x401a5d69 in send_php () at mod_php4.c:433
#9  0x401a5db3 in send_parsed_php () at mod_php4.c:433
#10 0x8076669 in ap_invoke_handler ()
#11 0x808c05f in process_request_internal ()
#12 0x808c0d2 in ap_process_request ()
#13 0x8082c76 in child_main ()
#14 0x8082e55 in make_child ()
#15 0x8082fd6 in startup_children ()
#16 0x808365c in standalone_main ()
#17 0x8083eac in main ()
#18 0x40083a8e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93
(gdb) 

hope it helps

ciao 

--teodor


-- 
Edit Bug report at: http://bugs.php.net/?id=10496edit=1



-- 
PHP Development 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-DEV] Bug #10496: segfault on parse error

2001-04-25 Thread teo

Hi php-dev!
On Wed, 25 Apr 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: SuSE7.0
 PHP version:  4.0.4pl1
 PHP Bug Type: Scripting Engine problem
 Bug description:  segfault on parse error
 
 Given the complexity of the whole app, I couldn't make a small script. 
 The offending code was:
correction 
-  $tplBoxes = array ();
[it was for tracing it]

+ $tplBoxes = $req-getAttribute('Boxes');
[returning an array with data]

 ?php foreach ($tplBoxes as $box) {
 option value=?=$box['idb']??=$box['title']?/option
  ?php } ?

-- teodor 

-- 
PHP Development 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-DEV] Bug #10309: feature request

2001-04-12 Thread teo

Hi fabiankessler!
On Thu, 12 Apr 2001, [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 Operating system: all
 PHP version:  4.0.4
 PHP Bug Type: Feature/Change Request
 Bug description:  feature request
 
 $a = 'foo';
 $b = 'bar';
 
 $c = (true) ? $a : $b;
suggestions:

1.let $expr be the evaled expression, then you can use the same
criptic : $expr  $c=$a || $c=$b;

2.use a function returning a reference as a wrapper, if appliable


 
 = syntax error, have to do
 
 if (true) {
   $c = $a;
 } else {
   $c = $b;
 }
 
 would be nice :)
 
 
 -- 
 Edit Bug report at: http://bugs.php.net/?id=10309edit=1
 
 
 
 -- 
 PHP Development 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]
-- teodor

-- 
PHP Development 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-DEV] Unix timestamp maximum

2001-04-05 Thread teo

Hi Stanislav!
On Wed, 04 Apr 2001, Stanislav Malyshev wrote:

 AG By the time we close in on 2038 and UNIX is still around
 AG (*smile*) then most UNIX systems will most probably have moved
 AG to 64bit timestamps, thus requiring in the best place just a
 AG recompilation of your PHP binary and in the worse case if you
 AG saved binary file stamps to a file, some kind of conversion
 AG script. It's not as bad as the Y2K bug (which wasn't too bad:)
 
 Well, seeing that most Unix concepts are alive from 60-70th till today,
 they'll probably be there in 2038. And I'm not sure all systems will be
 upgraded by then. But I would probably be retired already by then, so why
 should I care? ;)
 
Haven't you seen "Cowboys in space?" 
you will be called back to save the world from Y-0x07f6 Bug!
:))

-- teodor

-- 
PHP Development 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-DEV] PHP 4.0 Bug #10179: repetition quantifiers

2001-04-05 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.0
PHP version:  4.0.4pl1
PHP Bug Type: PCRE related
Bug description:  repetition quantifiers

I am not sure if it's a bug or misinterpretation on my side
but I expect something like  /[0-9]{,10}/ to match
a number at most 10 chars.

the following snipet reproduces the "problem", if any:

if (preg_match('/^[0-9]{,10}$/',3)) {
echo "matched";
 } else {
echo "not matched";
}
outputs "not matched".

And if I write {1,10} it matches. So the question is,
is the "minimum" quantifier mandatory?

ciao


-- 
Edit Bug report at: http://bugs.php.net/?id=10179edit=1



-- 
PHP Development 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-DEV] PHP 4.0 Bug #9953 Updated: memory leak

2001-03-28 Thread teo

ID: 9953
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Duplicate
Bug Type: Scripting Engine problem
Description: memory leak



Previous Comments:
---

[2001-03-23 08:09:27] [EMAIL PROTECTED]
zend_hash.c(1032) :  Freeing 0x0824400C (17 bytes), 
script=/usr/local/cvsdevel/php/a/htdocs/index.php
Last leak repeated 14 times

How can I investigate further on this please and what does it actually mean.Thanks.

ciao

--teodor



---


Full Bug description available at: http://bugs.php.net/?id=9953


-- 
PHP Development 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-DEV] Leaking references

2001-03-28 Thread teo

Hi Wez!
On Wed, 28 Mar 2001, Wez Furlong wrote:

 [I can't reach the PHP web site (100% packet loss), so I can't open a bug
 report at this time]
 
 I have found a leak in the Zend engine:
 
 class A
 {
   var $t = null;
 
   function run($t)
   {
   $this-t = $t;
   return $this-t-run();
   }
 
 }
 
 class C   {
   var $obj = null;
 
   function load_and_run()
   {
   $this-obj =  new A;
   return $this-obj-run($this);
   }
 
   function run()
   {
   return "";
   }
 }
 
 function load_it()
 {
   $t = new C;
   echo $t-load_and_run();
 }
 
This example looks damn similar with some code I have and produced the
same warnings (#9953).
So I changed mine to duplicate.

-- teodor

-- 
PHP Development 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-DEV] PHP 4.0 Bug #9953: memory leak

2001-03-23 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.0
PHP version:  4.0.4pl1
PHP Bug Type: Scripting Engine problem
Bug description:  memory leak

zend_hash.c(1032) :  Freeing 0x0824400C (17 bytes), 
script=/usr/local/cvsdevel/php/a/htdocs/index.php
Last leak repeated 14 times

How can I investigate further on this please and what does it actually mean.Thanks.

ciao

--teodor




-- 
Edit Bug report at: http://bugs.php.net/?id=9953edit=1



-- 
PHP Development 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-DEV] PHP 4.0 Bug #9870 Updated: PHP dies with segfault when a post request has no content-type

2001-03-21 Thread teo

ID: 9870
User Update by: [EMAIL PROTECTED]
Status: Closed
Bug Type: HTTP related
Description: PHP dies with segfault when a post request has no content-type

K, thanks Jani

can you have a look/an opinion if this strstr() stuff
is not exploitable, given the fact that it's triggered
by malformed user data (in this case the post data) ?


Previous Comments:
---

[2001-03-20 09:19:49] [EMAIL PROTECTED]
This is fixed in CVS. A bit differently though.
The check for content_type_dup is put a bit earlier
so it doesn't even get into the handler if it's null.

Try the latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-03-20 09:06:01] [EMAIL PROTECTED]

[Tue Mar 20 15:09:20 2001] [error] PHP Warning:  No content-type in POST request in 
Unknown on line 0
Unknown(0) : Warning - No content-type in POST request

Program received signal SIGSEGV, Segmentation fault.
0x400c2073 in strstr () at ../sysdeps/generic/strstr.c:125
125 ../sysdeps/generic/strstr.c: No such file or directory.
(gdb) bt
#0  0x400c2073 in strstr () at ../sysdeps/generic/strstr.c:125
#1  0x401aef39 in rfc1867_post_handler () at rfc1867.c:426
#2  0x401abdd3 in sapi_handle_post () at SAPI.c:54
#3  0x401b0532 in php_treat_data () at php_variables.c:190
#4  0x401a9274 in php_hash_environment () at main.c:1039
#5  0x401a8836 in php_request_startup () at main.c:588
#6  0x401a4fa8 in apache_php_module_main () at sapi_apache.c:98
#7  0x401a5d69 in send_php () at mod_php4.c:433
#8  0x401a5db3 in send_parsed_php () at mod_php4.c:433
#9  0x8076669 in ap_invoke_handler ()
#10 0x808c05f in process_request_internal ()
#11 0x808c0d2 in ap_process_request ()
#12 0x8082c76 in child_main ()
#13 0x8082e55 in make_child ()
#14 0x8082fd6 in startup_children ()
#15 0x808365c in standalone_main ()
#16 0x8083eac in main ()
#17 0x40083a8e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93
(gdb) 

How to reproduce:
body
form action="/phpinfo.php" method="post" enctype="multipart/form-data"
Some text here:input type="text" name="v1"br
File here: input type="file" name="test"br
input type="submit"
/form
/body

Using Netscape on Linux, upload a file, then hit
reload (Meta-r) three times. NS will repost it only
two times, then complain /tmp/ns131323gibberish is not
found [a temp file in which it composes the multipart
post]

3rd time when you post it, it won't send proper Content-Type
header and hence the Warning.

The offending code is:
 boundary = strstr(content_type_dup, "boundary");
in main/rfc1867.c:441

Patch:
check content_type_dup for null before strstr()-ing it.
[suggestion]

--- rfc1867.c   Fri Dec  8 18:21:47 2000
+++ /tmp/rfc1867.c  Tue Mar 20 15:59:39 2001
@@ -438,6 +438,11 @@
return;
}

+   if (!content_type_dup) {
+   sapi_module.sapi_error(E_COMPILE_ERROR, "Missing headers in 
+multipart/form-data POST data");
+   return;
+   }
+
boundary = strstr(content_type_dup, "boundary");
if (!boundary || !(boundary=strchr(boundary, '='))) {
sapi_module.sapi_error(E_COMPILE_ERROR, "Missing boundary in 
multipart/form-data POST data");

have fun,
--teodor

---


Full Bug description available at: http://bugs.php.net/?id=9870


-- 
PHP Development 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-DEV] PHP 4.0 Bug #9870: PHP dies with segfault when a post request has no content-type

2001-03-20 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE7.0
PHP version:  4.0.4pl1
PHP Bug Type: HTTP related
Bug description:  PHP dies with segfault when a post request has no content-type


[Tue Mar 20 15:09:20 2001] [error] PHP Warning:  No content-type in POST request in 
Unknown on line 0
Unknown(0) : Warning - No content-type in POST request

Program received signal SIGSEGV, Segmentation fault.
0x400c2073 in strstr () at ../sysdeps/generic/strstr.c:125
125 ../sysdeps/generic/strstr.c: No such file or directory.
(gdb) bt
#0  0x400c2073 in strstr () at ../sysdeps/generic/strstr.c:125
#1  0x401aef39 in rfc1867_post_handler () at rfc1867.c:426
#2  0x401abdd3 in sapi_handle_post () at SAPI.c:54
#3  0x401b0532 in php_treat_data () at php_variables.c:190
#4  0x401a9274 in php_hash_environment () at main.c:1039
#5  0x401a8836 in php_request_startup () at main.c:588
#6  0x401a4fa8 in apache_php_module_main () at sapi_apache.c:98
#7  0x401a5d69 in send_php () at mod_php4.c:433
#8  0x401a5db3 in send_parsed_php () at mod_php4.c:433
#9  0x8076669 in ap_invoke_handler ()
#10 0x808c05f in process_request_internal ()
#11 0x808c0d2 in ap_process_request ()
#12 0x8082c76 in child_main ()
#13 0x8082e55 in make_child ()
#14 0x8082fd6 in startup_children ()
#15 0x808365c in standalone_main ()
#16 0x8083eac in main ()
#17 0x40083a8e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93
(gdb) 

How to reproduce:
body
form action="/phpinfo.php" method="post" enctype="multipart/form-data"
Some text here:input type="text" name="v1"br
File here: input type="file" name="test"br
input type="submit"
/form
/body

Using Netscape on Linux, upload a file, then hit
reload (Meta-r) three times. NS will repost it only
two times, then complain /tmp/ns131323gibberish is not
found [a temp file in which it composes the multipart
post]

3rd time when you post it, it won't send proper Content-Type
header and hence the Warning.

The offending code is:
 boundary = strstr(content_type_dup, "boundary");
in main/rfc1867.c:441

Patch:
check content_type_dup for null before strstr()-ing it.
[suggestion]

--- rfc1867.c   Fri Dec  8 18:21:47 2000
+++ /tmp/rfc1867.c  Tue Mar 20 15:59:39 2001
@@ -438,6 +438,11 @@
return;
}

+   if (!content_type_dup) {
+   sapi_module.sapi_error(E_COMPILE_ERROR, "Missing headers in 
+multipart/form-data POST data");
+   return;
+   }
+
boundary = strstr(content_type_dup, "boundary");
if (!boundary || !(boundary=strchr(boundary, '='))) {
sapi_module.sapi_error(E_COMPILE_ERROR, "Missing boundary in 
multipart/form-data POST data");

have fun,
--teodor


-- 
Edit Bug report at: http://bugs.php.net/?id=9870edit=1



-- 
PHP Development 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-DEV] PHP 4.0 Bug #9781: sig 11

2001-03-16 Thread teo

From: [EMAIL PROTECTED]
Operating system: SuSE 7.0
PHP version:  4.0.4pl1
PHP Bug Type: Output Control
Bug description:  sig 11 

Sorry for the terse note but I am in the stress of finishing
a project and have no time to produce a reproducing script.
The code it's too complicated. [hope to come back later
with a sample]

configure line as per phpinfo():
 '--enable-versioning' '--with-mysql' '--with-pgsql'
'--disable-pic' '--with-dom' '--with-ldap=/usr'
 '--enable-trans-sid' '--enable-wddx' '--with-shmop' '--with-mm' 
'--enable-memory-limit' '--with-sablot'
--with-mnogosearch' '--enable-sockets' '--with-zlib' '--enable-debug'

Here are the log notice and bt:

[Fri Mar 16 12:35:45 2001] [notice] child pid 27350 exit signal Segmentation fault (11)
[Fri Mar 16 12:36:05 2001] [notice] caught SIGTERM, shutting down
[Fri Mar 16 12:36:48 2001]  Script:  '/usr/local/cvsdevel/php/a/htdocs/index.php'
---
zend_execute_API.c(261) : Block 0x08159370 status:
zend_variables.c(62) : Actual location (location was relayed)
Beginning:  Cached (allocated on var.c:475, 13 bytes)
  End:  OK
---
FATAL:  erealloc():  Unable to allocate 1515878401 bytes

Program received signal SIGSEGV, Segmentation fault.
0x40089ac1 in __kill () from /lib/libc.so.6
(gdb) bt
#0  0x40089ac1 in __kill () from /lib/libc.so.6
#1  0x401c86e1 in objects () at zend_alloc.c:535
#2  0x40292025 in php_ob_allocate () at output.c:226
#3  0x402917fc in php_ob_append (text=0x0, text_length=1515870810) at output.c:260
#4  0x40291956 in php_b_body_write (str=0x0, str_length=1515870810) at output.c:337
#5  0x4029134a in objects () at output.c:53
#6  0x401f7e26 in php_body_write_wrapper (str=0x0, str_length=1515870810) at main.c:682
#7  0x401e22db in objects () at zend.c:116
#8  0x401e225c in objects () at zend.c:116
#9  0x401e1d04 in objects () at zend_variables.c:147
#10 0x401e247c in objects () at zend.c:116
#11 0x401e232c in objects () at zend.c:116
#12 0x401e1f8b in print_hash (ht=0x8159544, indent=12) at zend.c:107
#13 0x401e23e2 in objects () at zend.c:116
#14 0x401e232c in objects () at zend.c:116
#15 0x401e1f8b in print_hash (ht=0x815a2b4, indent=4) at zend.c:107
#16 0x401e2462 in objects () at zend.c:116
#17 0x401e232c in objects () at zend.c:116
#18 0x40254d30 in objects () at basic_functions.c:1815
#19 0x401d3f8a in objects () at ./zend_execute.c:853
#20 0x401d4168 in objects () at ./zend_execute.c:853
#21 0x401d4168 in objects () at ./zend_execute.c:853
#22 0x401d4168 in objects () at ./zend_execute.c:853
#23 0x401e31a4 in objects () at zend.c:260
#24 0x401f8a7f in objects () at main.c:1128
#25 0x401f4a7c in objects () at sapi_apache.c:98
#26 0x401f5595 in objects () at mod_php4.c:439
#27 0x401f55d6 in objects () at mod_php4.c:439
#28 0x8076669 in ap_invoke_handler ()
#29 0x808c05f in process_request_internal ()
#30 0x808c0d2 in ap_process_request ()
#31 0x8082c76 in child_main ()
#32 0x8082e55 in make_child ()
#33 0x8082fd6 in startup_children ()
#34 0x808365c in standalone_main ()
#35 0x8083eac in main ()
#36 0x40083a8e in __libc_start_main () at ../sysdeps/generic/libc-start.c:93

I make use of nested output buffering and I guess it's
a problem somewhere there (str=0x0) with a null pointer :(

ciao

-- teodor


-- 
Edit Bug report at: http://bugs.php.net/?id=9781edit=1



-- 
PHP Development 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]