|
Lines 1509-1515
read_config_file(const char *filename, struct passwd *pw, const char *host,
Link Here
|
| 1509 |
const char *original_host, Options *options, int flags) |
1509 |
const char *original_host, Options *options, int flags) |
| 1510 |
{ |
1510 |
{ |
| 1511 |
FILE *f; |
1511 |
FILE *f; |
| 1512 |
char line[1024]; |
1512 |
char *cp, line[1024]; |
| 1513 |
int active, linenum; |
1513 |
int active, linenum; |
| 1514 |
int bad_options = 0; |
1514 |
int bad_options = 0; |
| 1515 |
|
1515 |
|
|
Lines 1537-1542
read_config_file(const char *filename, struct passwd *pw, const char *host,
Link Here
|
| 1537 |
while (fgets(line, sizeof(line), f)) { |
1537 |
while (fgets(line, sizeof(line), f)) { |
| 1538 |
/* Update line number counter. */ |
1538 |
/* Update line number counter. */ |
| 1539 |
linenum++; |
1539 |
linenum++; |
|
|
1540 |
if (strlen(line) == sizeof(line) - 1) |
| 1541 |
fatal("%s line %d too long", filename, linenum); |
| 1542 |
/* Trim out comments. */ |
| 1543 |
if ((cp = strchr(line, '#')) != NULL) |
| 1544 |
memcpy(cp, "\n", 2); |
| 1540 |
if (process_config_line(options, pw, host, original_host, |
1545 |
if (process_config_line(options, pw, host, original_host, |
| 1541 |
line, filename, linenum, &active, flags) != 0) |
1546 |
line, filename, linenum, &active, flags) != 0) |
| 1542 |
bad_options++; |
1547 |
bad_options++; |