* [PATCH] cvsserver: Correct inetd.conf example in asciidoc documentation
2007-05-27 12:33 Various git-cvsserver patches Frank Lichtenheld
@ 2007-05-27 12:33 ` Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Note that CVS_SERVER can also be specified as method variable Frank Lichtenheld
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Frank Lichtenheld @ 2007-05-27 12:33 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld
While the given example worked, it made us look rather
incompetent. Give the correct reason why one needs the
more complex syntax and change the example to reflect
that.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
Documentation/git-cvsserver.txt | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index d22844b..9f0d990 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -46,11 +46,13 @@ INSTALLATION
cvspserver stream tcp nowait nobody git-cvsserver pserver
------
-Note: In some cases, you need to pass the 'pserver' argument twice for
-git-cvsserver to see it. So the line would look like
+Note: Some inetd servers let you specify the name of the executable
+independently of the value of argv[0] (i.e. the name the program assumes
+it was executed with). In this case the correct line in /etc/inetd.conf
+looks like
------
- cvspserver stream tcp nowait nobody git-cvsserver pserver pserver
+ cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver
------
No special setup is needed for SSH access, other than having GIT tools
--
1.5.2-rc3.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] cvsserver: Note that CVS_SERVER can also be specified as method variable
2007-05-27 12:33 Various git-cvsserver patches Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Correct inetd.conf example in asciidoc documentation Frank Lichtenheld
@ 2007-05-27 12:33 ` Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Fix some typos in asciidoc documentation Frank Lichtenheld
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Frank Lichtenheld @ 2007-05-27 12:33 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld
Reasonably new versions of the cvs CLI client allow one to
specifiy CVS_SERVER as a method variable directly in
CVSROOT. This is way more convinient than using an
environment variable since it gets saved in CVS/Root.
Since I only discovered this by accident I guess there
might be others out there that learnt CVS on the 1.11
series (or even earlier) and profit from such a note
about cvs improvements in the last couple years.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
Documentation/git-cvsserver.txt | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index 9f0d990..ca7579d 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -57,7 +57,17 @@ looks like
------
No special setup is needed for SSH access, other than having GIT tools
in the PATH. If you have clients that do not accept the CVS_SERVER
-env variable, you can rename git-cvsserver to cvs.
+environment variable, you can rename git-cvsserver to cvs.
+
+Note: Newer cvs versions (>= 1.12.11) also support specifying
+CVS_SERVER directly in CVSROOT like
+
+------
+cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co <HEAD_name>
+------
+This has the advantage that it will be saved in your 'CVS/Root' files and
+you don't need to worry about always setting the correct environment
+variable.
--
2. For each repo that you want accessible from CVS you need to edit config in
the repo and add the following section.
--
1.5.2-rc3.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] cvsserver: Fix some typos in asciidoc documentation
2007-05-27 12:33 Various git-cvsserver patches Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Correct inetd.conf example in asciidoc documentation Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Note that CVS_SERVER can also be specified as method variable Frank Lichtenheld
@ 2007-05-27 12:33 ` Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] t9400: Work around CVS' deficiencies Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Handle 'cvs login' Frank Lichtenheld
4 siblings, 0 replies; 6+ messages in thread
From: Frank Lichtenheld @ 2007-05-27 12:33 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
Documentation/git-cvsserver.txt | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt
index ca7579d..e5005f0 100644
--- a/Documentation/git-cvsserver.txt
+++ b/Documentation/git-cvsserver.txt
@@ -86,7 +86,7 @@ write access to the log file and to the database (see
SSH, the users of course also need write access to the git repository itself.
[[configaccessmethod]]
-All configuration variables can also be overriden for a specific method of
+All configuration variables can also be overridden for a specific method of
access. Valid method names are "ext" (for SSH access) and "pserver". The
following example configuration would disable pserver access while still
allowing access over SSH.
@@ -128,7 +128,7 @@ Database Backend
git-cvsserver uses one database per git head (i.e. CVS module) to
store information about the repository for faster access. The
-database doesn't contain any persitent data and can be completly
+database doesn't contain any persistent data and can be completely
regenerated from the git repository at any time. The database
needs to be updated (i.e. written to) after every commit.
--
1.5.2-rc3.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] t9400: Work around CVS' deficiencies
2007-05-27 12:33 Various git-cvsserver patches Frank Lichtenheld
` (2 preceding siblings ...)
2007-05-27 12:33 ` [PATCH] cvsserver: Fix some typos in asciidoc documentation Frank Lichtenheld
@ 2007-05-27 12:33 ` Frank Lichtenheld
2007-05-27 12:33 ` [PATCH] cvsserver: Handle 'cvs login' Frank Lichtenheld
4 siblings, 0 replies; 6+ messages in thread
From: Frank Lichtenheld @ 2007-05-27 12:33 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld
If we are too fast with our changes, the file in
the working copy might still have the same mtime
as noted in the CVS/Entries. This will cause CVS
to happily report to the server that the file is
unmodified which can lead to data loss (and in
our case test failure).
CVS sucks!
Work around that by sleeping for a second.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
t/t9400-git-cvsserver-server.sh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 7f9c6e2..76a9b1a 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -250,6 +250,7 @@ test_expect_success 'cvs update (merge)' \
git commit -q -m "Merge test (merge)" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
+ sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
diff -q merge ../expected'
@@ -292,6 +293,7 @@ test_expect_success 'cvs update (merge no-op)' \
git commit -q -m "Merge test (no-op)" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
+ sleep 1 && touch merge &&
GIT_CONFIG="$git_config" cvs -Q update &&
diff -q merge ../merge'
--
1.5.2-rc3.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] cvsserver: Handle 'cvs login'
2007-05-27 12:33 Various git-cvsserver patches Frank Lichtenheld
` (3 preceding siblings ...)
2007-05-27 12:33 ` [PATCH] t9400: Work around CVS' deficiencies Frank Lichtenheld
@ 2007-05-27 12:33 ` Frank Lichtenheld
4 siblings, 0 replies; 6+ messages in thread
From: Frank Lichtenheld @ 2007-05-27 12:33 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld
Since this is a trivial variation of the general pserver
authentication, there is really no reason not to support
it.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
git-cvsserver.perl | 8 +++++---
t/t9400-git-cvsserver-server.sh | 29 +++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 1de5177..2b4825a 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -95,9 +95,10 @@ $state->{method} = 'ext';
if (@ARGV && $ARGV[0] eq 'pserver') {
$state->{method} = 'pserver';
my $line = <STDIN>; chomp $line;
- unless( $line eq 'BEGIN AUTH REQUEST') {
+ unless( $line =~ /^BEGIN (AUTH|VERIFICATION) REQUEST$/) {
die "E Do not understand $line - expecting BEGIN AUTH REQUEST\n";
}
+ my $request = $1;
$line = <STDIN>; chomp $line;
req_Root('root', $line) # reuse Root
or die "E Invalid root $line \n";
@@ -109,10 +110,11 @@ if (@ARGV && $ARGV[0] eq 'pserver') {
}
$line = <STDIN>; chomp $line; # validate the password?
$line = <STDIN>; chomp $line;
- unless ($line eq 'END AUTH REQUEST') {
- die "E Do not understand $line -- expecting END AUTH REQUEST\n";
+ unless ($line eq "END $request REQUEST") {
+ die "E Do not understand $line -- expecting END $request REQUEST\n";
}
print "I LOVE YOU\n";
+ exit if $request eq 'VERIFICATION'; # cvs login
# and now back to our regular programme...
}
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 76a9b1a..e9ef315 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -67,6 +67,22 @@ git
END AUTH REQUEST
EOF
+cat >login-anonymous <<EOF
+BEGIN VERIFICATION REQUEST
+$SERVERDIR
+anonymous
+
+END VERIFICATION REQUEST
+EOF
+
+cat >login-git <<EOF
+BEGIN VERIFICATION REQUEST
+$SERVERDIR
+git
+
+END VERIFICATION REQUEST
+EOF
+
test_expect_success 'pserver authentication' \
'cat request-anonymous | git-cvsserver pserver >log 2>&1 &&
tail -n1 log | grep -q "^I LOVE YOU$"'
@@ -80,6 +96,19 @@ test_expect_success 'pserver authentication failure (non-anonymous user)' \
fi &&
tail -n1 log | grep -q "^I HATE YOU$"'
+test_expect_success 'pserver authentication (login)' \
+ 'cat login-anonymous | git-cvsserver pserver >log 2>&1 &&
+ tail -n1 log | grep -q "^I LOVE YOU$"'
+
+test_expect_success 'pserver authentication failure (login/non-anonymous user)' \
+ 'if cat login-git | git-cvsserver pserver >log 2>&1
+ then
+ false
+ else
+ true
+ fi &&
+ tail -n1 log | grep -q "^I HATE YOU$"'
+
#--------------
# CONFIG TESTS
--
1.5.2-rc3.GIT
^ permalink raw reply related [flat|nested] 6+ messages in thread