From 19b98bc41afbf97cae0d20924c061e0e1fc96918 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sat, 28 Sep 2002 06:10:47 +0000 Subject: [PATCH] Allow the UserDir directive to accept a list of directories. This matches what Apache 1.3 does. Also add documentation for this feature. PR: 9299 Submitted by: Jay Ball git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97001 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 +++ docs/manual/mod/mod_userdir.html.en | 14 ++++++++++ docs/manual/mod/mod_userdir.xml | 14 ++++++++++ modules/mappers/mod_userdir.c | 3 --- modules/ssl/ssl_expr_parse.h | 42 ++++++++++++++--------------- 5 files changed, 52 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 46fdff9d8d..d4afb23b78 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.43 + *) Allow the UserDir directive to accept a list of directories. + This matches what Apache 1.3 does. Also add documentation for + this feature. [Jay Ball ] + *) New Module: mod_logio. adds the ability to log bytes sent and received. [Bojan Smojver ] diff --git a/docs/manual/mod/mod_userdir.html.en b/docs/manual/mod/mod_userdir.html.en index 941ce50542..305a421e87 100644 --- a/docs/manual/mod/mod_userdir.html.en +++ b/docs/manual/mod/mod_userdir.html.en @@ -104,5 +104,19 @@ UserDir enabled
UserDir disabled user4 user5 user6

+

It is also possible to specify alternative user directories. +If you use a command like:

+

+Userdir public_html /usr/web http://www.foo.com/ +

+

With a request for http://www.foo.com/~bob/one/two.html, will try to +find the page at ~bob/public_html/one/two.html first, then +/usr/web/bob/one/two.html, and finally it will send a redirect +to http://www.foo.com/bob/one/two.html.

+

If you add a redirect, it must be the last alternative in the list. +Apache cannot determine if the redirect succeeded or not, so if you have +the redirect earlier in the list, that will always be the alternative +that is used.

+

See also

\ No newline at end of file diff --git a/docs/manual/mod/mod_userdir.xml b/docs/manual/mod/mod_userdir.xml index ec0b519b3a..16daf9b5fd 100755 --- a/docs/manual/mod/mod_userdir.xml +++ b/docs/manual/mod/mod_userdir.xml @@ -114,6 +114,20 @@ UserDir enabled
UserDir disabled user4 user5 user6 +

It is also possible to specify alternative user directories. +If you use a command like:

+ +Userdir public_html /usr/web http://www.foo.com/ + +

With a request for http://www.foo.com/~bob/one/two.html, will try to +find the page at ~bob/public_html/one/two.html first, then +/usr/web/bob/one/two.html, and finally it will send a redirect +to http://www.foo.com/bob/one/two.html.

+

If you add a redirect, it must be the last alternative in the list. +Apache cannot determine if the redirect succeeded or not, so if you have +the redirect earlier in the list, that will always be the alternative +that is used.

+ public_html diff --git a/modules/mappers/mod_userdir.c b/modules/mappers/mod_userdir.c index e76b2fe1dd..2d0a271ae2 100644 --- a/modules/mappers/mod_userdir.c +++ b/modules/mappers/mod_userdir.c @@ -328,9 +328,6 @@ static int translate_userdir(request_rec *r) if (apr_get_home_directory(&homedir, w, r->pool) == APR_SUCCESS) { filename = apr_pstrcat(r->pool, homedir, "/", userdir, NULL); } - else { - return DECLINED; - } #else return DECLINED; #endif diff --git a/modules/ssl/ssl_expr_parse.h b/modules/ssl/ssl_expr_parse.h index 5378e2874c..64413c2b32 100644 --- a/modules/ssl/ssl_expr_parse.h +++ b/modules/ssl/ssl_expr_parse.h @@ -1,27 +1,25 @@ +#define T_TRUE 257 +#define T_FALSE 258 +#define T_DIGIT 259 +#define T_ID 260 +#define T_STRING 261 +#define T_REGEX 262 +#define T_REGEX_I 263 +#define T_FUNC_FILE 264 +#define T_OP_EQ 265 +#define T_OP_NE 266 +#define T_OP_LT 267 +#define T_OP_LE 268 +#define T_OP_GT 269 +#define T_OP_GE 270 +#define T_OP_REG 271 +#define T_OP_NRE 272 +#define T_OP_IN 273 +#define T_OP_OR 274 +#define T_OP_AND 275 +#define T_OP_NOT 276 typedef union { char *cpVal; ssl_expr *exVal; } YYSTYPE; -#define T_TRUE 257 -#define T_FALSE 258 -#define T_DIGIT 259 -#define T_ID 260 -#define T_STRING 261 -#define T_REGEX 262 -#define T_REGEX_I 263 -#define T_FUNC_FILE 264 -#define T_OP_EQ 265 -#define T_OP_NE 266 -#define T_OP_LT 267 -#define T_OP_LE 268 -#define T_OP_GT 269 -#define T_OP_GE 270 -#define T_OP_REG 271 -#define T_OP_NRE 272 -#define T_OP_IN 273 -#define T_OP_OR 274 -#define T_OP_AND 275 -#define T_OP_NOT 276 - - extern YYSTYPE ssl_expr_yylval; -- 2.40.0