]> granicus.if.org Git - apache/commitdiff
add pool parameter to ap_is_directory and ap_is_rdirectory
authorAllan K. Edwards <ake@apache.org>
Fri, 5 Jan 2001 20:44:44 +0000 (20:44 +0000)
committerAllan K. Edwards <ake@apache.org>
Fri, 5 Jan 2001 20:44:44 +0000 (20:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87593 13f79535-47bb-0310-9956-ffa450edef68

include/httpd.h
modules/http/http_core.c
server/config.c
server/util.c

index 6b4a3791ada2be02c67d069ecf46d8f64442667f..fcb7503b3d60701a9d2925c4829300a5f52b51da 100644 (file)
@@ -1521,18 +1521,20 @@ AP_DECLARE(uid_t) ap_uname2id(const char *name);
 AP_DECLARE(gid_t) ap_gname2id(const char *name);
 /**
  * Given the name of an object in the file system determine if it is a directory
+ * @param p The pool to allocate out of 
  * @param name The name of the object to check
  * @return 1 if it is a directory, 0 otherwise
- * @deffunc int ap_is_rdirectory(const char *name)
+ * @deffunc int ap_is_rdirectory(apr_pool_t *p, const char *name)
  */
-AP_DECLARE(int) ap_is_rdirectory(const char *name);
+AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
 /**
  * Given the name of an object in the file system determine if it is a directory - this version is symlink aware
+ * @param p The pool to allocate out of 
  * @param name The name of the object to check
  * @return 1 if it is a directory, 0 otherwise
- * @deffunc int ap_is_directory(const char *name)
+ * @deffunc int ap_is_directory(apr_pool_t *p, const char *name)
  */
-AP_DECLARE(int) ap_is_directory(const char *name);
+AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
 /**
  * Given a pathname in file, extract the directory and chdir to that directory
  * @param file The file who's directory we wish to switch to
index c788bc7a3af6fc67ad8a04fb4e74092b783ff8a6..be30d82f731d423ac88291f4763a78745ab34cd3 100644 (file)
@@ -1193,7 +1193,7 @@ static const char *set_document_root(cmd_parms *cmd, void *dummy,
     }
 
     arg = ap_os_canonical_filename(cmd->pool, arg);
-    if (/* TODO: ap_configtestonly && ap_docrootcheck && */ !ap_is_directory(arg)) {
+    if (/* TODO: ap_configtestonly && ap_docrootcheck && */ !ap_is_directory(cmd->pool, arg)) {
        if (cmd->server->is_virtual) {
            ap_log_perror(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, cmd->pool,
                          "Warning: DocumentRoot [%s] does not exist",
@@ -1994,7 +1994,7 @@ static const char *set_server_root(cmd_parms *cmd, void *dummy,
 
     arg = ap_os_canonical_filename(cmd->pool, arg);
 
-    if (!ap_is_directory(arg)) {
+    if (!ap_is_directory(cmd->pool, arg)) {
         return "ServerRoot must be a valid directory";
     }
     ap_server_root = arg;
index ef965720336d2ec9816d9871e59b5594136b7d25..c1dfb9061a7c28a68f5c7e9bed8e4efd06f2b655 100644 (file)
@@ -1369,7 +1369,7 @@ void ap_process_resource_config(server_rec *s, const char *fname,
      * horrible loops).  If so, let's recurse and toss it back into
      * the function.
      */
-    if (ap_is_rdirectory(fname)) {
+    if (ap_is_rdirectory(ptemp, fname)) {
         apr_dir_t *dirp;
        int current;
        apr_array_header_t *candidates = NULL;
index d0a8056c9d63d38d9f51ca4be21d29378a2870a6..10d6b81fc88c316688ba73b5e7d31f755222d4ff 100644 (file)
@@ -1694,21 +1694,21 @@ AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s)
     return x;
 }
 
-AP_DECLARE(int) ap_is_directory(const char *path)
+AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *path)
 {
     apr_finfo_t finfo;
 
-    if (apr_stat(&finfo, path, NULL) == -1)
+    if (apr_stat(&finfo, path, p) == -1)
        return 0;               /* in error condition, just return no */
 
     return (finfo.filetype == APR_DIR);
 }
 
-AP_DECLARE(int) ap_is_rdirectory(const char *path)
+AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *path)
 {
     apr_finfo_t finfo;
 
-    if (apr_lstat(&finfo, path, NULL) == -1)
+    if (apr_lstat(&finfo, path, p) == -1)
        return 0;               /* in error condition, just return no */
 
     return (finfo.filetype == APR_DIR);