bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org.netbeans.lib.cvsclient.connection.AuthenticationException


From: Mark D. Baushke
Subject: Re: org.netbeans.lib.cvsclient.connection.AuthenticationException
Date: Thu, 28 Sep 2006 02:22:17 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

It is considered a very bad idea to incorporate your passwords into the
CVSROOT specification. This will spread a copy of your password into
every CVS/Root file in the checked out tree.

The 'correct' way to do things is to perform a 'cvs login' which will
cache the password in the $HOME/.cvspass file in an encoded format (see
the CVS sources for scramble/unscramble if you are curious). Once the
initial 'login' has been performed, the password is obtained from the
file and not needed by your createConnection method.

It would probably be best to instruct the user to do the cvs login
outside of the java process as 'cvs login' calls the GNULIB getpass()
function which will try to write a prompt to STDERR and read the
password from /dev/tty on UNIX or via a loop reading via the _getch()
function if on Windows.

        Good luck,
        -- Mark

ruchira <address@hidden> writes:

> My code is this
> 
> public class CVS1{
>       public boolean createConnection(String userName,String
> encodedPassword,String hostName,String repository,String localPath) throws
> org.netbeans.lib.cvsclient.connection.AuthenticationException{
>               String cvsroot =
> ":pserver:"+userName+":"+encodedPassword+"@"+hostName+":"+repository;
>               System.out.println("cvsroot---------->"+cvsroot);
>   
>     try{
>         CVSRoot cvs = CVSRoot.parse(cvsroot);
>         System.out.println("what is parse cvsroot--------------->"+cvs);
>         PServerConnection c = new PServerConnection(cvs);
>         c.open();
>         GlobalOptions globalOptions = new GlobalOptions();
>         globalOptions.setCVSRoot(cvsroot);
> 
>         Client client = new Client(c, new StandardAdminHandler());
>         client.setLocalPath(localPath);
>         BasicListener list = new BasicListener();
>         client.getEventManager().addCVSListener(list);
>         return true;
>     }
>     catch (CommandAbortedException cae){
>         cae.printStackTrace();
>     }catch (NullPointerException ne){
>         ne.printStackTrace();
>     }
>       return false;
> }
> public static void main(String args[]){
>       CVS1 cvs1 =new CVS1();
>       
>       try {
>               boolean status
> =cvs1.createConnection("ruchiras","address@hidden","yagachi","\\testCv","C:\\Canarys\\workingDir");
>               System.out.println("helloooooooooo" +status);
>       } catch (org.netbeans.lib.cvsclient.connection.AuthenticationException 
> e) {
>               
>               e.printStackTrace();
>       }
>       
>       
> }
>       
> }
> 
> 
> 
> 
> 
> 
> 
> and this is giving output beacause it is taking address@hidden while server 
> name
> is yagachi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFFG5RJCg7APGsDnFERAtAzAKDj8zUeGU2ODcbtfbafzIZpBcswXgCfTIvW
qG9/Iyb8kHtUNNu9cuFykIg=
=nCuO
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]