
gozer at apache
Mar 9, 2006, 12:17 PM
Post #1 of 1
(1029 views)
Permalink
|
|
svn commit: r384597 - in /perl/modperl/docs/trunk/src/docs/2.0/api/Apache2: Access.pod CmdParms.pod RequestUtil.pod
|
|
Author: gozer Date: Thu Mar 9 12:17:36 2006 New Revision: 384597 URL: http://svn.apache.org/viewcvs?rev=384597&view=rev Log: Document the new override_opts as well as the optionnal 4th argument to the various add_config() methods. Submitted-By: Torsten Foertsch <torsten.foertsch [at] gmx> Reviewed-By: Gozer Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/Access.pod perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/CmdParms.pod perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/Access.pod URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/Access.pod?rev=384597&r1=384596&r2=384597&view=diff ============================================================================== --- perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/Access.pod (original) +++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/Access.pod Thu Mar 9 12:17:36 2006 @@ -20,6 +20,9 @@ # Apache AllowOverride value $allow_override = $r->allow_overrides(); + # which Options are allowed by AllowOverride (since Apache 2.2) + $allow_override_opts = $r->allow_override_opts(); + # auth name ("foo bar") $auth_name = $r->auth_name(); @@ -193,6 +196,54 @@ use Apache2::Const -compile => qw(:override); $r->allow_overrides & Apache2::Const::OR_AUTHCFG; # TRUE $r->allow_overrides & Apache2::Const::OR_LIMIT; # FALSE + + + + + + +=head2 C<allow_override_opts> + +Retrieve the bitmask of allowed C<Options> set by C<AllowOverride Options=...> +for this request + + $override_opts = $r->allow_override_opts(); + +Enabling single options was introduced in Apache 2.2. For Apache 2.0 this +function returns +C<L<Apache2::Const::OPT_UNSET|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_UNSET_>> | +C<L<Apache2::Const::OPT_ALL|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_ALL_>> | +C<L<Apache2::Const::OPT_INCNOEXEC|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_INCNOEXEC_>> | +C<L<Apache2::Const::OPT_SYM_OWNER|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_SYM_OWNER_>> | +C<L<Apache2::Const::OPT_MULTI|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_MULTI_>>, +which corresponds to the default value (if not set) for Apache 2.2. + +=over 4 + +=item obj: C<$r> +( C<L<Apache2::RequestRec object|docs::2.0::api::Apache2::RequestRec>> ) + +The current request + +=item ret: C<$override_opts> ( integer ) + +the override options bitmask. Normally used with bitlogic operators +against C<L<Apache2::Const :options +constants|docs::2.0::api::Apache2::Const/C__options_>>. + +=item since: 2.0.3 + +=back + +For example if the configuration for the current request was: + + AllowOverride Options=Indexes,ExecCGI + +The following applies: + + use Apache2::Const -compile => qw(:options); + $r->allow_override_opts & Apache2::Const::OPT_EXECCGI; # TRUE + $r->allow_override_opts & Apache2::Const::OPT_SYM_LINKS; # FALSE Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/CmdParms.pod URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/CmdParms.pod?rev=384597&r1=384596&r2=384597&view=diff ============================================================================== --- perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/CmdParms.pod (original) +++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/CmdParms.pod Thu Mar 9 12:17:36 2006 @@ -48,6 +48,9 @@ # which allow-override bits are set $override = $parms->override; + # which Options are allowed by AllowOverride (since Apache 2.2) + $override = $parms->override_opts; + # the path this command is being invoked in $path = $parms->path; @@ -306,6 +309,37 @@ unless ($wanted == $masked) { die "..."; } + + + + + + + +=head2 C<override_opts> + +Which options are allowed to be overridden by C<.htaccess> files. This is +set by C<AllowOverride Options=...>. + + $override_opts = $parms->override_opts; + +Enabling single options was introduced with Apache 2.2. For Apache 2.0 this +function simply returns a bitmask with all options allowed. + +=over 4 + +=item obj: C<$parms> +( C<L<Apache2::CmdParms object|docs::2.0::api::Apache2::CmdParms>> ) + +=item ret: C<$override_opts> ( bitmask ) + +the bitmask, which can be tested against +C<L<Apache2::Const :options +constants|docs::2.0::api::Apache2::Const/C__override_>>. + +=item since: 2.0.3 + +=back Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod?rev=384597&r1=384596&r2=384597&view=diff ============================================================================== --- perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod (original) +++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache2/RequestUtil.pod Thu Mar 9 12:17:36 2006 @@ -109,6 +109,7 @@ $r->add_config($lines); $r->add_config($lines, $override); $r->add_config($lines, $override, $path); + $r->add_config($lines, $override, $path, $override_opts); Configuration directives are processed as if given in a C<E<lt>LocationE<gt>> block. @@ -123,8 +124,8 @@ An ARRAY reference containing configuration lines per element, without the new line terminators. -=item opt arg2: C<$override> ( C<L<APR::Const status -constant|docs::2.0::api::APR::Const>> ) +=item opt arg2: C<$override> ( C<L<Apache2::Const override +constant|docs::2.0::api::Apache2::Const>> ) Which allow-override bits are set @@ -137,11 +138,59 @@ This is the path of the C<E<lt>LocationE<gt>> block. Some directives need this, for example C<ProxyPassReverse>. +If an empty string is passed a C<NULL> pointer is passed further at C-level. +This is necessary to make something like this work: + + $r->add_config( [. + '<Directory />', + 'AllowOverride Options AuthConfig', + '</Directory>', + ], ~0, '' ); + +Note: C<AllowOverride> is valid only in directory context. + +B<Caution:> Some directives need a non-empty path otherwise they cause +segfaults. Thus, use the empty path with caution. + Default value is: C</> +=item opt arg4: C<$override_opts> ( C<L<Apache2::Const options +constant|docs::2.0::api::Apache2::Const>> ) + +Apache limits the applicable directives in certain situations with +C<AllowOverride>. With Apache 2.2 comes the possibility to enable or +disable single options, for example + + AllowOverride AuthConfig Options=ExecCGI,Indexes + +Internally, this directive is parsed into 2 bit fields that are represented +by the C<$override> and C<$override_opts> parameters to C<add_config>. +The above example is parsed into an C<$override> with 2 bits set, one for +C<AuthConfig> the other for C<Options> and an C<$override_opts> with +2 bits set for ExecCGI and Indexes. + +When applying other directives, for example C<AuthType> or C<Options> the +appropriate bits in C<$override> must be set. For the C<Options> directive +additionally C<$override_opts> bits must be set. + +The C<$override> and C<$override_opts> parameters to C<add_config> are +valid while applying C<$lines>. + +C<$override_opts> is new in Apache 2.2. The mod_perl implementation for +Apache 2.0 lets you pass the parameter but ignores it. + +Default for C<$override_opts> is: +C<L<Apache2::Const::OPT_UNSET|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_UNSET_>> | +C<L<Apache2::Const::OPT_ALL|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_ALL_>> | +C<L<Apache2::Const::OPT_INCNOEXEC|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_INCNOEXEC_>> | +C<L<Apache2::Const::OPT_SYM_OWNER|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_SYM_OWNER_>> | +C<L<Apache2::Const::OPT_MULTI|docs::2.0::api::Apache2::Const/C_Apache2__Const__OPT_MULTI_>> + +That means, all options are allowed. + =item ret: no return value -=item since: 2.0.00 +=item since: 2.0.00, C<$path> and C<$override_opts> since 2.0.3 =back @@ -150,10 +199,16 @@ For example: - use Apache2::ServerUtil (); - $r->add_config(['require valid-user']); + use Apache2::RequestUtil (); + use Apache2::Access (); + $r->add_config(['require valid-user']); + # this regards the current AllowOverride setting + $r->add_config(['AuthName secret', + 'AuthType Basic', + 'Options ExecCGI'], + $r->allow_override, $path, $r->allow_override_opts); --------------------------------------------------------------------- To unsubscribe, e-mail: docs-cvs-unsubscribe [at] perl For additional commands, e-mail: docs-cvs-help [at] perl
|