(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.");
}
}
printf("Name (%s:%s): ", host, myname);
- if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) {
+ if (fgets(tmp, sizeof tmp, stdin) == NULL) {
advise ("tmp", "fgets");
}
TrimSuffixC(tmp, '\n');
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",