From d1817d351ae37699891cbdbfbef1f7d89a9dd7c6 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 27 May 1998 16:55:49 +0000 Subject: If we are logging into a cvs pserver with the username of "anoncvs", and we have not done an explicit 'cvs login', then use a default password of "anoncvs". This allows things like: setenv CVSROOT :pserver:anoncvs@anoncvs.freebsd.org:/cvs cvs checkout src (without doing the normal 'cvs login' for pserver mode) but this runs over the :pserver: protocol rather than the more troublesome rsh. Naturally, the server had better be running in -R (readonly) mode :-) --- contrib/cvs/src/login.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'contrib/cvs/src') diff --git a/contrib/cvs/src/login.c b/contrib/cvs/src/login.c index 4ffce36..0a74f37 100644 --- a/contrib/cvs/src/login.c +++ b/contrib/cvs/src/login.c @@ -293,6 +293,9 @@ get_cvs_password () FILE *fp; char *passfile; int line_length; + int anoncvs; + + anoncvs = (strcmp(CVSroot_username, "anoncvs") == 0); /* If someone (i.e., login()) is calling connect_to_pserver() out of context, then assume they have supplied the correct, scrambled @@ -333,6 +336,10 @@ get_cvs_password () fp = CVS_FOPEN (passfile, "r"); if (fp == NULL) { + if (anoncvs) { + free (passfile); + return strdup("Ay=0=h