Skip Menu |

This queue is for tickets about the Cvs CPAN distribution.

Report information
The Basics
Id: 2885
Status: new
Priority: 0/
Queue: Cvs

People
Owner: Nobody in particular
Requestors: alex.starr [...] st.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.01
Fixed in: (no value)



Subject: login to pserver fails when password needs to be given.
When you create a new object with a pserver cvsroot, it will fail if there is not already an account in the users ~/.cvspass file, even if a password is given. What fails: my $cvs = new Cvs ('/tmp/cvstmpdir' , cvsroot => ':pserver:alex@my.cvs.server:/path/to/repository', password => 'secret' ) or die $Cvs::ERROR; It doesn't die here, but after trying: my $status = $cvs->checkout('myfile'); printf "Success: %s Error: %s", $status->success, $status->error; the output is: "Success: 0 Error: pserver login failure" What works: If I do from the commandline: cvs -d :pserver:alex@my.cvs.server:/path/to/repository login (Logging in to alex@my.cvs.server) CVS password: <I enter secret> Then if I run the same code again, I don't get the error and the checkout completes successfully. I inserted two lines of debugging code into the Login.pm module, so that the init function becomes as shown below. The DEBUG:1 does get printed (with correct password), but DEBUG:2 never does get printed. It's almost like it's not seeing the interactive password prompt issued by cvs? Some versions of modules I'm using: IPC-Run-0.75 IO-Tty-1.02 Class-Accessor-0.18 perl 5.8.0 uname -a: SunOS jordan 5.8 Generic_108528-03 sun4u sparc SUNW,Sun-Blade-1000 regards, Alex. --------------------------------------------------------------- sub init { my($self, $param) = @_; $self->SUPER::init(@_) or return; $self->default_params(cvsroot => undef); $self->param($param); $self->command('login'); my $result = new Cvs::Result::Login; $self->result($result); my $cvsroot; if(defined $self->param->{cvsroot}) { $cvsroot = new Cvs::Cvsroot $self->param->{cvsroot}, %$param; $self->cvsroot($cvsroot); } elsif(defined $self->cvs->cvsroot()) { $cvsroot = $self->cvs->cvsroot(); } else { $result->success(0); $result->error('No cvsroot to login on, please define one.'); $self->command(undef); } my $main = $self->new_context(); $self->initial_context($main); print "DEBUG:1 password |" . $cvsroot->password() . "|"; $main->push_handler ( qr/^CVS password/, sub { print "DEBUG:2 password |" . $cvsroot->password() . "|"; $self->send($cvsroot->password()."\n"); } ); $main->push_handler ( qr/can only use .login. command with the .pserver. method/, sub { # do not fail if login was used with bad method, we don't care $result->success(1); $main->finish(); } ); return $self; }
From: Olivier Poitrey <rs [...] rhapsodyk.net>
[guest - Wed Jul 2 09:16:08 2003]: Show quoted text
> When you create a new object with a pserver cvsroot, it will fail if > there is not already an account in the users ~/.cvspass file, even if > a password is given.
I've tried your code and it works, see my debug output : ** Chdir to: /tmp/ Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -d :pserver:opoitrey@novae:/home/cvs checkout -d cvstmpdir
finweb-V3 ** new chunk << cvs checkout: authorization failed: server novae rejected access to /home/cvs for user opoitrey\n ** unmatched line: cvs checkout: authorization failed: server novae rejected acc ess to /home/cvs for user opoitrey\n << cvs checkout: used empty password; try "cvs login" with a real password\n ** Chdir to: /tmp/cvstmpdir Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -d :pserver:opoitrey@novae:/home/cvs login
** new chunk << Logging in to :pserver:opoitrey@novae:2401/home/cvs\n ** unmatched line: Logging in to :pserver:opoitrey@novae:2401/home/cvs\n ** new chunk << CVS password: Show quoted text
>> ******
So, if a user access denied append, it send the cvs login command as expected. So, can you give me the full debug log ? (with debug => 1 at constuctor).
From: alex.starr [...] st.com
I've written a small script to test this out and I'm still getting the failure. I've attached the script. Output when I have not logged into the cvsroot (ie not in ~/.cvspass): alex@jordan [bin:807]% ./test_cvs_login ** Chdir to: /tmp/ Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t checkout -d rubbish tool/dev ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n ** unmatched line: cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n << cvs checkout: used empty password; try "cvs login" with a real password\n ** Chdir to: /tmp/rubbish Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t login ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << (Logging in to alex@jordan.cma.st.com)\n ** unmatched line: (Logging in to alex@jordan.cma.st.com)\n test_cvs_login: login failure: pserver login failure Now the output when I have previously done a cvs login, so no password would be needed: ** Chdir to: /tmp/ Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t checkout -d rubbish tool/dev ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << cvs server: Updating rubbish\n ** unmatched line: cvs server: Updating rubbish\n ** new chunk << cvs server: Updating rubbish/bin\n ..... test_cvs_login: login ok
#!/bin/sh exec perl -w -x $0 "$@" #! # -*- perl -*- # The above is some magic startup to work on sh,Solaris and bash,Linux # see perlrun docs for info on magic startup. #NOTE: hack to inc path. use lib "/design/rmc/tools/ajs/support/dev/perllib"; use Cvs; my $cvsarea = "/tmp/rubbish"; my $cvsroot = ':pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroot'; my $password = 'secret'; my $cvs = new Cvs ("$cvsarea" , cvsroot => "$cvsroot" , password => "$password", debug => 1) or die $Cvs::ERROR; $status = $cvs->checkout('tool/dev'); if ($status->success) { print "test_cvs_login: login ok\n"; } else { printf "test_cvs_login: login failure: %s\n", $status->error; }
From: alex.starr [...] st.com
cvs version I'm using: Concurrent Versions System (CVS) 1.11 (client/server)
From: alex.starr [...] st.com
I've just upgraded to cvs 1.11.6 It still fails, but with slightly different output: alex@jordan [bin:851]% ./test_cvs_login ** Chdir to: /tmp/ Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t checkout -d rubbish tool/dev ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n ** unmatched line: cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n << cvs checkout: used empty password; try "cvs login" with a real password\n ** Chdir to: /tmp/rubbish Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t login ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << Logging in to :pserver:alex@jordan.cma.st.com:2401/design/rmc/tools/alex_test_env/c vsroot\n ** unmatched line: Logging in to :pserver:alex@jordan.cma.st.com:2401/design/rmc/tools/alex_test_env/c vsroot\n << cvs [login aborted]: login: Failed to read password.: No such device or address\n test_cvs_login: login failure: pserver login failure
From: alex.starr [...] st.com
I've just upgraded to cvs 1.11.6 It still fails, but with slightly different output: alex@jordan [bin:851]% ./test_cvs_login ** Chdir to: /tmp/ Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t checkout -d rubbish tool/dev ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n ** unmatched line: cvs checkout: authorization failed: server jordan.cma.st.com rejected access to /design/rmc/tools/alex_test_env/cvsroot for user alex\n << cvs checkout: used empty password; try "cvs login" with a real password\n ** Chdir to: /tmp/rubbish Binding CVSROOT handlers CVSROOT access method is: pserver Show quoted text
>> cvs -f -
d :pserver:alex@jordan.cma.st.com:/design/rmc/tools/alex_test_env/cvsroo t login ** new chunk Use of uninitialized value in string eq at /design/rmc/tools/ajs/support/dev/perllib/Cvs/Command/Base.pm line 147. << Logging in to :pserver:alex@jordan.cma.st.com:2401/design/rmc/tools/alex_test_env/c vsroot\n ** unmatched line: Logging in to :pserver:alex@jordan.cma.st.com:2401/design/rmc/tools/alex_test_env/c vsroot\n << cvs [login aborted]: login: Failed to read password.: No such device or address\n test_cvs_login: login failure: pserver login failure