Haroon Rafique wrote:
On Today at 2:42pm, SB=>Stas Bekman <[EMAIL PROTECTED]> wrote:

SB> > Comments are welcome. And we really should have a newline at the end of
SB> > ModPerl-Registry/t/conf/extra.conf.in
SB> SB> certainly, but does it break anything?
SB>


Hi Stas,

Doesn't break anything really, but when I was using the >> operator to tack on some directives at the end of this file not having the newline caused me some grief as the last line and my added line got stuck on the same line (oops that makes it a misspelled directive - sheepish grin :-))

Sure, please find all the files that miss the end lines and post a patch fixing them, which will gladly apply and try to remember to keeping them in place in the future.


SB> [...]
SB> SB> > +SetEnv TMPDIR /tmp
SB> SB> This is not a portable change. If you have a particular problem with
SB> regards to temp dir it needs to be solved where it arises (e.g. using
SB> File::Temp), but you don't tell what the problem is, so I can't give
SB> you a solution.


I really should spend more time explaining the issue rather than jumping to the solution. Thanks for listening. Here's the issue. As I mentioned Gentoo's pacakge mgmt. system has the capability to build/install as a non-root user. Somewhere down line during the tests, the following tests are failing when run under the non-root user.

modules/cgi....................NOK 3# Failed test 3 in modules/cgi.t at line 41
modules/cgi....................FAILED test 3 Failed 1/5 tests, 80.00% okay
modules/cgiupload..............NOK 1# Failed test 1 in modules/cgiupload.t at line 32
modules/cgiupload..............NOK 2# Failed test 2 in modules/cgiupload.t at line 32 fail #2
modules/cgiupload..............FAILED tests 1-2 Failed 2/2 tests, 0.00% okay


Looing at t/logs/error_log, we find:

[Wed Oct 01 18:15:18 2003] [error] (13)Permission denied: Couldn't unlink unix domain socket /var/run/cgisock
[Wed Oct 01 18:15:18 2003] [error] (98)Address already in use: Couldn't bind unix domain socket /var/run/cgisock
ACCESS DENIED unlink: /var/run/cgisock


As I mentioned earlier, the permissions for /var/run/cgisock are not accissible by the non-root user. In addition, it is a violation of the sandbox principle. My fix for ScriptSock was meant to appease mod_cgid into creating the cgisock in the logs directory instead which will make it self-contained and won't violate the sandbox.

In the case of SetEnv TMPDIR /tmp, CGI.pm uses /tmp as its temporary repository. Access to /tmp is again a violation of the sandbox. I agree that /tmp is not a portable solution but setting TMPDIR is the only way that I can think of to vary CGI.pm's behavior thru the httpd conf file. Perhaps, a kludge like:
SetEnv TMPDIR logs
would suffice. I believe CGI.pm cleans up after itself anyway.

I think you mix two to some extent unrelated problems together. Let's solve each problem apart.


1) the three tests above are failing due to the /tmp problem in the sandbox, right? I believe your proposal of using the logs dir is cool. However we want to add a comment of why we do that (self-contained?) and I don't think it'll work without using a fullpath. So it probably should be:

+ # keep everything self-contained, to avoid problems with sandboxes
+ SetEnv TMPDIR @t_logs@

running t/TEST -conf should expand @t_logs@ to its full path. To be consistent let's put it in both test suites and eventually we might merge it into Apache-Test so it'll do that by itself.

Does it solve the problem with failing tests? If so please post a patch that works for you.

Another alternative is to introduce a new directory for Apache-Test: t/tmp and a corresponding -tmp option to override the default, which is probably a cleaner solution in the long run.

SB> SB> > +ScriptSock logs/cgisock
SB> SB> We don't use mod_cgi in the mod_perl test suite. It's just a left-over
SB> from testing. Does this patch fix things for you?
SB>


Nope, the patch had no effect whatsoever in the tests not failing.

2) > [Wed Oct 01 18:15:18 2003] [error] (13)Permission denied: Couldn't unlink > unix domain socket /var/run/cgisock

I'm trying to understand why do we have this problem when we don't use mod_cgid. Is it because mod_cgid gets loaded?

but your patch sounds good to me. Again something to consider to merge into the Apache-Test autogenerator. In fact we should probably just do it. Will the following work:

<IfModule mod_cgid.c>
    ScriptSock logs/cgisock
<IfModule>



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to