mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 08:14:58 +03:00
Avoid using hardcoded paths in log file enumeration
Hardcoded paths are used in log file enumeration such as LogFileList command or GenerateEraseFileList function to delete old log files when disk free space is lacking. Fixes: SoftEtherVPN/SoftEtherVPN#972
This commit is contained in:
@ -969,11 +969,11 @@ LIST *EnumLogFile(char *hubname)
|
||||
// Enumerate in the server_log
|
||||
if (hubname == NULL)
|
||||
{
|
||||
EnumLogFileDir(o, "server_log");
|
||||
EnumLogFileDir(o, SERVER_LOG_DIR);
|
||||
}
|
||||
|
||||
// Enumerate in the packet_log
|
||||
Format(tmp, sizeof(tmp), "%s/packet_log", exe_dir);
|
||||
Format(tmp, sizeof(tmp), "%s/"HUB_PACKET_LOG_DIR, exe_dir);
|
||||
|
||||
if (hubname == NULL)
|
||||
{
|
||||
@ -988,7 +988,7 @@ LIST *EnumLogFile(char *hubname)
|
||||
if (e->Folder)
|
||||
{
|
||||
char dir_name[MAX_PATH];
|
||||
Format(dir_name, sizeof(dir_name), "packet_log/%s", e->FileName);
|
||||
Format(dir_name, sizeof(dir_name), HUB_PACKET_LOG_DIR"/%s", e->FileName);
|
||||
EnumLogFileDir(o, dir_name);
|
||||
}
|
||||
}
|
||||
@ -1000,13 +1000,13 @@ LIST *EnumLogFile(char *hubname)
|
||||
{
|
||||
char dir_name[MAX_PATH];
|
||||
|
||||
Format(dir_name, sizeof(dir_name), "packet_log/%s", hubname);
|
||||
Format(dir_name, sizeof(dir_name), HUB_PACKET_LOG_DIR"/%s", hubname);
|
||||
|
||||
EnumLogFileDir(o, dir_name);
|
||||
}
|
||||
|
||||
// Enumerate in the security_log
|
||||
Format(tmp, sizeof(tmp), "%s/security_log", exe_dir);
|
||||
Format(tmp, sizeof(tmp), "%s/"HUB_SECURITY_LOG_DIR, exe_dir);
|
||||
|
||||
if (hubname == NULL)
|
||||
{
|
||||
@ -1022,7 +1022,7 @@ LIST *EnumLogFile(char *hubname)
|
||||
{
|
||||
char dir_name[MAX_PATH];
|
||||
|
||||
Format(dir_name, sizeof(dir_name), "security_log/%s", e->FileName);
|
||||
Format(dir_name, sizeof(dir_name), HUB_SECURITY_LOG_DIR"/%s", e->FileName);
|
||||
|
||||
EnumLogFileDir(o, dir_name);
|
||||
}
|
||||
@ -1035,7 +1035,7 @@ LIST *EnumLogFile(char *hubname)
|
||||
{
|
||||
char dir_name[MAX_PATH];
|
||||
|
||||
Format(dir_name, sizeof(dir_name), "security_log/%s", hubname);
|
||||
Format(dir_name, sizeof(dir_name), HUB_SECURITY_LOG_DIR"/%s", hubname);
|
||||
|
||||
EnumLogFileDir(o, dir_name);
|
||||
}
|
||||
|
Reference in New Issue
Block a user