iliaa           Wed Feb  2 18:43:17 2005 EDT

  Modified files:              
    /php-src/main       fopen_wrappers.c 
  Log:
  Fixed bug #31514 (open_basedir uses path_translated rather then cwd for .
  translation).
  
  
http://cvs.php.net/diff.php/php-src/main/fopen_wrappers.c?r1=1.171&r2=1.172&ty=u
Index: php-src/main/fopen_wrappers.c
diff -u php-src/main/fopen_wrappers.c:1.171 php-src/main/fopen_wrappers.c:1.172
--- php-src/main/fopen_wrappers.c:1.171 Thu Sep 23 11:43:54 2004
+++ php-src/main/fopen_wrappers.c       Wed Feb  2 18:43:17 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: fopen_wrappers.c,v 1.171 2004/09/23 15:43:54 hyanantha Exp $ */
+/* $Id: fopen_wrappers.c,v 1.172 2005/02/02 23:43:17 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -96,24 +96,11 @@
        char resolved_name[MAXPATHLEN];
        char resolved_basedir[MAXPATHLEN];
        char local_open_basedir[MAXPATHLEN];
-       int local_open_basedir_pos;
        int resolved_basedir_len;
        int resolved_name_len;
        
        /* Special case basedir==".": Use script-directory */
-       if ((strcmp(basedir, ".") == 0) && 
-               SG(request_info).path_translated &&
-               *SG(request_info).path_translated
-               ) {
-               strlcpy(local_open_basedir, SG(request_info).path_translated, 
sizeof(local_open_basedir));
-               local_open_basedir_pos = strlen(local_open_basedir) - 1;
-
-               /* Strip filename */
-               while (!IS_SLASH(local_open_basedir[local_open_basedir_pos])
-                               && (local_open_basedir_pos >= 0)) {
-                       local_open_basedir[local_open_basedir_pos--] = 0;
-               }
-       } else {
+       if (strcmp(basedir, ".") || !VCWD_GETCWD(local_open_basedir, 
MAXPATHLEN)) {
                /* Else use the unmodified path */
                strlcpy(local_open_basedir, basedir, 
sizeof(local_open_basedir));
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to