Skip to content

[BUG] Error generated when CLI iterates over an alias file when preparing ZIP #867

@maxfelius

Description

@maxfelius

Describe the bug

A clear and concise description of what the bug is.

I have a node_modules folder that I exclude when scanning the code. However, in the node_modeles there is a folder with alias files which have a relative path.

When I want to create scan, the cli iterates over all the files to include and exclude it to prepare the zip. However, the working directory is different than the alias files expected and thus the relative path is invalid.

This produces an error. e.g.
Error getting target info: stat ../jiti/bin/jiti.js: no such file or directory

The error is not blocking or breaking anything but it should be 'solved' for the users that are using it.

Expected behavior

A clear and concise description of what you expected to happen.

The expected behavior is to not show the error.

Actual behavior

A clear and concise description of where the behavior differed from the expected behavior

Currenty shows the error:
Error getting target info: stat ../jiti/bin/jiti.js: no such file or directory

when encountering this type of file.

Steps to reproduce

In the folder you would like to scan, create a symlink.

E.g.
ln -s ../images/link testalias

Then, use the cli to create a scan. The include/exclude mechanism will produce an error.

Environment

  • CLI version
    -> cli javascript wrapper 0.0.104
    -> cli version 2.1.6
  • Platform -> Linux

Additional comments

Add any other context about the problem here.

We are using the javascript cli wrapper to start the scans.

Logs

Paste the output from your CLI. Redact if needed.
Error getting target info: stat ../jiti/bin/jiti.js: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions