Skip to content

fix(cli): preserve case in wordlist path parsing and use canonical paths#16

Merged
cestef merged 2 commits into
cestef:devfrom
rjvkn:dev
Jun 2, 2025
Merged

fix(cli): preserve case in wordlist path parsing and use canonical paths#16
cestef merged 2 commits into
cestef:devfrom
rjvkn:dev

Conversation

@rjvkn

@rjvkn rjvkn commented Jun 2, 2025

Copy link
Copy Markdown

This PR improves handling of wordlist file paths in two ways:

  1. Preserve Case in Paths
    Previously, the CLI parser lowercased the path portion of path[:key], causing failures on case-sensitive filesystems (e.g., Linux). Now the path is kept exactly as input, fixing these issues.

    image

  2. Resolve Canonical Paths
    We convert the provided path to its canonical form using PathBuf::canonicalize(). This resolves symlinks, relative components like . and .., and returns an absolute, normalized path. It ensures the file can be correctly found and accessed.

Why?

  • Case preservation: Lowercasing paths broke access to files with uppercase letters in their names or directories.
  • Canonicalization: Without resolving to canonical paths, relative paths or symlinked files could fail to open or cause inconsistent behavior.

Impact

  • Fixes file-not-found errors caused by incorrect path casing.
  • Enables correct handling of relative and symlinked paths.
  • Makes wordlist file handling more robust and platform-compatible.

@cestef

cestef commented Jun 2, 2025

Copy link
Copy Markdown
Owner

nice catch !

@cestef cestef merged commit 4bd4dd4 into cestef:dev Jun 2, 2025
6 checks passed
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.

2 participants