Hello Gregory, Monday, March 24, 2008, 2:28:00 PM, you wrote:
> Index: main/fopen_wrappers.c > =================================================================== > RCS file: /repository/php-src/main/fopen_wrappers.c,v > retrieving revision 1.175.2.3.2.13.2.9 > diff -u -r1.175.2.3.2.13.2.9 fopen_wrappers.c > --- main/fopen_wrappers.c 24 Mar 2008 09:30:41 -0000 > 1.175.2.3.2.13.2.9 > +++ main/fopen_wrappers.c 24 Mar 2008 13:24:34 -0000 > @@ -473,7 +473,15 @@ > > ptr = path; > while (ptr && *ptr) { > - end = strchr(ptr, DEFAULT_DIR_SEPARATOR); > + /* Check for stream wrapper */ > + int is_stream_wrapper = 0; > + > + for (p = ptr; isalnum((int)*p) || *p == '+' || *p == '-' || > *p == '.'; p++); > + if ((*p == ':') && (p - ptr > 1) && (p[1] == '/') && (p[2] == > '/')) { However how about: if ((p > ptr) && !memcmp(p, "://", 3)) { > + p += 2; > + is_stream_wrapper = 1; > + } [...] > @@ -511,6 +538,29 @@ > exec_fname_length + 1 + filename_length + 1 < MAXPATHLEN) > { > memcpy(trypath, exec_fname, exec_fname_length + 1); > memcpy(trypath+exec_fname_length + 1, filename, > filename_length+1); > + > + /* Check for stream wrapper */ > + for (p = trypath; isalnum((int)*p) || *p == '+' || *p > == '-' || *p == '.'; p++); > + if ((*p == ':') && (p - trypath > 1) && (p[1] == '/') > && (p[2] == '/')) { Same as above > + char *actual; > Index: main/php_streams.h > =================================================================== > RCS file: /repository/php-src/main/php_streams.h,v > retrieving revision 1.103.2.1.2.4.2.2 > diff -u -r1.103.2.1.2.4.2.2 php_streams.h > --- main/php_streams.h 31 Dec 2007 07:17:17 -0000 1.103.2.1.2.4.2.2 > +++ main/php_streams.h 24 Mar 2008 13:24:34 -0000 > @@ -511,6 +511,12 @@ > /* don't check allow_url_fopen and allow_url_include */ > #define STREAM_DISABLE_URL_PROTECTION 0x00002000 > > +/* assume the path passed in exists and is fully expanded, avoiding syscalls > */ > +#define ASSUME_REALPATH 0x00004000 > + > +/* assume the path passed in does not exist, and fail (plain wrapper only) */ > +#define REALPATH_FAILED 0x00008000 > + I think prefixinf with STREAMS_ would be good. > /* Antique - no longer has meaning */ > #define IGNORE_URL_WIN 0 > Best regards, Marcus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php