Skip to content

Commit

Permalink
fix vss exclusion paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Son Roy Almerol committed Nov 12, 2024
1 parent 1bd7726 commit 0d7756d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/agent/sftp/filelister.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func wildcardToRegex(pattern string) string {
// Escape backslashes and convert path to regex-friendly format
escapedPattern := regexp.QuoteMeta(pattern)

escapedPattern = strings.ReplaceAll(escapedPattern, ":", "")

// Replace double-star wildcard ** with regex equivalent (any directory depth)
escapedPattern = strings.ReplaceAll(escapedPattern, `\*\*`, `.*`)

Expand Down Expand Up @@ -162,7 +164,9 @@ func skipFile(path string, fileInfo os.FileInfo) bool {
`C:\Users\*\AppData\Roaming\Zoom\logs`,
}

normalizedPath := strings.ToUpper(filepath.Join(path, fileInfo.Name()))
normalizedPath := filepath.Join(path, fileInfo.Name())
normalizedPath = strings.TrimPrefix(normalizedPath, "C:\\Windows\\TEMP\\pbs-plus-vss\\")
normalizedPath = strings.ToUpper(normalizedPath)

for _, excludePath := range excludedPaths {
regexPattern := wildcardToRegex(excludePath)
Expand Down

0 comments on commit 0d7756d

Please sign in to comment.