]> granicus.if.org Git - apache/commitdiff
Moved several CHANGES back to APR where they belonged in the first place,
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 28 Jan 2001 23:51:53 +0000 (23:51 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sun, 28 Jan 2001 23:51:53 +0000 (23:51 +0000)
  Adopt apr features for simplifing mod_userdir, and accept the new
  Win32/OS2 exceptions without hiccuping

  Also note a potentially serious flaw - others please review.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87902 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/mappers/mod_userdir.c

diff --git a/CHANGES b/CHANGES
index 7a770938f7062d6de2fa040310e33ecd6d00e5a7..fc93bbcedcc5871b9fe0665a15ce16fa4739ea11 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,14 +1,7 @@
 Changes with Apache 2.0b1
 
-  *) Corrected an OS2'ism of apr_get_home_directory.  OS2 now returns the
-     proper directory, including the user's name.
-
-  *) Removed private os2errno.h and integrated the OS2 network error codes
-     into apr_errno.h for optimized error tests (APR_STATUS_IS_EFOO(rv)).
-     [William Rowe]
-
-  *) Moved inclusion of <os2.h> header from multiple modules into apr.h
-     [William Rowe]
+  *) Adopt apr features for simplifing mod_userdir, and accept the new
+     Win32/OS2 exceptions without hiccuping.  [William Rowe]
 
   *) Replace configure --with-optim option by using and saving the
      environment variable OPTIM instead.  This is needed because configure
index 76845020aa4d8bf95343ffc6b0cab2146bc6403b..f093c995737b6bf66b5c77b9d84bfb160a03ba9a 100644 (file)
@@ -281,6 +281,7 @@ static int translate_userdir(request_rec *r)
     while (*userdirs) {
         const char *userdir = ap_getword_conf(r->pool, &userdirs);
         char *filename = NULL;
+        apr_status_t rv;
 
         if (ap_strchr_c(userdir, '*'))
             x = ap_getword(r->pool, &userdir, '*');
@@ -322,15 +323,10 @@ static int translate_userdir(request_rec *r)
             char *homedir;
 
             if (apr_get_home_directory(&homedir, w, r->pool) == APR_SUCCESS) {
-#ifdef OS2      /* XXX should this OS/2 logic move to APR? */
-                /* Need to manually add user name for OS/2 */
-                filename = apr_pstrcat(r->pool, homedir, w, "/", userdir, NULL);
-#else
                 filename = apr_pstrcat(r->pool, homedir, "/", userdir, NULL);
-#endif
             }
             else {
-                /* XXX old code ignored this error... */
+                return DECLINED;
             }
 #else
             return DECLINED;
@@ -343,11 +339,13 @@ static int translate_userdir(request_rec *r)
          * anyway, in the hope that some handler might handle it. This can be
          * used, for example, to run a CGI script for the user.
          */
-        if (filename && (!*userdirs || 
-            apr_stat(&statbuf, filename, 
-                     APR_FINFO_NORM, r->pool) == APR_SUCCESS)) {
+        if (filename && (!*userdirs 
+                      || ((rv = apr_stat(&statbuf, filename, APR_FINFO_NORM,
+                                         r->pool)) == APR_SUCCESS
+                                             || rv == APR_INCOMPLETE))) {
             r->filename = apr_pstrcat(r->pool, filename, dname, NULL);
-           /* when statbuf contains info on r->filename we can save a syscall
+           /* XXX: Does this walk us around FollowSymLink rules?
+             * When statbuf contains info on r->filename we can save a syscall
             * by copying it to r->finfo
             */
            if (*userdirs && dname[0] == 0)