2009-07-12 19:17:38 +00:00
|
|
|
--- a/src/snort.c
|
|
|
|
+++ b/src/snort.c
|
2010-12-11 16:54:18 +00:00
|
|
|
@@ -4198,7 +4198,7 @@ static char *ConfigFileSearch(void)
|
2006-11-13 08:15:26 +00:00
|
|
|
{
|
|
|
|
struct stat st;
|
|
|
|
int i;
|
|
|
|
- char *conf_files[]={"/etc/snort.conf", "./snort.conf", NULL};
|
|
|
|
+ char *conf_files[]={"/etc/snort/snort.conf", NULL};
|
|
|
|
char *fname = NULL;
|
|
|
|
char *rval = NULL;
|
2009-07-12 19:17:38 +00:00
|
|
|
|
2010-12-11 16:54:18 +00:00
|
|
|
@@ -4217,30 +4217,6 @@ static char *ConfigFileSearch(void)
|
2006-11-13 08:15:26 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
|
|
|
|
- /* search for .snortrc in the HOMEDIR */
|
|
|
|
- if(!rval)
|
|
|
|
- {
|
2009-07-12 19:17:38 +00:00
|
|
|
- char *home_dir = NULL;
|
|
|
|
-
|
|
|
|
- if((home_dir = getenv("HOME")) != NULL)
|
2006-11-13 08:15:26 +00:00
|
|
|
- {
|
2009-07-12 19:17:38 +00:00
|
|
|
- char *snortrc = "/.snortrc";
|
|
|
|
- int path_len;
|
|
|
|
-
|
|
|
|
- path_len = strlen(home_dir) + strlen(snortrc) + 1;
|
|
|
|
-
|
2006-11-13 08:15:26 +00:00
|
|
|
- /* create the full path */
|
2009-07-12 19:17:38 +00:00
|
|
|
- fname = (char *)SnortAlloc(path_len);
|
|
|
|
-
|
|
|
|
- SnortSnprintf(fname, path_len, "%s%s", home_dir, snortrc);
|
2006-11-13 08:15:26 +00:00
|
|
|
-
|
|
|
|
- if(stat(fname, &st) != -1)
|
|
|
|
- rval = fname;
|
|
|
|
- else
|
|
|
|
- free(fname);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return rval;
|
|
|
|
}
|
|
|
|
|