There is no special configuration for the cvs access via ssh. But for pserver you have to add this entry for the pserver in your inetd.conf
cvspserver stream tcp nowait root /usr/sbin/tcpd /usr/bin/cvs \ -b /usr/bin --allow-root=SF_ROOT/cvs pserverYou'll need to launch killall -HUP inetd in a root shell.
As for the genuine SourceForge, we'll need to make some modifications to CVS. These have been done by Gavin Walker that I thank a lot for his help. Go in the src directory of the CVS sources and apply this patch (you can find it in misc/cvs_patch.diff) :
--- root.c.orig Sun Mar 7 21:17:02 1999 +++ root.c Thu Dec 14 11:53:55 2000 @@ -261,9 +261,34 @@ } for (i = 0; i < root_allow_count; ++i) - if (strcmp (root_allow_vector[i], arg) == 0) + if (strncmp (root_allow_vector[i], arg, strlen (root_allow_vector[i]) ) == 0 + && root_allow_ok_match(&arg[strlen(root_allow_vector[i])], "^/[a-zA-Z][a-zA-Z0-9 -]+$")) return 1; return 0; +} + +/* + * Match string against the extended regular expression in + * pattern, treating errors as no match. + * + * return 1 for match, 0 for no match + */ + +int +root_allow_ok_match (char * string, char * pattern) +{ + int status; + regex_t re; + + if (regcomp(&re, pattern, REG_EXTENDED|REG_NOSUB) != 0) { + return 0; /* report error */ + } + status = regexec(&re, string, (size_t) 0, NULL, 0); + regfree(&re); + if (status != 0) { + return 0; /* report error */ + } + return 1; } /* This global variable holds the global -d option. It is NULL if -d
SourceForge uses CVSWeb to allow its users to browse their CVS repositories. But its developpers have slightly modified it so we will have make some modifications for our own needs. I've modified version 1.79. So if you are running another version, you maybe have to hack CVSWeb to make it work.
I suggest you configure /etc/cvsweb.conf like this
%CVSROOT = ( # Uncomment next line and modify the path if you have only one CVS repository. 'Whatever-CVS' => 'SF_ROOT/cvs', ); # This tree is enabled by default when # you enter the page $cvstreedefault = 'Whatever-CVS';%DEFAULTVALUE{"hidecvsroot"} should be set to 1 too.
Here is the diff between the upstream version of CVSWeb and "mine"
--- cvsweb Fri Jul 7 06:00:01 2000 +++ cvswebsf.cgi Thu Nov 2 13:47:16 2000 @@ -260,10 +260,16 @@ # alternate CVS-Tree, configured in cvsweb.conf if ($input{'cvsroot'}) { - if ($CVSROOT{$input{'cvsroot'}}) { - $cvstree = $input{'cvsroot'}; - $cvsroot = $CVSROOT{"$cvstree"}; - } +# if ($CVSROOT{$input{'cvsroot'}}) { +# $cvstree = $input{'cvsroot'}; +# $cvsroot = $CVSROOT{"$cvstree"}; + $input{'cvsroot'} =~ s/\.//g; # we do not like dots + if ( -d ($CVSROOT{"$cvstree"} . "/" . $input{'cvsroot'}) ) + { + $cvsroot = $CVSROOT{"$cvstree"} . "/" . $input{'cvsroot'}; + } else { + &fatal("500 Internal Error", + "<strong>no such project</strong>"); + } } # create icons out of description