Skip to content

SourcePath::resolveSymlinks(): Fix handling of symlinks that start with '..'#8452

Merged
edolstra merged 1 commit intoNixOS:masterfrom
edolstra:fix-relative-symlinks
Jun 6, 2023
Merged

SourcePath::resolveSymlinks(): Fix handling of symlinks that start with '..'#8452
edolstra merged 1 commit intoNixOS:masterfrom
edolstra:fix-relative-symlinks

Conversation

@edolstra
Copy link
Member

@edolstra edolstra commented Jun 5, 2023

Motivation

Fixes #8437.

Context

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • documentation in the internal API docs
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

Priorities

Add 👍 to pull requests you find important.

@github-actions github-actions bot added fetching Networking with the outside (non-Nix) world, input locking with-tests Issues related to testing. PRs with tests have some priority labels Jun 5, 2023
@roberth roberth added the bug label Jun 5, 2023
@fricklerhandwerk
Copy link
Contributor

Suggestion for commit message: Previously, when resolving a symlink, .. components would not be taken into account.

@edolstra edolstra force-pushed the fix-relative-symlinks branch from 6731850 to 2151be5 Compare June 5, 2023 13:44
@github-actions github-actions bot removed the with-tests Issues related to testing. PRs with tests have some priority label Jun 5, 2023
@infinisil
Copy link
Member

Can you also add a test case to prevent against this bug in the future?

This fixes handling of symlinks that start with '..', and symlink
targets that contain symlinks themselves.
@edolstra edolstra force-pushed the fix-relative-symlinks branch from 2151be5 to f5c6b29 Compare June 6, 2023 09:24
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Jun 6, 2023
@edolstra
Copy link
Member Author

edolstra commented Jun 6, 2023

Added a test.

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

@edolstra edolstra deleted the fix-relative-symlinks branch June 6, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fetching Networking with the outside (non-Nix) world, input locking with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.16 regression] "Infinite symlink recursion" when evaluating nixos-hardware

4 participants