You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Adi Fairbank <ad...@certsite.com> on 2000/11/18 00:50:11 UTC

Re: two identical directives in configuration (doc patch included)

Dave Kaufman wrote:
> 
> i belive it is.  in fact, i didn't realize specifing two require coditions (one group and one user) worked on *separate* lines :)
> 
> something like:
> 
> $Location{"blah"} = {
>   require => "group payer_manager, payer_group demo"
> };
> 
> should do the trick.
> 
> -dave


Thanks, that fixed it.

One thing I noticed through all this, is I think the mod_perl documentation is
wrong.. I don't think the following is supported...

  DirectoryIndex => [qw(index.html index.htm)],

... unless DirectoryIndex is a special case.


>From perl_config.c:

  1148  #define SECiter_list(t) \
  1149  { \
  1150      I32 i; \
  1151      for(i=0; i<=AvFILL(entries); i++) { \
  1152          SV *rv = *av_fetch(entries, i, FALSE); \
  1153          HV *nhv; \
  1154          if(!SvROK(rv) || (SvTYPE(SvRV(rv)) != SVt_PVHV)) \
  1155              croak("not a HASH reference!"); \
  1156          nhv = newHV(); \
  1157          hv_store(nhv, (char*)key, klen, SvREFCNT_inc(rv), FALSE); \
  1158          tab = nhv; \
  1159          t; \
  1160          SvREFCNT_dec(nhv); \
  1161      } \
  1162      entries = Nullav; \
  1163      continue; \
  1164  }


lines 1154-1155 will cause it to croak if any array value in entries is not a
hashref, so an arrayref of scalars (e.g. DirectoryIndex => [qw(index.html
index.htm)]) won't work.

Am I wrong here?  I did some simple tests which confirmed my suspicions, but I
may still be missing something.

Below is a documentation patch that I think will prevent other people's
confusion in the future:

Index: mod_perl.pod
===================================================================
RCS file: /home/cvspublic/modperl/mod_perl.pod,v
retrieving revision 1.20
diff -u -r1.20 mod_perl.pod
--- mod_perl.pod	2000/03/05 23:46:30	1.20
+++ mod_perl.pod	2000/11/17 23:18:54
@@ -618,7 +618,7 @@
      AuthUserFile => '/tmp/htpasswd',
      AuthType => 'Basic',
      AuthName => 'test',
-     DirectoryIndex => [qw(index.html index.htm)],	
+     DirectoryIndex => 'index.html index.htm',	
      Limit => {
 	 METHODS => 'GET POST',
 	 require => 'user dougm',