]> diplodocus.org Git - nmh/blobdiff - sbr/ruserpass.c
Replace fprintf(fp, "%s", foo) with fputs(foo, fp).
[nmh] / sbr / ruserpass.c
index 5b6503890630d03415023aeb3fe02f17fb2dface..43784d528d02158c3050a90e88dfb836d613162d 100644 (file)
@@ -107,8 +107,8 @@ ruserpass(const char *host, char **aname, char **apass, int flags)
                            (stb.st_mode & 077) != 0) {
                            /* We make this a fatal error to force the
                               user to correct it. */
-                           advise(NULL, "Error - file %s must not be world or "
-                                  "group readable.", credentials_file);
+                            advise(NULL, "group or other permissions, %#o, "
+                                "forbidden: %s", stb.st_mode, credentials_file);
                            adios(NULL, "Remove password or correct file "
                                  "permissions.");
                        }
@@ -204,8 +204,9 @@ token(char *tokval)
             return TOK_EOF;
 
     while ((c = getc(cfile)) != EOF && c && !strchr(stop, c)) {
-        if (c == '\\')
-            c = getc(cfile); /* BUG: What if this is EOF. */
+        if (c == '\\' && (c = getc(cfile)) == EOF)
+            return TOK_EOF; /* Discard whole token. */
+
         *cp++ = c;
         if (cp - tokval > MAX_TOKVAL_SIZE-1) {
             adios(NULL, "credential tokens restricted to length %d",