Re: cvs: php-src(PHP_5_3) /main safe_mode.c
| From: | Jani Taskinen | Date: | Thu, 11 Oct 2007 08:21:53 +0000 |
| Subject: | Re: cvs: php-src(PHP_5_3) /main safe_mode.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-46634@lists.php.net to get a copy of this message | ||
As usual, newbies don't really seem to know this:
Please read README.CVS-RULES and CODING_STANDARDS files in your
checkout. This is the second time I have to touch a file after you.
--Jani
On Wed, 2007-10-10 at 22:52 +0000, Robert Thompson wrote:
> ab5602 Wed Oct 10 22:52:59 2007 UTC
> Modified files: (Branch: PHP_5_3)
> /php-src/main safe_mode.c
> Log:
>
> Fix for bug 41899, safe mode and relative paths with Solaris's broken getcwd().
>
>
>
> http://cvs.php.net/viewvc.cgi/php-src/main/safe_mode.c?r1=1.62.2.1.2.10&r2=1.62.2.1.2.10.2.1&diff_format=u
> Index: php-src/main/safe_mode.c
> diff -u php-src/main/safe_mode.c:1.62.2.1.2.10 php-src/main/safe_mode.c:1.62.2.1.2.10.2.1
> --- php-src/main/safe_mode.c:1.62.2.1.2.10 Sun Sep 23 15:19:21 2007
> +++ php-src/main/safe_mode.c Wed Oct 10 22:52:58 2007
> @@ -16,7 +16,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: safe_mode.c,v 1.62.2.1.2.10 2007/09/23 15:19:21 iliaa Exp $ */
> +/* $Id: safe_mode.c,v 1.62.2.1.2.10.2.1 2007/10/10 22:52:58 ab5602 Exp $ */
>
> #include "php.h"
>
> @@ -86,7 +86,15 @@
> * If that fails, passthrough and check directory...
> */
> if (mode != CHECKUID_ALLOW_ONLY_DIR) {
> - expand_filepath(filename, path TSRMLS_CC);
> +
> + char ftest[MAXPATHLEN];
> + strcpy(ftest,filename);
> + if (VCWD_GETCWD(ftest, sizeof(ftest)) == NULL) {
> + strcpy(path,filename);
> + } else {
> + expand_filepath(filename, path TSRMLS_CC);
> + }
> +
> ret = VCWD_STAT(path, &sb);
> if (ret < 0) {
> if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) {
>
--
Patches/Donations: http://pecl.php.net/~jani/