From 4bfba1f4541e5e7ba959ec8b27b2dd5060cff35b Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 28 Jan 2001 23:51:53 +0000 Subject: [PATCH] Moved several CHANGES back to APR where they belonged in the first place, 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 | 11 ++--------- modules/mappers/mod_userdir.c | 18 ++++++++---------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 7a770938f70..fc93bbcedcc 100644 --- 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 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 diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index 76845020aa4..f093c995737 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -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) -- 2.47.3