summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/server.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-05-27 15:26:12 +0000
committerpeter <peter@FreeBSD.org>1998-05-27 15:26:12 +0000
commit66f8d308b9183c6079bfc2b9122ce47da0562d2c (patch)
tree9a18817fdc5fbd9076ad1bf1c6d5b687340205a6 /contrib/cvs/src/server.c
parent474b0e97b33ea1b8cf3639ea1281615f977d2255 (diff)
downloadFreeBSD-src-66f8d308b9183c6079bfc2b9122ce47da0562d2c.zip
FreeBSD-src-66f8d308b9183c6079bfc2b9122ce47da0562d2c.tar.gz
Add a new long flag that causes cvs to ignore the CVSROOT/passwd file.
This is mostly intended for use on freefall where we'd like to provide a passwd file for easy anoncvs mirroring access, but don't want to open up the pserver on freefall itself. While here, some initial tweaks intended for allowing an empty pserver password. I'm not sure that this works yet.
Diffstat (limited to 'contrib/cvs/src/server.c')
-rw-r--r--contrib/cvs/src/server.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/contrib/cvs/src/server.c b/contrib/cvs/src/server.c
index 2959ac2..e2cc3aa 100644
--- a/contrib/cvs/src/server.c
+++ b/contrib/cvs/src/server.c
@@ -4718,15 +4718,17 @@ check_repository_password (username, password, repository, host_user_ptr)
/* If found_it != 0, then linebuf contains the information we need. */
if (found_it)
{
- char *found_password, *host_user_tmp;
+ char *found_password, *host_user_tmp = NULL;
strtok (linebuf, ":");
found_password = strtok (NULL, ": \n");
- host_user_tmp = strtok (NULL, ": \n");
+ if (found_password)
+ host_user_tmp = strtok (NULL, ": \n");
if (host_user_tmp == NULL)
host_user_tmp = username;
- if (strcmp (found_password, crypt (password, found_password)) == 0)
+ if (found_passwd == NULL || *found_passwd == '\0' ||
+ strcmp (found_password, crypt (password, found_password)) == 0)
{
/* Give host_user_ptr permanent storage. */
*host_user_ptr = xstrdup (host_user_tmp);
@@ -4764,7 +4766,10 @@ check_password (username, password, repository)
password file. If so, that's enough to authenticate with. If
not, we'll check /etc/passwd. */
- rc = check_repository_password (username, password, repository,
+ if (require_real_user)
+ rc = 0; /* "not found" */
+ else
+ rc = check_repository_password (username, password, repository,
&host_user);
if (rc == 2)
OpenPOWER on IntegriCloud