Repository navigation
Fix address checks that refused every host (#194) - #195
Open
UniqueDroid wants to merge 1 commit into
Open
UniqueDroid wants to merge 1 commit into
UniqueDroid wants to merge 1 commit into
Conversation
POSIX regular expressions end a bracket expression at the first "]"; a backslash does not escape inside it. "[A-Za-z0-9.:\[\]_-]+" therefore matched no normal host name, so store sources (store_set) and the Paperless server address could not be saved at all. Host names and bracketed IPv6 addresses are now matched apart, as app-perms.uc does for Docker hosts. The share description check "[\n\r\[\]]" only refused a character followed by "]", so a line break went through into ksmbd.conf (admin only). It now looks for line breaks and brackets separately. Tests: a normal https source and an IPv6 source are accepted, a Paperless host with port is accepted, a description with a line break or "[" is refused. parts/README.md notes the pitfall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sb3gb1FHs6DNkZHKinKAJv
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #194.
POSIX regular expressions end a bracket expression at the first
], and a backslash does not escape inside it. So[A-Za-z0-9.:\[\]_-]+matched no normal host name:store_setrefused every source, even the default catalog.set_globalrefused every server address.[\n\r\[\]]only caught a character followed by], so a line break went through intoksmbd.conf(admin only).Host names and bracketed IPv6 addresses are now matched apart, as
app-perms.ucalready does for Docker hosts. The description check looks for line breaks and brackets separately.Checked with glibc
regcomp/regexec(REG_EXTENDED): the old pattern refuseshttps://github.com/…/index.json; the new one accepts it andhttps://[fd00::1]:8443/index.json, and still refuseshttp://, spaces and quotes.Tests (they only tried invalid addresses before, which is why CI did not see it):
test-apps: a normal https source and an IPv6 source are saved; a source with a space is refused.test-cloud-paperless:http://paperless.lan:8000is saved.test-users: a description with a line break or[is refused.parts/README.mdnotes the pitfall. CHANGELOG line under 0.3.0-beta.15, since that release is not tagged yet.Generated by Claude Code