wrowe 2002/12/28 12:41:58
Modified: include apr_file_info.h
file_io/win32 filepath.c
Log:
Grudgingly accept that folks may want to merge paths containing wildcard
characters... fail similarly to ENOENT/ENOTDIR, where we return the path
but emit the error as a precaution. Folks interested in the results of
an invalid path merge need to look for those APR_STATUS_IS_xxx() results.
Revision Changes Path
1.36 +5 -0 apr/include/apr_file_info.h
Index: apr_file_info.h
===================================================================
RCS file: /home/cvs/apr/include/apr_file_info.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- apr_file_info.h 17 Dec 2002 01:07:00 -0000 1.35
+++ apr_file_info.h 28 Dec 2002 20:41:57 -0000 1.36
@@ -373,6 +373,11 @@
* @param flags the desired APR_FILEPATH_ rules to apply when merging
* @param p the pool to allocate the new path string from
* @deffunc apr_status_t apr_filepath_merge(char **newpath, const char
*rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p)
+ * @remark if the flag APR_FILEPATH_TRUENAME is given, and the addpath
+ * contains wildcard characters ('*', '?') on platforms that don't support
+ * such characters within filenames, the paths will be merged, but the
+ * result code will be APR_EPATHWILD, and all further segments will not
+ * reflect the true filenames including the wildcard and following segments.
*/
APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
const char *rootpath,
1.31 +8 -1 apr/file_io/win32/filepath.c
Index: filepath.c
===================================================================
RCS file: /home/cvs/apr/file_io/win32/filepath.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- filepath.c 12 Dec 2002 07:02:36 -0000 1.30
+++ filepath.c 28 Dec 2002 20:41:58 -0000 1.31
@@ -952,9 +952,16 @@
if (rv != APR_SUCCESS) {
if (APR_STATUS_IS_ENOENT(rv))
break;
+ if (APR_STATUS_IS_EPATHWILD(rv))
+ /* This path included wildcards. The path elements
+ * that did not contain wildcards are canonicalized,
+ * so we will return the path, although later elements
+ * don't necessarily exist, and aren't canonical.
+ */
+ break;
else if (APR_STATUS_IS_ENOTDIR(rv))
/* This is a little more serious, we just added a name
- * onto a filename (think http's CGI MORE_INFO)
+ * onto a filename (think http's PATH_INFO)
* If the caller is foolish enough to do this, we expect
* the've already canonicalized the root) that they knew
* what they are doing :(