Skip to content

[BUG][REGRESSION] LogMonitor.exe /Config no longer accepts absolute path in version 2.2.0 #229

Description

@mloskot

Describe the bug

This change released with LogMonitor 2.2.0

// Reject paths with traversal sequences or absolute path indicators
if (userConfigName.find(L"..") != std::wstring::npos ||
userConfigName.find(L'/') != std::wstring::npos ||
userConfigName.find(L'\\') != std::wstring::npos ||
userConfigName.find(L':') != std::wstring::npos)
{
logWriter.TraceError(L"Invalid configuration file name.");
return 0;
}

no longer allows passing the config file via absolute path: C:\LogMonitor.exe /Config C:\LogMonitorConfig.json

To Reproduce

Steps to reproduce the behavior:

  1. Run C:\LogMonitor.exe /Config C:\LogMonitorConfig.json
  2. See error [LOGMONITOR] ERROR: Invalid configuration file name.

Expected behavior

C:\LogMonitor.exe /Config C:\LogMonitorConfig.json should run fine as it has for long time using previous versions

Screenshots

n/a

Configuration
-Tool: LogMonitor
-Version: 2.2.0

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions