Re: cvs: php-src(PHP_5_2) /ext/posix posix.c /ext/standard filestat.c
| From: | Hannes Magnusson | Date: | Thu, 11 Jan 2007 09:24:47 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_2) /ext/posix posix.c /ext/standard filestat.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-42669@lists.php.net to get a copy of this message | ||
Hi Sara
This still doesn't fix it (at least on FreeBSD 6.2-prerelease) since
_SC_GETPW_R_SIZE_MAX is defined but simply not implemented yet :(
-Hannes
(p.s.; you missed one in main/safe_mode.c)
On 1/11/07, Sara Golemon <pollita@php.net> wrote:
pollita Thu Jan 11 02:33:07 2007 UTCModified files: (Branch: PHP_5_2) /php-src/ext/standard filestat.c /php-src/ext/posix posix.cLog: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.8.2.7&r2=1.136.2.8.2.8&diff_format=u Index: php-src/ext/standard/filestat.c diff -u php-src/ext/standard/filestat.c:1.136.2.8.2.7 php-src/ext/standard/filestat.c:1.136.2.8.2.8--- php-src/ext/standard/filestat.c:1.136.2.8.2.7 Mon Jan 1 09:36:08 2007 +++ php-src/ext/standard/filestat.c Thu Jan 11 02:33:07 2007@@ -16,7 +16,7 @@+----------------------------------------------------------------------+*/ -/* $Id: filestat.c,v 1.136.2.8.2.7 2007/01/01 09:36:08 sebastian Exp $ */ +/* $Id: filestat.c,v 1.136.2.8.2.8 2007/01/11 02:33:07 pollita Exp $ */ #include "php.h" #include "safe_mode.h" @@ -454,7 +454,7 @@} convert_to_string_ex(filename); if (Z_TYPE_PP(user) == IS_STRING) {-#ifdef HAVE_GETPWNAM_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)struct passwd pw; struct passwd *retpwptr = NULL; int pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);http://cvs.php.net/viewvc.cgi/php-src/ext/posix/posix.c?r1=1.70.2.3.2.10&r2=1.70.2.3.2.11&diff_format=u Index: php-src/ext/posix/posix.c diff -u php-src/ext/posix/posix.c:1.70.2.3.2.10 php-src/ext/posix/posix.c:1.70.2.3.2.11--- php-src/ext/posix/posix.c:1.70.2.3.2.10 Mon Jan 1 09:36:05 2007+++ php-src/ext/posix/posix.c Thu Jan 11 02:33:07 2007 @@ -16,7 +16,7 @@+----------------------------------------------------------------------+*/ -/* $Id: posix.c,v 1.70.2.3.2.10 2007/01/01 09:36:05 sebastian Exp $ */ +/* $Id: posix.c,v 1.70.2.3.2.11 2007/01/11 02:33:07 pollita Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -147,7 +147,7 @@ static PHP_MINFO_FUNCTION(posix) {php_info_print_table_start(); - php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3.2.10 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.70.2.3.2.11 $"); php_info_print_table_end();} /* }}} */ @@ -932,7 +932,7 @@struct passwd *pw; char *name; int name_len;-#ifdef HAVE_GETPWNAM_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)struct passwd pwbuf; int buflen; char *buf;@@ -942,7 +942,7 @@RETURN_FALSE; }-#ifdef HAVE_GETPWNAM_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)buflen = sysconf(_SC_GETPW_R_SIZE_MAX); buf = emalloc(buflen); pw = &pwbuf;@@ -965,7 +965,7 @@php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array"); RETVAL_FALSE; }-#ifdef HAVE_GETPWNAM_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)efree(buf);#endif } @@ -976,7 +976,7 @@ PHP_FUNCTION(posix_getpwuid) {long uid;-#ifdef HAVE_GETPWUID_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)struct passwd _pw; struct passwd *retpwptr = NULL; int pwbuflen;@@ -988,7 +988,7 @@if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &uid) == FAILURE) { RETURN_FALSE; }-#ifdef HAVE_GETPWUID_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)pwbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); pwbuf = emalloc(pwbuflen);@@ -1012,7 +1012,7 @@php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array"); RETVAL_FALSE; }-#ifdef HAVE_GETPWUID_R +#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)efree(pwbuf);#endif } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php