I want to write a cgi to manager cvs ,just do checkout checkin ,...
but can not done .
we use ssh protect our cvs, it is like this
cat /bin/mycvs #!/bin/bash ssh -p 9000 $* #end
and my cgi have problem.. it is :
#!/usr/bin/perl #use strict; #)-: use CGI qw/:standard/; # configure my $cvspasswd = 'not_config_yet'; my $project = 'asd'; if(!defined($ENV{'CVSROOT'})) { $ENV{'CVSROOT'}=':ext:asdasd@192.168.0.5:/home/export/cvsroot' +; } if(!defined($ENV{'CVS_RSH'})) { $ENV{'CVS_RSH'}='/bin/mycvs'; } my $cvs ="cvs"; if (-e '/usr/bin/cvs') { $cvs="/usr/bin/cvs"; } # HTML PAGE my $page = new CGI; print $page->header(), $page->start_html("xxx"), $page->h1("xx"), $page->hr(), $page->h2("cvs commands"), $page->startform, $page->radio_group(-name =>'cmd', -values =>['checkout','checkin','commi +t'], -define =>'no', -linkbreak =>'true'), $page->submit("run","GO!"), $page->endform; # run cvs cmd if(param()){ my $cvscmd = param('cmd'); if($cvscmd == 'checkout') { print "Checking out, ples wait ...\n\n";# why always g +o here ????? }elsif(($cvscmd == 'checkin') ||($cvscmd == 'commit')) { print "$cvscmd is disabled now !"; exit 1; }else{ die "What are u doing?\n"; } die "can not open pipe: $!" unless defined(my $pid=open(DOCVS,"|$cvs $cvscmd $project")); $SIG{'PIPE'} = sub{ die "$cvs pipe broken";}; if ($pid) { my @pipere = <DOCVS>; my $line = join(/\n/,@pipere); $line =~s/\s//g; if ($line=~/yes\/no/) { print DOCVS 'yes'; }elsif($line=~/pass/){ print DOCVS $cvspasswd; } @pipere=();$line=""; @pipere=<DOCVS>; for $line (@pipere) { print "$line"; } } } $page->end_html();
ples help me !thx!

In reply to How to checkout cvs over CGI by k99

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.