Skip to content

fix: preserve directory scan boundaries - #32

Merged
soulteary merged 1 commit into
mainfrom
fix/config-scan-boundaries
Aug 26, 2026
Merged

fix: preserve directory scan boundaries#32
soulteary merged 1 commit into
mainfrom
fix/config-scan-boundaries

Conversation

@soulteary

Copy link
Copy Markdown
Owner

Summary

  • recognize valid SSH configuration files by parsing known OpenSSH directives instead of inspecting only six keywords in the first five lines
  • ignore symlinks while walking configuration directories and support lines up to 1 MiB consistently
  • insert a line boundary when concatenating files whose previous file lacks a final newline
  • keep the over-limit scanner failure path covered

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • git diff --check

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91ed6d7430

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/fn/scanner.go
Comment on lines +75 to +76
if _, known := sshconfig.LookupKeyword(nodes[0].Directive.KeywordValue); known {
return true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep Include-only files out of legacy directory conversion

When a scanned directory contains an Include-only top-level config—the exact case added by this change—the keyword lookup now adds that file to GetPathContent, which concatenates it with the discovered fragments. The normal conversion path then rejects the resulting Include directive in validateLegacySSHConfig with “Include cannot be represented”; lossless mode also rejects directory sources. Consequently, a common config containing Include config.d/* now makes the entire directory conversion fail, whereas it was previously skipped and the recursively discovered fragment files were converted.

Useful? React with 👍 / 👎.

@soulteary
soulteary force-pushed the fix/config-scan-boundaries branch from 91ed6d7 to f34ed0a Compare August 26, 2026 16:05
@soulteary
soulteary merged commit ded1982 into main Aug 26, 2026
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.

1 participant