Syntax cleanup
This commit is contained in:
28
confparser.c
28
confparser.c
@@ -278,30 +278,22 @@ static int test_conf_syntax()
|
|||||||
failed = 1;
|
failed = 1;
|
||||||
} else if (!strcmp(buf, "rmps.certfile")) {
|
} else if (!strcmp(buf, "rmps.certfile")) {
|
||||||
if (access(tmp + 1, F_OK) == -1) {
|
if (access(tmp + 1, F_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is missing", tmp + 1);
|
||||||
"%s is missing", tmp + 1);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
}
|
}
|
||||||
else if (access(tmp + 1, R_OK) == -1) {
|
else if (access(tmp + 1, R_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is not readable", tmp + 1);
|
||||||
"%s is not readable",
|
|
||||||
tmp + 1
|
|
||||||
);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
} else
|
} else
|
||||||
strncpy(conf.rmps.certfile, tmp + 1, sizeof(conf.rmps.certfile));
|
strncpy(conf.rmps.certfile, tmp + 1, sizeof(conf.rmps.certfile));
|
||||||
}
|
}
|
||||||
else if (!strcmp(buf, "rmps.keyfile")) {
|
else if (!strcmp(buf, "rmps.keyfile")) {
|
||||||
if (access(tmp + 1, F_OK) == -1) {
|
if (access(tmp + 1, F_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is missing", conf.rmps.keyfile);
|
||||||
"%s is missing", conf.rmps.keyfile);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
}
|
}
|
||||||
else if (access(tmp + 1, R_OK) == -1) {
|
else if (access(tmp + 1, R_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is not readable", tmp + 1);
|
||||||
"%s is not readable",
|
|
||||||
tmp + 1
|
|
||||||
);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
} else
|
} else
|
||||||
strncpy(conf.rmps.keyfile, tmp + 1, sizeof(conf.rmps.keyfile));
|
strncpy(conf.rmps.keyfile, tmp + 1, sizeof(conf.rmps.keyfile));
|
||||||
@@ -309,22 +301,16 @@ static int test_conf_syntax()
|
|||||||
strncpy(conf.rmps.cipherlist, tmp + 1, sizeof(conf.rmps.cipherlist));
|
strncpy(conf.rmps.cipherlist, tmp + 1, sizeof(conf.rmps.cipherlist));
|
||||||
} else if (!strcmp(buf, "rmps.cafile")) {
|
} else if (!strcmp(buf, "rmps.cafile")) {
|
||||||
if (access(tmp + 1, F_OK) == -1) {
|
if (access(tmp + 1, F_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is missing", tmp + 1);
|
||||||
"%s is missing", tmp + 1);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
}
|
}
|
||||||
else if (access(tmp + 1, R_OK) == -1) {
|
else if (access(tmp + 1, R_OK) == -1) {
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "%s is not readable\n", tmp + 1);
|
||||||
"%s is not readable\n",
|
|
||||||
tmp + 1
|
|
||||||
);
|
|
||||||
failed = 1;
|
failed = 1;
|
||||||
} else
|
} else
|
||||||
strncpy(conf.rmps.cafile, tmp + 1, sizeof(conf.rmps.cafile));
|
strncpy(conf.rmps.cafile, tmp + 1, sizeof(conf.rmps.cafile));
|
||||||
} else
|
} else
|
||||||
log_trace( ERROR,
|
log_trace(ERROR, "Unknown config entry on line %d: %s", j, buf);
|
||||||
"Unknown config entry on line %d: %s",
|
|
||||||
j, buf );
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
log_trace( ERROR,
|
log_trace( ERROR,
|
||||||
"Invalid value for \"%s\", line %d: \"%s\"",
|
"Invalid value for \"%s\", line %d: \"%s\"",
|
||||||
|
|||||||
Reference in New Issue
Block a user