You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2001/03/24 05:22:37 UTC
cvs commit: apr/include apr_errno.h apr_file_info.h
wrowe 01/03/23 20:22:37
Modified: include apr_errno.h apr_file_info.h
Log:
Declarations required for the new apr_filepath_merge implementation
Revision Changes Path
1.57 +12 -0 apr/include/apr_errno.h
Index: apr_errno.h
===================================================================
RCS file: /home/cvs/apr/include/apr_errno.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- apr_errno.h 2001/03/17 15:58:10 1.56
+++ apr_errno.h 2001/03/24 04:22:36 1.57
@@ -208,6 +208,10 @@
* platform, either because nobody has gotten to it yet,
* or the function is impossible on this platform.
* APR_EMISMATCH Two passwords do not match.
+ * APR_EABSOLUTE The given path was absolute.
+ * APR_ERELATIVE The given path was relative.
+ * APR_EINCOMPLETE The given path was neither relative nor absolute.
+ * APR_EABOVEROOT The given path was above the root path.
* </PRE>
*
* @param status The APR_status code to check.
@@ -239,6 +243,10 @@
#define APR_EBADMASK (APR_OS_START_ERROR + 17)
/* empty slot: +18 */
#define APR_EDSOOPEN (APR_OS_START_ERROR + 19)
+#define APR_EABSOLUTE (APR_OS_START_ERROR + 20)
+#define APR_ERELATIVE (APR_OS_START_ERROR + 21)
+#define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
+#define APR_EABOVEROOT (APR_OS_START_ERROR + 23)
/* APR ERROR VALUE TESTS */
@@ -261,6 +269,10 @@
#define APR_STATUS_IS_EBADMASK(s) ((s) == APR_EBADMASK)
/* empty slot: +18 */
#define APR_STATUS_IS_EDSOOPEN(s) ((s) == APR_EDSOOPEN)
+#define APR_STATUS_IS_EABSOLUTE(s) ((s) == APR_EABSOLUTE)
+#define APR_STATUS_IS_ERELATIVE(s) ((s) == APR_ERELATIVE)
+#define APR_STATUS_IS_EINCOMPLETE(s) ((s) == APR_EINCOMPLETE)
+#define APR_STATUS_IS_EABOVEROOT(s) ((s) == APR_EABOVEROOT)
/* APR STATUS VALUES */
1.14 +46 -1 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- apr_file_info.h 2001/02/16 04:15:43 1.13
+++ apr_file_info.h 2001/03/24 04:22:36 1.14
@@ -246,7 +246,9 @@
/**
* Read the next entry from the specified directory.
- * @param thedir the directory descriptor to read from, and fill out.
+ * @param finfo the file info structure and filled in by apr_dir_read
+ * @param wanted The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values
+ * @param thedir the directory descriptor returned from apr_dir_open
* @tip All systems return . and .. as the first two files.
* @deffunc apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir)
*/
@@ -260,6 +262,49 @@
*/
APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
+/* apr_filepath flags
+ */
+
+/* Cause apr_filepath_merge to fail if addpath is above rootpath */
+#define APR_FILEPATH_NOTABOVEROOT 0x01
+
+/* internal: Only meaningful with APR_FILEPATH_NOTABOVEROOT */
+#define APR_FILEPATH_SECUREROOTTEST 0x02
+
+/* Cause apr_filepath_merge to fail if addpath is above rootpath,
+ * even given a rootpath /foo/bar and an addpath ../bar/bash
+ */
+#define APR_FILEPATH_SECUREROOT 0x03
+
+/* Fail apr_filepath_merge if the merged path is relative */
+#define APR_FILEPATH_NOTRELATIVE 0x04
+
+/* Fail apr_filepath_merge if the merged path is absolute */
+#define APR_FILEPATH_NOTABSOLUTE 0x08
+
+/* Cleans all ambigious /./ or // segments
+ * if the target is a directory */
+#define APR_FILEPATH_CANONICAL 0x10
+
+/* Resolve the true case of existing directories and file elements
+ * of addpath, and append a proper trailing slash if a directory
+ */
+#define APR_FILEPATH_TRUENAME 0x20
+
+
+/**
+ * Merge additional file path onto the previously processed rootpath
+ * @param newpath the merged paths returned
+ * @param rootpath the root file path (NULL uses the current working path)
+ * @param addpath the path to add to the root path
+ * @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)
+ */
+APR_DECLARE(apr_status_t)
+ apr_filepath_merge(char **newpath, const char *rootpath,
+ const char *addpath, apr_int32_t flags,
+ apr_pool_t *p);
#ifdef __cplusplus
}