diff -uprk.orig cvs-1.11.10.orig/src/login.c cvs-1.11.10/src/login.c --- cvs-1.11.10.orig/src/login.c 2003-07-29 19:04:28 +0400 +++ cvs-1.11.10/src/login.c 2003-12-15 04:19:39 +0300 @@ -305,10 +305,14 @@ password_entry_operation (operation, roo fp = CVS_FOPEN (passfile, "r"); if (fp == NULL) { + if (operation != password_entry_add || ENOENT != errno) error (0, errno, "warning: failed to open %s for reading", passfile); goto process; } + /* Utter, total, raving paranoia, I know. */ + fchmod (fileno (fp), 0600); + /* Check each line to see if we have this entry already. */ line = 0; while ((line_length = getline (&linebuf, &linebuf_len, fp)) >= 0) @@ -329,9 +333,6 @@ password_entry_operation (operation, roo error (0, errno, "cannot close %s", passfile); fp = NULL; - /* Utter, total, raving paranoia, I know. */ - chmod (passfile, 0600); - /* a copy to return or keep around so we can reuse linebuf */ if (password != NULL) {