Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InTotoRun inconsistency: handling symlink cycles #116

Open
joyliu-q opened this issue Jul 11, 2021 · 0 comments
Open

InTotoRun inconsistency: handling symlink cycles #116

joyliu-q opened this issue Jul 11, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@joyliu-q
Copy link

Please fill in the fields below to submit an issue or feature request. The
more information that is provided, the better.

Description of issue or feature request:
When symlink cycles are detected, the Golang and Python implementations differ in how the symlink cycle error is handled.

In Python, the paths that are causing the symbolic link cycles are recorded but eventually skipped when reaching a certain depth, the warning is logged, and in_toto_run continues to record the artifacts.

In Golang, the symbolic link cycles are detected (very awesomely) and the InTotoRun function exits completely, returning an error (see line 147 in runlib.go here).

Since the Python implementation is the more canonical when there are differences in implementation, should we follow its method of handling symlink cycles and document the change? However, this may be because the Python version doesn't have symlink cycle detection implemented, and maybe we can change the Python implementation to match Golang's?

Current behavior:
Golang - When symlink cycles are detected, ErrSymCycle is returned and function exits.
Python - When symlink cycles are detected, the symlink is skipped and InTotoRun continues.

Expected behavior:

  • Golang - When symlink cycles are detected, the symlink is skipped on first pass and InTotoRun continues. (Change: logs ErrSymCycle instead of returning it, and continue)
  • Python - When symlink cycles are detected, the symlink is skipped on first pass and InTotoRun continues. (Change: either no change by continue having it skip when reaching a certain depth, or add change to detect symlink and skip on first pass)

OR

  • Golang - When symlink cycles are detected, ErrSymCycle is returned and function exits. (No Change)
  • Python - When symlink cycles are detected, ErrSymCycle is returned and function exits. (Change: detect symlink and emit error)
@shibumi shibumi added the bug Something isn't working label Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants