aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/login.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-12-11 12:50:10 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-12-11 12:50:10 +0000
commit9bd45385bc16ee3a52f26de65013d6f033bdbc30 (patch)
tree53245fd5c242c7ff7b11e4cd7bf4baca47a330c5 /contrib/cvs/src/login.c
parentc17d50044b97414df9995c1dd0224ba960ee84f2 (diff)
downloadsrc-9bd45385bc16ee3a52f26de65013d6f033bdbc30.tar.gz
src-9bd45385bc16ee3a52f26de65013d6f033bdbc30.zip
Merge cyclic changes for 1.10.7 only our mainline.
Notes
Notes: svn path=/head/; revision=54431
Diffstat (limited to 'contrib/cvs/src/login.c')
-rw-r--r--contrib/cvs/src/login.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/contrib/cvs/src/login.c b/contrib/cvs/src/login.c
index 0a74f373dd87..708dfc8d15d5 100644
--- a/contrib/cvs/src/login.c
+++ b/contrib/cvs/src/login.c
@@ -5,6 +5,8 @@
* specified in the README file that comes with CVS.
*
* Allow user to log in for an authenticating server.
+ *
+ * $FreeBSD$
*/
#include "cvs.h"
@@ -48,7 +50,14 @@ construct_cvspass_filename ()
homedir = get_homedir ();
if (! homedir)
{
- error (1, errno, "could not find out home directory");
+ /* FIXME? This message confuses a lot of users, at least
+ on Win95 (which doesn't set HOMEDRIVE and HOMEPATH like
+ NT does). I suppose the answer for Win95 is to store the
+ passwords in the registry or something (??). And .cvsrc
+ and such too? Wonder what WinCVS does (about .cvsrc, the
+ right thing for a GUI is to just store the password in
+ memory only)... */
+ error (1, 0, "could not find out home directory");
return (char *) NULL;
}
@@ -246,7 +255,8 @@ login (argc, argv)
/* FIXME: rename_file would make more sense (e.g. almost
always faster). */
copy_file (tmp_name, passfile);
- unlink_file (tmp_name);
+ if (unlink_file (tmp_name) < 0)
+ error (0, errno, "cannot remove %s", tmp_name);
chmod (passfile, 0600);
free (tmp_name);
@@ -447,6 +457,8 @@ logout (argc, argv)
*/
passfile = construct_cvspass_filename ();
+ /* FIXME: This should not be in /tmp; that is almost surely a security
+ hole. Probably should just keep it in memory. */
tmp_name = cvs_temp_name ();
if ((tmp_fp = CVS_FOPEN (tmp_name, "w")) == NULL)
{
@@ -486,14 +498,16 @@ logout (argc, argv)
if (! found)
{
printf ("Entry not found for %s\n", CVSroot_original);
- unlink_file (tmp_name);
+ if (unlink_file (tmp_name) < 0)
+ error (0, errno, "cannot remove %s", tmp_name);
}
else
{
/* FIXME: rename_file would make more sense (e.g. almost
always faster). */
copy_file (tmp_name, passfile);
- unlink_file (tmp_name);
+ if (unlink_file (tmp_name) < 0)
+ error (0, errno, "cannot remove %s", tmp_name);
chmod (passfile, 0600);
}
return 0;