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

Check for valid paths in create-symlinks hook #696

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

elezar
Copy link
Member

@elezar elezar commented Sep 17, 2024

This change updates the create-symlinks hook to check whether link paths resolve in the container's filesystem. In addition the executable is updated to return an error if a link could not be created.

@elezar elezar self-assigned this Sep 17, 2024
Comment on lines 224 to 225
resolvedParent, err := tryResolveLink(filepath.Dir(path))
return filepath.Join(resolvedParent, filepath.Base(path)), err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's put an if/else here and return "" if there is an error

Copy link
Contributor

@klueska klueska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits, otherwise looks good

This change updates the create-symlinks hook to check whether
link paths resolve in the container's filesystem. In addition
the executable is updated to return an error if a link could
not be created.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar merged commit c490baa into NVIDIA:main Sep 18, 2024
8 checks passed
@elezar elezar deleted the check-link-resolution branch September 18, 2024 20:05
elezar added a commit to elezar/nvidia-container-toolkit that referenced this pull request Sep 20, 2024
This reverts commit c490baa, reversing
changes made to 32486cf.

Signed-off-by: Evan Lezar <[email protected]>
elezar added a commit that referenced this pull request Sep 20, 2024
Revert "Merge pull request #696 from elezar/check-link-resolution"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants