aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/login.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-10-15 20:24:40 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-10-15 20:24:40 +0000
commit479094cc3703b2cb2d20d22163f53493872cbe78 (patch)
tree73c35e157893c47031a4538e07e6229225785783 /contrib/cvs/src/login.c
parent1280c81d604b0c8147d7a47f523d3fcf007d2818 (diff)
downloadsrc-479094cc3703b2cb2d20d22163f53493872cbe78.tar.gz
src-479094cc3703b2cb2d20d22163f53493872cbe78.zip
MFC: cvs-1.11.2, plus client.c rev 1.7 (missing client upload)
Notes
Notes: svn path=/stable/4/; revision=105170
Diffstat (limited to 'contrib/cvs/src/login.c')
-rw-r--r--contrib/cvs/src/login.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/cvs/src/login.c b/contrib/cvs/src/login.c
index df6abe181073..a90212f0db2a 100644
--- a/contrib/cvs/src/login.c
+++ b/contrib/cvs/src/login.c
@@ -324,8 +324,8 @@ password_entry_operation (operation, root, newpassword)
fp = CVS_FOPEN (passfile, "r");
if (fp == NULL)
{
- error (0, errno, "failed to open %s for reading", passfile);
- goto error_exit;
+ error (0, errno, "warning: failed to open %s for reading", passfile);
+ goto process;
}
cvsroot_canonical = normalize_cvsroot (root);
@@ -363,6 +363,8 @@ password_entry_operation (operation, root, newpassword)
password = xstrdup (password);
}
+process:
+
/* might as well return now */
if (operation == password_entry_lookup)
goto out;
@@ -552,6 +554,12 @@ login (argc, argv)
{
char *tmp;
tmp = GETPASS ("CVS password: ");
+ /* Must deal with a NULL return value here. I haven't managed to
+ * disconnect the CVS process from the tty and force a NULL return
+ * in sanity.sh, but the Linux version of getpass is documented
+ * to return NULL when it can't open /dev/tty...
+ */
+ if (!tmp) error (1, errno, "login: Failed to read password.");
typed_password = scramble (tmp);
memset (tmp, 0, strlen (tmp));
}
@@ -562,7 +570,7 @@ login (argc, argv)
* will get zeroed by connect_to_server(). */
cvs_password = xstrdup (typed_password);
- connect_to_pserver (NULL, NULL, 1, 0);
+ connect_to_pserver (current_parsed_root, NULL, NULL, 1, 0);
password_entry_operation (password_entry_add, current_parsed_root, typed_password);