Re: Re: #18623 [Ver]: touch, fopen, fwrite don't work

From: Date: Tue, 30 Jul 2002 22:41:08 +0000
Subject: Re: Re: #18623 [Ver]: touch, fopen, fwrite don't work
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-86353@lists.php.net to get a copy of this message
At 00:09 31-7-2002, you wrote:
filename is already a char *, why are you casting it?
filestat.c:560: warning: passing arg 1 of `php_check_open_basedir' discards qualifiers from pointer target type (that's from PHP_4_2_0 but got the same warning for HEAD, different lineno, obviously). For current head, I have 152 lines of warnings, only if I disable ctype and mbstring, cause with those, php cli wan't even compile, so I'm on a hunt :-) Most of these are harmless though, got a bunch of: /data/mdev/_src/php-HEAD/ext/session/session.c:709: warning: implicit declaration of function `strcasecmp' AIX 4.3.3. This one looks a bit more disturbing: /data/mdev/_src/php-HEAD/ext/session/session.c:486: warning: long int format, time_t arg (arg 3) /data/mdev/_src/php-HEAD/ext/session/session.c:486: warning: long int format, suseconds_t arg (arg 4) time_t is a int32long64_t and suseconds_t is a signed int.
On Wed, 31 Jul 2002, Melvyn Sopacua wrote: Attached a test. Additionally I added a cast (char *) to line 360 to get rid of the compiler warning. Z_STRVAL_PP doesn't work there so I'm not actually sure this fix create more problems than it solves: Index: filestat.c =================================================================== RCS file: /repository/php4/ext/standard/filestat.c,v retrieving revision 1.101 diff -u -r1.101 filestat.c
--- filestat.c  30 Jul 2002 20:24:13 -0000      1.101
+++ filestat.c 30 Jul 2002 21:57:21 -0000 @@ -555,7 +555,8 @@
                 RETURN_FALSE;
         }
-       if (php_check_open_basedir(filename TSRMLS_CC)) {
+       if (php_check_open_basedir((char *) filename TSRMLS_CC)) {
+
                 RETURN_FALSE;
         }
At 22:51 30-7-2002, you wrote:
 ID:               18623
 Updated by:       nohn@php.net
 Reported By:      nohn@php.net
 Status:           Verified
 Bug Type:         Filesystem function related
Operating System: Compaq Tru64/Alpha
 PHP Version:      4CVS-2002-07-29
New Comment: I think, you meant this one (it's from sfox@php.net, not stef@php.net):
--- old_filestat.c      2002-07-28 23:35:50.000000000 +0000
+++ filestat.c 2002-07-30 17:16:48.000000000 +0000 @@ -481,9 +481,7 @@
        newtime = &newtimebuf;
        if (ac == 1 && zend_get_parameters_ex(1, &filename) != FAILURE)
{ -#ifndef HAVE_UTIME_NULL
                newtime->modtime = newtime->actime = time(NULL);
-#endif
        } else if (ac == 2 && zend_get_parameters_ex(2, &filename,
&filetime) != FAILURE) {
                convert_to_long_ex(filetime);
                newtime->actime = time(NULL);
---- and yes... It works fine. Tested with php4-200207301200 tested on Compaq Testdrive machine (a little bit slow, but it does what it should do). Full report here: http://www.nohn.net/lalafarm/php4-test-reports/4.3.0-dev-1028061991.xml
Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua
Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua

« previous php.dev (#86353) next »