You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Enno <bu...@xs4all.nl> on 2006/04/18 17:32:22 UTC
SVN::Client problem under mp2
Hey list,
I ran into a nasty problem with SVN::Client under mp2.0.2. I simply want
it to connect to an ssl svn server with a specified username and password.
When I run the needed code from cmdline, everything works perfect, but
when I try to run it using an mp2 handler, it craps out with the following
errormessage:
Bogus filename: Can't open config file '/root/.subversion/servers' at
/srv/www/modules/testhandler.pm line 28
the code:
--
sub handler($) {
my $r = shift;
$r->content_type('text/plain');
print "BLA\n";
my $ctx = new SVN::Client(
auth => [
SVN::Client::get_simple_provider(),
SVN::Client::get_simple_prompt_provider(\&_simple_prompt,2),
SVN::Client::get_ssl_server_trust_prompt_provider(\&_trust_callback),
]
);
print "BLA2\n";
return Apache2::Const::OK;
}
sub _trust_callback {
my ($cred,$realm,$ifailed,$server_cert_info,$may_save) = @_;
$cred->accepted_failures($SVN::Auth::SSL::UNKNOWNCA);
}
sub _simple_prompt {
my ($cred, $realm, $default_username, $may_save, $pool) = @_;
$cred->username($svn_user);
$cred->password($svn_pass);
}
--
anyone know a solution?
Thanks in advance ;)
Enno
PS: I'm running the following:
- Apache/2.0.49 (Linux/SuSE)
- mod_ssl/2.0.49
- OpenSSL/0.9.7d
- mod_python/3.1.3
- Python/2.3.3
- DAV/2
- SVN/1.2.3
- PHP/4.3.4
- mod_perl/2.0.2
- Perl/v5.8.3
Re: SVN::Client problem under mp2
Posted by Enno <bu...@xs4all.nl>.
No, ofcourse my apache does not have access to /root, it is why I wrote
the _simple_prompt provider. It should take care of that. which it does
from the cmdline, as I dont even have a ~/.subversion dir on the server in
question.
Enno
On Tue, 18 Apr 2006, Tom Schindl wrote:
> Has the user your apache is running in permissions to:
> - directory
> - file
> ?
>
> Tom
>
>
Re: SVN::Client problem under mp2
Posted by Tom Schindl <to...@gmx.at>.
Has the user your apache is running in permissions to:
- directory
- file
?
Tom
Re: SVN::Client problem under mp2
Posted by Enno <bu...@xs4all.nl>.
found the cause of the problem, apache 2.0.49 + mp 2.0.2 doesnt properly
change userid after start, eventhough effective userid is set properly,
the users homedir is still set to /root (under modperl)
svn::client tries to read a (useless) config file from ~/.subversion/
if it cant find it (ENOENT), its ok, but if it looks under /root, you'll
get a permission denied (EACCES), and svn libraries raise an exception.
now the weird problem, it works properly on a different box with an old
modperl (1.99_09), running on apache 2.0.54.
so I dont know if this is a problem with an older apache, or with a new
modperl2.
if anyone had similar problems with this (change effective userid), you
might be able to tell me if this is caused by apache or modperl.
thanks in advance.
Enno
On Tue, 18 Apr 2006, Enno wrote:
>
>
> On Tue, 18 Apr 2006, Tom Schindl wrote:
>
> > Enno wrote:
> > > Hey list,
> > >
> > > I ran into a nasty problem with SVN::Client under mp2.0.2. I simply want
> > > it to connect to an ssl svn server with a specified username and password.
> > >
> > > When I run the needed code from cmdline, everything works perfect, but
> > > when I try to run it using an mp2 handler, it craps out with the following
> > > errormessage:
> > >
> > > Bogus filename: Can't open config file '/root/.subversion/servers' at
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > That's really not what you may intent and your os knows how to prevent
> > you from apache reading files in /roots-HomeDir you should move this to
> > another location.
> >
> > > /srv/www/modules/testhandler.pm line 28
> > >
>
> yeah, but the it shouldnt even try to read that file... also, that
> path/file is not even present in the svn perl modules...
>
> so its gotta be somewhere in the C source, going to check that out
> tomorrow.
>
> Enno
>
>
>
Re: SVN::Client problem under mp2
Posted by Enno <bu...@xs4all.nl>.
On Tue, 18 Apr 2006, Tom Schindl wrote:
> Enno wrote:
> > Hey list,
> >
> > I ran into a nasty problem with SVN::Client under mp2.0.2. I simply want
> > it to connect to an ssl svn server with a specified username and password.
> >
> > When I run the needed code from cmdline, everything works perfect, but
> > when I try to run it using an mp2 handler, it craps out with the following
> > errormessage:
> >
> > Bogus filename: Can't open config file '/root/.subversion/servers' at
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> That's really not what you may intent and your os knows how to prevent
> you from apache reading files in /roots-HomeDir you should move this to
> another location.
>
> > /srv/www/modules/testhandler.pm line 28
> >
yeah, but the it shouldnt even try to read that file... also, that
path/file is not even present in the svn perl modules...
so its gotta be somewhere in the C source, going to check that out
tomorrow.
Enno
Re: SVN::Client problem under mp2
Posted by Tom Schindl <to...@gmx.at>.
Enno wrote:
> Hey list,
>
> I ran into a nasty problem with SVN::Client under mp2.0.2. I simply want
> it to connect to an ssl svn server with a specified username and password.
>
> When I run the needed code from cmdline, everything works perfect, but
> when I try to run it using an mp2 handler, it craps out with the following
> errormessage:
>
> Bogus filename: Can't open config file '/root/.subversion/servers' at
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That's really not what you may intent and your os knows how to prevent
you from apache reading files in /roots-HomeDir you should move this to
another location.
> /srv/www/modules/testhandler.pm line 28
>