[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

missing home directory on windows platforms

From: Paul Edwards
Subject: missing home directory on windows platforms
Date: Thu, 27 Feb 2003 06:17:08 GMT

"Derek Robert Price" <derek@ximbiot.com> wrote in message 
> >Well, can a non-existant HOME be treated such that any
> >files attempting to be read from HOME simply don't exist,
> >ie pointing to an imaginary, empty directory?
> >
> >Or does it need a place to write stuff too?
> Yeah, in the case of `cvs login', CVS needs somewhere to write to.  It
> stores semi-encrypted passwords in $HOME/.cvspass on login and uses
> those passwords to connect during later updates/commits/whatever.
> In the particular case of the update from an anonymous account without a
> password, where the call to `cvs login' is not actually required, I
> could see treating the mising $HOME as a missing .cvspass file (for
> commands other than `cvs login'), in which case CVS usually attempts the
> command with an empty password.
> We love to see patches!

I use gcc 2.95 (or bcc 5.5.1) on Windows 98.  That doesn't
appear to be a supported compiler so I can't actually test
this change.  Or is that documentation out of date?  I would
have thought that gcc was an obvious platform to support.

But from looking at the code, how about just continue issuing
the error about home directory (which confuses a lot of
Windows users according to comments in the file), but
continue processing, picking up the ".cvspass" from the
"/" directory (if it exists there, which of course it doesn't).
This way the user has been notified, and can always go and
check their environment setup, but cvs has more chance of
working "out of the box".  So in a misconfigured environment,
you'll get an error saying that the home directory can't be
found, followed by an error about not being able to open the
cvspass for reading (strange that it would expect to see this
file already available for reading, but nevermind), followed
by CVS actually working properly.

It appears (from error.c) that changing the error(1...) to
error(0...) stops it from being fatal.

I checked the strcat_filename(...) and it will handle an empty
directory (just makes it go to "/").

The patch is to the 1_11_x branch.  Depends whether it is
considered a bug fix or not.  It doesn't impact anyone who
wasn't already impacted.  I think I would expect to see CVS
either work out-of-the-box or give a meaningful error
message like "Environment variable HOME is not defined",
similar to CVSROOT which says "or set the CVSROOT
environment variable".

Since it is not so simple to mention a platform-specific
environment variable, it's probably easier to just make
it work regardless.  If people want to get rid of the warning
they can figure that out later, the important thing is for the
obvious thing to work.

BTW, that message IS very confusing, when I first saw it
I thought there was a problem on the server, the home
directory of something-or-other on the server was being
reported to me.  In actual fact, the second error message
about .cvspass is what is required to make me at least
realise it is a local file that it is complaining about.

Probably all error messages should be done like
"ERR001 Can't find home directory",
so that you know you can look the error message up in the
manual and find out what went wrong.  That's one thing
IBM did really well.  And then you can have a pointer
to the environment variable section, which has the guff
on the different platforms.

BFN.  Paul.

Index: login.c
RCS file: /cvs/ccvs/src/login.c,v
retrieving revision 1.70
diff -c -r1.70 login.c
*** login.c 23 May 2002 18:13:17 -0000 1.70
--- login.c 27 Feb 2003 05:40:32 -0000
*** 61,68 ****
      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;

      passfile = strcat_filename_onto_homedir (homedir, CVS_PASSWORD_FILE);
--- 61,68 ----
      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 (0, 0, "could not find out home directory");
!     homedir = "";

      passfile = strcat_filename_onto_homedir (homedir, CVS_PASSWORD_FILE);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]