Deleted Added
full compact
login.c (102843) login.c (107487)
1/*
2 * Copyright (c) 1995, Cyclic Software, Bloomington, IN, USA
3 *
4 * You may distribute under the terms of the GNU General Public License as
5 * specified in the README file that comes with CVS.
6 *
7 * Allow user to log in for an authenticating server.
8 *
1/*
2 * Copyright (c) 1995, Cyclic Software, Bloomington, IN, USA
3 *
4 * You may distribute under the terms of the GNU General Public License as
5 * specified in the README file that comes with CVS.
6 *
7 * Allow user to log in for an authenticating server.
8 *
9 * $FreeBSD: head/contrib/cvs/src/login.c 102843 2002-09-02 05:57:14Z peter $
9 * $FreeBSD: head/contrib/cvs/src/login.c 107487 2002-12-02 03:17:49Z peter $
10 */
11
12#include "cvs.h"
13#include "getline.h"
14
15#ifdef AUTH_CLIENT_SUPPORT /* This covers the rest of the file. */
16
17#ifdef HAVE_GETPASSPHRASE

--- 44 unchanged lines hidden (view full) ---

62 passwords in the registry or something (??). And .cvsrc
63 and such too? Wonder what WinCVS does (about .cvsrc, the
64 right thing for a GUI is to just store the password in
65 memory only)... */
66 error (1, 0, "could not find out home directory");
67 return (char *) NULL;
68 }
69
10 */
11
12#include "cvs.h"
13#include "getline.h"
14
15#ifdef AUTH_CLIENT_SUPPORT /* This covers the rest of the file. */
16
17#ifdef HAVE_GETPASSPHRASE

--- 44 unchanged lines hidden (view full) ---

62 passwords in the registry or something (??). And .cvsrc
63 and such too? Wonder what WinCVS does (about .cvsrc, the
64 right thing for a GUI is to just store the password in
65 memory only)... */
66 error (1, 0, "could not find out home directory");
67 return (char *) NULL;
68 }
69
70 passfile =
71 (char *) xmalloc (strlen (homedir) + strlen (CVS_PASSWORD_FILE) + 3);
72 strcpy (passfile, homedir);
73#ifndef NO_SLASH_AFTER_HOME
74 /* NO_SLASH_AFTER_HOME is defined for VMS, where foo:[bar]/.cvspass is not
75 a legal filename but foo:[bar].cvspass is. A more clean solution would
76 be something more along the lines of a "join a directory to a filename"
77 kind of thing.... */
78 strcat (passfile, "/");
79#endif
80 strcat (passfile, CVS_PASSWORD_FILE);
70 passfile = strcat_filename_onto_homedir (homedir, CVS_PASSWORD_FILE);
81
82 /* Safety first and last, Scouts. */
83 if (isfile (passfile))
84 /* xchmod() is too polite. */
85 chmod (passfile, 0600);
86
87 return passfile;
88}

--- 221 unchanged lines hidden (view full) ---

310 int save_errno = 0;
311
312 if (root->method != pserver_method)
313 {
314 error (0, 0, "internal error: can only call password_entry_operation with pserver method");
315 error (1, 0, "CVSROOT: %s", root->original);
316 }
317
71
72 /* Safety first and last, Scouts. */
73 if (isfile (passfile))
74 /* xchmod() is too polite. */
75 chmod (passfile, 0600);
76
77 return passfile;
78}

--- 221 unchanged lines hidden (view full) ---

300 int save_errno = 0;
301
302 if (root->method != pserver_method)
303 {
304 error (0, 0, "internal error: can only call password_entry_operation with pserver method");
305 error (1, 0, "CVSROOT: %s", root->original);
306 }
307
308 cvsroot_canonical = normalize_cvsroot (root);
309
318 /* Yes, the method below reads the user's password file twice when we have
319 * to delete an entry. It's inefficient, but we're not talking about a gig of
320 * data here.
321 */
322
323 passfile = construct_cvspass_filename ();
324 fp = CVS_FOPEN (passfile, "r");
325 if (fp == NULL)
326 {
327 error (0, errno, "warning: failed to open %s for reading", passfile);
328 goto process;
329 }
330
310 /* Yes, the method below reads the user's password file twice when we have
311 * to delete an entry. It's inefficient, but we're not talking about a gig of
312 * data here.
313 */
314
315 passfile = construct_cvspass_filename ();
316 fp = CVS_FOPEN (passfile, "r");
317 if (fp == NULL)
318 {
319 error (0, errno, "warning: failed to open %s for reading", passfile);
320 goto process;
321 }
322
331 cvsroot_canonical = normalize_cvsroot (root);
332
333 /* Check each line to see if we have this entry already. */
334 line = 0;
335 while ((line_length = getline (&linebuf, &linebuf_len, fp)) >= 0)
336 {
337 line++;
338 password = password_entry_parseline(cvsroot_canonical, 1, line, linebuf);
339 if (password != NULL)
340 /* this is it! break out and deal with linebuf */

--- 330 unchanged lines hidden ---
323 /* Check each line to see if we have this entry already. */
324 line = 0;
325 while ((line_length = getline (&linebuf, &linebuf_len, fp)) >= 0)
326 {
327 line++;
328 password = password_entry_parseline(cvsroot_canonical, 1, line, linebuf);
329 if (password != NULL)
330 /* this is it! break out and deal with linebuf */

--- 330 unchanged lines hidden ---