Exit if no classification.config has been found.

remotes/origin/master-1.0.x
Victor Julien 16 years ago
parent 9e5f7459c2
commit f5ef0cc3b8

@ -88,7 +88,7 @@ static inline int SCClassConfInitContext(DetectEngineCtx *de_ctx)
if (fd == NULL) { if (fd == NULL) {
filename = SCClassConfGetConfFilename(); filename = SCClassConfGetConfFilename();
if ( (fd = fopen(filename, "r")) == NULL) { if ( (fd = fopen(filename, "r")) == NULL) {
SCLogError(SC_ERR_FOPEN_ERROR, "Error opening file: \"%s\"", filename); SCLogError(SC_ERR_FOPEN_ERROR, "Error opening file: \"%s\": %s", filename, strerror(errno));
goto error; goto error;
} }
} }
@ -117,7 +117,10 @@ static inline int SCClassConfInitContext(DetectEngineCtx *de_ctx)
fclose(fd); fclose(fd);
fd = NULL; fd = NULL;
} }
return -1;
printf("\nPlease check the \"classification-file\" option in your suricata.yaml file.\n");
exit(EXIT_FAILURE);
// return -1;
} }
/** /**

@ -71,6 +71,7 @@ const char * SCErrorToString(SCError err)
CASE_CODE (SC_ERR_DEPTH_MISSING_CONTENT); CASE_CODE (SC_ERR_DEPTH_MISSING_CONTENT);
CASE_CODE (SC_ERR_OFFSET_MISSING_CONTENT); CASE_CODE (SC_ERR_OFFSET_MISSING_CONTENT);
CASE_CODE (SC_ERR_NO_URICONTENT_NEGATION); CASE_CODE (SC_ERR_NO_URICONTENT_NEGATION);
CASE_CODE (SC_ERR_FOPEN_ERROR);
default: default:
return "UNKNOWN_ERROR"; return "UNKNOWN_ERROR";
} }

Loading…
Cancel
Save