Repository navigation
Conversation
sjrx-claude-sandbox
force-pushed
the
feat/validators-nspawn
branch
from
October 24, 2026 14:41
ed89d7b to
dd344cf
Compare
Unit Test Results (grammar engine true)1 388 tests 1 388 ✅ 1m 3s ⏱️ Results for commit d71fa9c. ♻️ This comment has been updated with latest results. |
Unit Test Results (grammar engine false)1 388 tests 1 388 ✅ 1m 5s ⏱️ Results for commit d71fa9c. ♻️ This comment has been updated with latest results. |
sjrx-claude-sandbox
force-pushed
the
feat/validators-nspawn
branch
3 times, most recently
from
October 24, 2026 17:11
55549cb to
992b83a
Compare
Validators for the 21 (parser, ltype) pairs in nspawn-gperf.gperf that had none: Capability=/DropCapability=/AmbientCapability=, Volatile=, ResolvConf=, LinkJournal=, OOMScoreAdjust=, MachineID=, Zone=, Port=, Interface=/MACVLAN=/ IPVLAN=, VirtualEthernetExtra=, Bind=/BindReadOnly=, TemporaryFileSystem=, Inaccessible=, PivotRoot=, Overlay=/OverlayReadOnly=, BindUser= and RestrictAddressFamilies=. Each is modelled on the C parser at systemd 0f0682b773 and its leaf helpers, with tests drawn from TEST-13-NSPAWN and test-id128.c. Shared helpers live in BatchNspawnCombinators.kt: a safe_atoi/safe_atou number terminal (sign, 0x, octal, 0o, 0b), a case-insensitive parse_boolean, a colon-delimited interface name, colon-field path terminals, strict user names, 128-bit IDs and the case-insensitive, prefix-optional address family names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- VirtualEthernetExtra=: the container-side field honours backslash escapes like extract_first_word(), so `a:b\:c` is accepted. - safeAtoNumber: accept a sign after the 0b/0o prefix (`0b-1`), which strtol() in base 2/8 takes after mangle_base() strips the prefix. - Interface names: refuse spellings parse_ifindex() reads as a positive index (`0x10`, `+5`, `0o7`, `0b1`), as ifname_valid() does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Several batch branches declared public helpers with the same name in the shared grammar package (SafeAtouTerminal, UINT32_LIMIT, safeAtou, SafeAtoNumberTerminal, BOOLEAN_ANY_CASE, COALESCED_COLONS). Each branch compiled alone but any two merged together would not. Prefix them per family so the batch PRs can merge in any order; consolidating them into Combinators.kt is left for a follow-up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checked against fuzz-nspawn-settings built at 0f0682b773: - OOMScoreAdjust= and Port= accept whitespace between a 0b/0o prefix and the digits (strtol skips it), e.g. `0b 1`, `tcp:0o 120`. Capability= keeps the strict form, since the word split comes first. - Interface=/MACVLAN=/IPVLAN= refuse a name that runs into whitespace after a backslash run whose length is not a multiple of 4. Each word is unescaped twice, so `a\ b` is the invalid name "a b" and `a\\ b` leaves a dangling backslash. - Bind= option-list checks are now a separate test that states they fail only at container start (parse_mount_bind_options), not at parse time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
242.x now makes BOOLEAN case-insensitive, so the batch's own CASE_INSENSITIVE_BOOLEAN copy and the enumWithBoolean() helper are gone. LinkJournal=, ResolvConf= and Volatile= now spell out PreferValidAlternativeCombinator(names, BOOLEAN) inline, with the boolean spellings (off; no/yes) dropped from the case-sensitive names. Tests gain mixed-case booleans (Yes, TRUE, oFf) and mixed-case names that must stay invalid, all confirmed with fuzz-nspawn-settings at 0f0682b773. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replace the branch-local NspawnSafeAtoNumberTerminal, safeAtoNumber(), SAFE_ATO_SHAPE/NSPAWN_SAFE_ATO_SHAPE_SPACED, safeAtoValueOf() and isPositiveIfindex() with the shared SafeAtoTerminal, written out at each call site: - OOMScoreAdjust=: signed, -1000..1000, whole value. - Port=: parse_ip_port, REFUSE_LEADING_WHITESPACE, 1..65535. - Capability=: signed, 0..62, whitespace-split word. - Interface names: parse_ifindex via SafeAtoTerminal.valueOf(). Now accepted, matching sd-check: OOMScoreAdjust=\v5, \v-5, \f-1000; Port=\v80, tcp:\v80:81, 80:\v81, and the strtoul wrap-around 0b -<2^64-80 in binary> (port 80). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sjrx-claude-sandbox
force-pushed
the
feat/validators-nspawn
branch
from
October 24, 2026 18:31
992b83a to
af913e4
Compare
bind_mount_parse() stores everything after the second colon verbatim, so the settings parser accepts any option string; only parse_mount_bind_options() rejects unknown options when the container starts. Keep the known options as the first alternative for completion and highlighting, and accept any other option string. Paths and field counts are still checked as bind_mount_parse() does. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
No description provided.