Skip to content

Conversation

@LaberionAjvazi
Copy link
Contributor

@LaberionAjvazi LaberionAjvazi commented Dec 15, 2025

Description

Used the lstat function to check if the source directory or any of its nested files are symbolic links.

  • If the sourceDir is symLink, an error will be thrown to avoid reading target files that user may not have access to
  • If a nested file/folder is symLink, it will be excluded from the resulting zip since the isFile and isFolder of the lstats result will return false if the path is a symLink.

Other: Removed unused copyDirectoryToCurrentLocation method.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

Note

Exclude symlinks when zipping directories (error on symlink source) and add tests to validate behavior.

  • Core utils (src/core/utils/file-service.ts):
    • zipDirectoryInBatchExportFormat:
      • Throw FatalError if sourceDir is a symbolic link.
      • Use fs.lstatSync to detect and skip symlinked files/folders.
    • Remove copyDirectoryToCurrentLocation method.
  • Tests (tests/core/utils/file.service.spec.ts):
    • Add tests ensuring symlink source throws and symlinked files/folders are excluded from the zip.

Written by Cursor Bugbot for commit 04b7f98. This will update automatically on new commits. Configure here.

@LaberionAjvazi LaberionAjvazi requested a review from a team as a code owner December 15, 2025 13:49
@sonarqubecloud
Copy link

@LaberionAjvazi LaberionAjvazi merged commit 1683f2c into master Dec 16, 2025
6 checks passed
@LaberionAjvazi LaberionAjvazi deleted the TA-4733-exclude-symlink branch December 16, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants