You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Dominique Devienne <DD...@lgc.com> on 2005/05/06 22:01:00 UTC

Providing input with to CVS login

Suppose I want to CVS login to a bunch of CVS repos. I've written a XSL
that generates one target per-repo using code similar to the <exec>
below.

<?xml version="1.0"?>
<project>
  <exec executable="cvs" failonerror="true">
    <arg line="-d :pserver:foo@bar.lgc.com:/cvs/baz login" />
  </exec>
</project>

If I run this on Linux, it works! I.e. I type in the CVS password (which
is not echo'd on the screen BTW), press return, and I get build
successful. The output is a bit garbled, i.e. the prompt for the
password is followed by the info string that should be above. Appendix A
shows the actual output.

The same script on Windows, OTOH, doesn't work. I get the info message,
but whatever I type, nothing happens, and only when I CTRL-C Ant does
the 'CVS password: ' prompt appears, but it's too late. I tried both
terminate yes or no, to no avail.

I then tried to <input> the password (which appears clear text, but I
can live with that...), but then there's no way I can find to pass that
to the CVS login process. Which is confirmed on the command line
independently of Ant, as neither "echo cvspass | cvs -d CVSROOT login"
nor "cvs -d CVSROOT login < cvspassinsidefile" works.

So my question is two fold:
1) How comes it works on Linux and not Windows?
2) Is there any way to do a CVS login using Ant
   (that forks cvs) that would work across platform
   (assuming the cvs executable is in the path)

Any insight would be appreciated. Thanks, --DD

PS: Didn't someone do something about input Handling in Ant CVS?
    Does that go into Ant 1.6.4? And any chance it would held here?

--- Appendix A: providing good and bad password on Linux ---
ddevienne@gocad build> ant -f login.xml
Buildfile: login.xml
CVS password: Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz


BUILD SUCCESSFUL
Total time: 12 seconds
ddevienne@gocad build> ant -f login.xml
Buildfile: login.xml
CVS password: Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz

cvs login: authorization failed: server bar.lgc.com rejected access to
/cvs/baz for user baz

BUILD FAILED
/export/home/ddevienne/login.xml:3: exec returned: 1

Total time: 4 seconds
ddevienne@gocad build>


--- Appendix B: Trying to CVS login on Windows ---
P:\com_lgc>ant -f login.xml
Buildfile: login.xml
Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz
CVS password:
Terminate batch job (Y/N)? y

P:\com_lgc>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Providing input with to CVS login

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
Not directly related to your problem, but "cvs login" needs to be 
executed only once. Why do you want to run it from ANT?

- Alexey.

Dominique Devienne wrote:

>Suppose I want to CVS login to a bunch of CVS repos. I've written a XSL
>that generates one target per-repo using code similar to the <exec>
>below.
>
><?xml version="1.0"?>
><project>
>  <exec executable="cvs" failonerror="true">
>    <arg line="-d :pserver:foo@bar.lgc.com:/cvs/baz login" />
>  </exec>
></project>
>
>If I run this on Linux, it works! I.e. I type in the CVS password (which
>is not echo'd on the screen BTW), press return, and I get build
>successful. The output is a bit garbled, i.e. the prompt for the
>password is followed by the info string that should be above. Appendix A
>shows the actual output.
>
>The same script on Windows, OTOH, doesn't work. I get the info message,
>but whatever I type, nothing happens, and only when I CTRL-C Ant does
>the 'CVS password: ' prompt appears, but it's too late. I tried both
>terminate yes or no, to no avail.
>
>I then tried to <input> the password (which appears clear text, but I
>can live with that...), but then there's no way I can find to pass that
>to the CVS login process. Which is confirmed on the command line
>independently of Ant, as neither "echo cvspass | cvs -d CVSROOT login"
>nor "cvs -d CVSROOT login < cvspassinsidefile" works.
>
>So my question is two fold:
>1) How comes it works on Linux and not Windows?
>2) Is there any way to do a CVS login using Ant
>   (that forks cvs) that would work across platform
>   (assuming the cvs executable is in the path)
>
>Any insight would be appreciated. Thanks, --DD
>
>PS: Didn't someone do something about input Handling in Ant CVS?
>    Does that go into Ant 1.6.4? And any chance it would held here?
>
>--- Appendix A: providing good and bad password on Linux ---
>ddevienne@gocad build> ant -f login.xml
>Buildfile: login.xml
>CVS password: Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz
>
>
>BUILD SUCCESSFUL
>Total time: 12 seconds
>ddevienne@gocad build> ant -f login.xml
>Buildfile: login.xml
>CVS password: Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz
>
>cvs login: authorization failed: server bar.lgc.com rejected access to
>/cvs/baz for user baz
>
>BUILD FAILED
>/export/home/ddevienne/login.xml:3: exec returned: 1
>
>Total time: 4 seconds
>ddevienne@gocad build>
>
>
>--- Appendix B: Trying to CVS login on Windows ---
>P:\com_lgc>ant -f login.xml
>Buildfile: login.xml
>Logging in to :pserver:foo@bar.lgc.com:2401/cvs/baz
>CVS password:
>Terminate batch job (Y/N)? y
>
>P:\com_lgc>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>  
>

-- 
------------------------------------------------------------------------
/ Alexey N. Solofnenko
home: http://trelony.cjb.net/
/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Providing input with to CVS login

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 6 May 2005, Dominique Devienne <DD...@lgc.com> wrote:

> If I run this on Linux, it works!

Probably because cvs on Linux doesn't use stdin at all.  It most
likely reads from /dev/tty directly.

> The same script on Windows, OTOH, doesn't work.

Because it tries stdin - I guess.

> I then tried to <input> the password (which appears clear text, but
> I can live with that...), but then there's no way I can find to pass
> that to the CVS login process.

<cvspass>?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org