hello,
i'm writing a CGI/Perl script that does a checkout on a remote
repository (with pserver), on a linux box (redhat). as long as i do
this with the command line, no problem.
-----------------------------------
$ su
Password:
# su nobody (the user that will run the script)
bash$ export HOME=/tmp
bash$ export CVSROOT=:pserver:guest@hydra:/opt/cvs/cvsroot
bash$ cvs login
(Logging in to guest@hydra)
CVS password: *******
bash$ cat /tmp/.cvspass
:pserver:guest@hydra:/opt/cvs/cvsroot A.......
bash$ mkdir /tmp/cvs && cd /tmp/cvs
bash$ cvs checkout mymodule
cvs server: Updating mymodule
U mymodule/main.cc
bash$
------------------------------------
here is now the (simple) script that tries to do the same thing:
the idea here is that i do not want to login anymore so,
. i don't logout
. i copy the ".cvspass" in /tmp in case it's not here, not to log
in
(not in the code below)
====================================
#!/usr/bin/perl -w
$ENV{CVSROOT} = ":pserver:guest\@hydra:/opt/cvs/cvsroot";
$ENV{HOME} = "/tmp";
$ENV{CVS_PASSFILE} = "/tmp/.cvspass";
$cmde = "cd /tmp/cvs && cvs -t checkout mymodule 2>
/tmp/checkout.err";
print "Checkout command: $cmde \n";
`$cmde`;
====================================
and the result:
------------------------------------
bash$ ./docheckout.pl
Checkout command: cd /tmp/cvs && cvs -t checkout mymodule
2> /tmp/checkout.err
bash$ ls /tmp/cvs
bash$ cat /tmp/checkout.err
cvs checkout: notice: main loop with
CVSROOT=:pserver:guest@hydra:/opt/cvs/cvsroot
cvs checkout: cannot find password
cvs [checkout aborted]: use "cvs login" to log in first
bash$ cat /tmp/.cvspass
:pserver:guest@hydra:/opt/cvs/cvsroot A.......
bash$
------------------------------------
the package is cvs-1.10.7-7
thanks in advance for your suggestions,
olivier