Bug 21657 - CVS Task - Not working with passfile
CVS Task - Not working with passfile
Status: RESOLVED FIXED
Product: Ant
Classification: Unclassified
Component: Documentation
1.6.2
PC All
: P3 normal (vote)
: 1.6.3
Assigned To: Ant Notifications List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2003-07-16 14:45 UTC by mura karu
Modified: 2014-02-17 13:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mura karu 2003-07-16 14:45:17 UTC
http://www.jguru.com/faq/view.jsp?EID=865508. The above link explains exactly 
the problem I am having. CVS task is not correctly picking up the password from 
the passfile. Could you update entry in Java Guru or on Apache. Thanks. Mura
Comment 1 Stefan Bodewig 2003-07-23 12:54:39 UTC
I've modified the example from jguru to use command="co" instead of "update -dP"
as I didn't have bsf checked out before that.  It works for me.

Maybe it is a case of cvspass not working on Windows?  Which version of cvs are
you using?

Can you compare a cvspass file created by <cvspass> with one created if you
manually cvs login?
Comment 2 mura karu 2003-07-23 14:43:54 UTC
The passfiles created are identical.

cvs version:
D:\Users\user1\java_home\projects\HEX\jaxb>cvs -version

Concurrent Versions System (CVS) 1.11 (client)

Copyright (c) 1989-2000 Brian Berliner, david d `zoo' zuhn,
                        Jeff Polk, and other authors

CVS may be copied only under the terms of the GNU General Public License,
a copy of which can be found with the CVS distribution kit.

Specify the --help option for further information about CVS

D:\Users\user1\java_home\projects\HEX\jaxb>

build.xml:
<target name="checkoutCVS">
   <cvspass cvsroot="${CVS_ROOT}" 
      passfile="${CVS_PASS_FILE}"   
      password="{CVS_PASSWORD}" />
      
   <cvs command="checkout"
     cvsRoot="${CVS_ROOT}"
     dest="${CVS_DEST_DIR}"
     passfile="${CVS_PASS_FILE}"
     package="${CVS_MODULE}"		
     failonerror="yes"
   />
</target>

output:

D:\Users\user1\java_home\projects\HEX\jaxb>ant -v checkoutCVS
Apache Ant version 1.5.3 compiled on April 16 2003
Buildfile: build.xml
Detected Java version: 1.4 in: D:\Apps\j2sdk1.4.0_01\jre
Detected OS: Windows NT
parsing buildfile build.xml with URI = 
file:D:/Users/user1/java_home/projects/HEX/jaxb/build.
xml
Project base dir set to: D:\Users\user1\java_home\projects\HEX\jaxb
Build sequence for target `checkoutCVS' is [checkoutCVS]
Complete build sequence is [checkoutCVS, copy, copyCVS, xmlgen, test, clean, 
dist, default, jaxbgen,
 build, init]

checkoutCVS:
      [cvs] Using cvs passfile: D:\Users\user1
\java_home\projects\HEX\jaxb\.cvspass
      [cvs] Executing 'cvs' with arguments:
      [cvs] '-d:pserver:ab@199.175.175.225:/export/home/cvs'
      [cvs] 'checkout'
      [cvs] 'etp/HEX'
      [cvs]
      [cvs] The ' characters around the executable and arguments are
      [cvs] not part of the command.
      [cvs]
      [cvs]
      [cvs] environment:
      [cvs]
      [cvs]     ANT_CMD_LINE_ARGS=-v checkoutCVS
      [cvs]     ANT_HOME=D:\Apps\jwsdp-1.1\apache-ant-1.5.3-1\bin\..
      [cvs]     COMPUTERNAME=RYATES
      [cvs]     ComSpec=C:\WINNT\system32\cmd.exe
      [cvs]     HOMEDRIVE=W:
      [cvs]     HOMEPATH=\user1
      [cvs]     HOMESHARE=\\spcwim1\users
      [cvs]     JAVA_HOME=D:\Apps\j2sdk1.4.0_01
      [cvs]     LOCALCLASSPATH=D:\Apps\j2sdk1.4.0_01
\lib\tools.jar;D:\Apps\jwsdp-1.1\apache-ant-1.5.
3-1\bin\..\lib\xml-apis.jar;D:\Apps\jwsdp-1.1\apache-ant-1.5.3-1
\bin\..\lib\xercesImpl.jar;D:\Apps\j
wsdp-1.1\apache-ant-1.5.3-1\bin\..\lib\optional.jar;D:\Apps\jwsdp-1.1\apache-
ant-1.5.3-1\bin\..\lib\
ant.jar;
      [cvs]     LOGONSERVER=\\SPCWIM2
      [cvs]     NUMBER_OF_PROCESSORS=1
      [cvs]     OPENEJB_HOME=D:\Apps\openejb-0.9.0
      [cvs]     OS=Windows_NT
      [cvs]     Os2LibPath=C:\WINNT\system32\os2\dll;
      [cvs]     Path=c:\dmi\win32\bin;C:\WINNT\system32;C:\WINNT;D:\PROGRA~1
\Tcl\bin;D:\Apps\j2sdk1.
4.0_01\bin;D:\Apps\batch;D:\Apps\Tcl\bin;D:\Apps\jwsdp-1.1\apache-ant-1.5.3-1
\bin;"D:\Apps\GNU\WinCv
s 1.2";D:\Apps\jwsdp-1.1\jwsdp-shared\bin
      [cvs]     PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
      [cvs]     PROCESSOR_ARCHITECTURE=x86
      [cvs]     PROCESSOR_IDENTIFIER=x86 Family 6 Model 8 Stepping 6, 
GenuineIntel
      [cvs]     PROCESSOR_LEVEL=6
      [cvs]     PROCESSOR_REVISION=0806
      [cvs]     PROMPT=$P$G
      [cvs]     SystemDrive=C:
      [cvs]     SystemRoot=C:\WINNT
      [cvs]     TALDIR=d:\apps\PLATTS\
      [cvs]     TEMP=C:\TEMP
      [cvs]     TMP=C:\TEMP
      [cvs]     USERDOMAIN=SPCHAR
      [cvs]     USERNAME=user1
      [cvs]     USERPROFILE=C:\WINNT\Profiles\user1
      [cvs]     WIN32DMIPATH=c:\dmi\win32
      [cvs]     windir=C:\WINNT
      [cvs]     _CLASSPATHCOMPONENT=D:\Apps\jwsdp-1.1\apache-ant-1.5.3-1
\bin\..\lib\xml-apis.jar
      [cvs]     _JAVACMD=D:\Apps\j2sdk1.4.0_01\bin\java.exe
      [cvs]     CVS_PASSFILE=D:\Users\user1\java_home\projects\HEX\jaxb\.cvspass

BUILD FAILED
file:D:/Users/user1/java_home/projects/HEX/jaxb/build.xml:207: 
java.io.IOException: CreatePro
cess: cvs -d:pserver:ab@199.175.175.225:/export/home/cvs checkout etp/HEX 
error=2
        at org.apache.tools.ant.taskdefs.AbstractCvsTask.runCommand
(AbstractCvsTask.java:351)
        at org.apache.tools.ant.taskdefs.AbstractCvsTask.execute
(AbstractCvsTask.java:404)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.io.IOException: CreateProcess: cvs -
d:pserver:ab@199.175.175.225:/export/home/cvs
checkout etp/HEX error=2
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Win32Process.java:63)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:550)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec
(Execute.java:646)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:416)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:427)
        at org.apache.tools.ant.taskdefs.AbstractCvsTask.runCommand
(AbstractCvsTask.java:339)
        ... 9 more
--- Nested Exception ---
java.io.IOException: CreateProcess: cvs -
d:pserver:ab@199.175.175.225:/export/home/cvs checkout et
p/HEX error=2
        at java.lang.Win32Process.create(Native Method)
        at java.lang.Win32Process.<init>(Win32Process.java:63)
        at java.lang.Runtime.execInternal(Native Method)
        at java.lang.Runtime.exec(Runtime.java:550)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec
(Execute.java:646)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:416)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:427)
        at org.apache.tools.ant.taskdefs.AbstractCvsTask.runCommand
(AbstractCvsTask.java:339)
        at org.apache.tools.ant.taskdefs.AbstractCvsTask.execute
(AbstractCvsTask.java:404)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 2 seconds
D:\Users\user1\java_home\projects\HEX\jaxb>
Comment 3 Stefan Bodewig 2003-07-30 12:30:23 UTC
Your build failure says that cvs cannot be executed (cvs.exe is not on your
PATH, I guess).  This failure is not related to cvspass at all AFAICS.
Comment 4 sebastien 2004-11-05 10:07:22 UTC
In fact, this bug is verified with CVSNT 2.0.58b, the <cvspass> command work 
fine with cvs from www.cvshome.org
Comment 5 Brad Clarke 2004-11-22 21:04:58 UTC
It's not a CVSNT bug but rather an intentional omission as they seem to prefer
storing passwords in the windows registry. For those like me who spent way too
much time trying to figure out a "supported" CVSNT workaround for this:

Instead of using the cvspass task and passfile attributes on your cvs task just
add the password to your repository path like so:

:pserver:USER:PASSWORD@server:/path/to/cvsroot

or I suppose you could put the passfile contents in the registry directly if you
needed to do it that way (for instance, if you only had access to a passfile and
not the password itself):

HKEY_CURRENT_USER\Software\cvsnt\cvspass

A note in the ant documentation for the cvs passfile attribute might be appropriate.
Comment 6 Stefan Bodewig 2005-03-14 12:05:47 UTC
Added CVSNT Notes to the manual.
Comment 7 sk 2013-05-16 11:09:43 UTC
What's the option for a linux guy working on a ext server.
ext doesn't allow to store password like the pserver

(In reply to comment #5)
> It's not a CVSNT bug but rather an intentional omission as they seem to
> prefer
> storing passwords in the windows registry. For those like me who spent way
> too
> much time trying to figure out a "supported" CVSNT workaround for this:
> 
> Instead of using the cvspass task and passfile attributes on your cvs task
> just
> add the password to your repository path like so:
> 
> :pserver:USER:PASSWORD@server:/path/to/cvsroot
> 
> or I suppose you could put the passfile contents in the registry directly if
> you
> needed to do it that way (for instance, if you only had access to a passfile
> and
> not the password itself):
> 
> HKEY_CURRENT_USER\Software\cvsnt\cvspass
> 
> A note in the ant documentation for the cvs passfile attribute might be
> appropriate.