diff -Naur snort3/src/log/log.cc snort3-modified/src/log/log.cc --- snort3/src/log/log.cc 2018-12-31 12:02:47.893390201 -0500 +++ snort3-modified/src/log/log.cc 2018-12-31 12:04:57.830835363 -0500 @@ -88,40 +88,6 @@ return file; } -/**************************************************************************** - * - * Function: RollAlertFile(char *) - * - * Purpose: rename existing alert file with by appending time to name - * - * Arguments: filearg => the filename to rename (same as for OpenAlertFile()) - * - * Returns: 0=success, else errno - * - ***************************************************************************/ -int RollAlertFile(const char* filearg) -{ - char newname[STD_BUF+1]; - time_t now = time(nullptr); - - if ( !filearg ) - filearg = "alert.txt"; - - std::string name; - get_instance_file(name, filearg); - const char* oldname = name.c_str(); - - SnortSnprintf(newname, sizeof(newname)-1, "%s.%lu", oldname, (unsigned long)now); - - - if ( rename(oldname, newname) ) - { - FatalError("RollAlertFile() => rename(%s, %s) = %s\n", - oldname, newname, get_error(errno)); - } - return errno; -} - //-------------------------------------------------------------------- // default logger stuff //-------------------------------------------------------------------- diff -Naur snort3/src/log/log.h snort3-modified/src/log/log.h --- snort3/src/log/log.h 2018-12-31 12:02:47.893390201 -0500 +++ snort3-modified/src/log/log.h 2018-12-31 12:05:12.434549500 -0500 @@ -34,7 +34,6 @@ } FILE* OpenAlertFile(const char*); -int RollAlertFile(const char*); void OpenLogger(); void CloseLogger(); diff -Naur snort3/src/log/text_log.cc snort3-modified/src/log/text_log.cc --- snort3/src/log/text_log.cc 2018-12-31 12:02:47.893390201 -0500 +++ snort3-modified/src/log/text_log.cc 2018-12-31 12:05:39.774014961 -0500 @@ -166,7 +166,6 @@ return; TextLog_Close(txt->file); - RollAlertFile(txt->name); txt->file = TextLog_Open(txt->name); txt->last = time(nullptr); diff -Naur snort3/src/main/thread.cc snort3-modified/src/main/thread.cc --- snort3/src/main/thread.cc 2018-12-31 12:02:47.901390043 -0500 +++ snort3-modified/src/main/thread.cc 2018-12-31 12:04:19.671583461 -0500 @@ -106,6 +106,11 @@ file += name; + // modification by Noah Dietrich to append unixtime to all files + file += '.'; + time_t now = time(nullptr); + file += std::to_string(now); + return file.c_str(); } }