Skip to content

fix(daemon): honour the leading-comma separator form in auth users and gid - #7345

Merged
oferchen merged 1 commit into
masterfrom
fix/daemon-conf-strtok
Aug 15, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/daemon-conf-strtok

Conversation

@oferchen

Copy link
Copy Markdown
Owner

fix(daemon): honour the leading-comma separator form in auth users and gid

auth users = ,@domain admins names ONE group whose name contains a space.
oc split that value on commas AND THEN on whitespace, unconditionally, so it
became two entries: @domain and admins.

Both halves are wrong at once, and in opposite directions - the rule the
operator wrote never matches, and a rule they never wrote starts matching. A
false DENY and a false ALLOW from a single config line.

upstream's conf_strtok() (util1.c:932) has TWO modes, selected by the value
itself:

if (*str == ',')            /* after leading whitespace */
    commas_only = 1;        /* split on ',' alone, trim each token */
else
    strtok(str, " ,\t\r\n") /* split on whitespace OR commas */

A leading comma opts the whole list into comma-only splitting, which is how an
entry gets to contain a space. Without one, whitespace still separates - so
this is additive, not a change to the common form.

SCOPE - upstream calls conf_strtok() at exactly three sites covering two
directives, and both are fixed here:

directive upstream site oc site verdict
auth users authenticate.c:356 parse_auth_user_list DIVERGENT
gid clientserver.c:844, :861 parse_gid_setting DIVERGENT
hosts allow access.c:259 plain strtok - correct as-is
hosts deny access.c:259 plain strtok - correct as-is
refuse options not a conf_strtok directive parse_dedup_list out of scope

hosts allow/hosts deny are the trap: they read as the same shape of
directive, but upstream splits them with a plain strtok(list2, " ,\t") and has
no comma-only mode. Widening the new helper to cover them would introduce a
divergence, not remove one. parse_dedup_list's only caller is
parse_refuse_option_list. Both facts are now written at the code so the next
reader does not "finish the job" and break the two that are already right.

The two divergent sites now share one conf_split() helper, mirroring
upstream's own structure - one splitter, two consumers - rather than
duplicating the mode test.

Verification: 32/32 targeted tests green, 8 of them new. Mutation - disabling
the leading-comma mode kills 4 of the 32, and 28 + 4 = 32 reconciles against
the run count, so no fail-fast truncation is hiding kills. fmt clean; clippy
-D warnings clean on the crate.

The full -p daemon run could NOT be completed locally and is left to CI. Two
attempts died on ENFILE (Too many open files in system, os error 23) and a
third on SIGABRT. That is a host condition, not this change: kern.num_files
sits at 195267 of 245760 at rest, and lsof attributes ~91000 of those to
wedged daemon-<hash> nextest binaries from OTHER clones, aged 8 and 20 days
(one holds 54595 fds by itself). They were left running rather than killed,
since they belong to other sessions. A local suite failure on this host must be
checked against sysctl kern.num_files before it is read as a code failure.

…d gid

`auth users = ,@Domain admins` names ONE group whose name contains a space.
oc split that value on commas AND THEN on whitespace, unconditionally, so it
became two entries: `@domain` and `admins`.

Both halves are wrong at once, and in opposite directions - the rule the
operator wrote never matches, and a rule they never wrote starts matching. A
false DENY and a false ALLOW from a single config line.

upstream's `conf_strtok()` (util1.c:932) has TWO modes, selected by the value
itself:

    if (*str == ',')            /* after leading whitespace */
        commas_only = 1;        /* split on ',' alone, trim each token */
    else
        strtok(str, " ,\t\r\n") /* split on whitespace OR commas */

A leading comma opts the whole list into comma-only splitting, which is how an
entry gets to contain a space. Without one, whitespace still separates - so
this is additive, not a change to the common form.

SCOPE - upstream calls conf_strtok() at exactly three sites covering two
directives, and both are fixed here:

| directive        | upstream site               | oc site           | verdict   |
|------------------|-----------------------------|-------------------|-----------|
| `auth users`     | authenticate.c:356          | parse_auth_user_list | DIVERGENT |
| `gid`            | clientserver.c:844, :861    | parse_gid_setting    | DIVERGENT |
| `hosts allow`    | access.c:259 plain strtok   | -                 | correct as-is |
| `hosts deny`     | access.c:259 plain strtok   | -                 | correct as-is |
| `refuse options` | not a conf_strtok directive | parse_dedup_list  | out of scope |

`hosts allow`/`hosts deny` are the trap: they read as the same shape of
directive, but upstream splits them with a plain `strtok(list2, " ,\t")` and has
no comma-only mode. Widening the new helper to cover them would introduce a
divergence, not remove one. `parse_dedup_list`'s only caller is
`parse_refuse_option_list`. Both facts are now written at the code so the next
reader does not "finish the job" and break the two that are already right.

The two divergent sites now share one `conf_split()` helper, mirroring
upstream's own structure - one splitter, two consumers - rather than
duplicating the mode test.

Verification: 32/32 targeted tests green, 8 of them new. Mutation - disabling
the leading-comma mode kills 4 of the 32, and 28 + 4 = 32 reconciles against
the run count, so no fail-fast truncation is hiding kills. fmt clean; clippy
-D warnings clean on the crate.

The full `-p daemon` run could NOT be completed locally and is left to CI. Two
attempts died on ENFILE (`Too many open files in system`, os error 23) and a
third on SIGABRT. That is a host condition, not this change: `kern.num_files`
sits at 195267 of 245760 at rest, and `lsof` attributes ~91000 of those to
wedged `daemon-<hash>` nextest binaries from OTHER clones, aged 8 and 20 days
(one holds 54595 fds by itself). They were left running rather than killed,
since they belong to other sessions. A local suite failure on this host must be
checked against `sysctl kern.num_files` before it is read as a code failure.
@github-actions github-actions Bot added the bug Something isn't working label Aug 15, 2026
@oferchen
oferchen merged commit 91c862e into master Aug 15, 2026
70 checks passed
@oferchen
oferchen deleted the fix/daemon-conf-strtok branch August 15, 2026 04:10
oferchen added a commit that referenced this pull request Aug 21, 2026
…te (#7423)

The changelog had not been touched since 2026-08-13 (#7279) while ~140 PRs
merged, and several factual claims in README/SECURITY had drifted far enough
to mislead an operator. Each correction below was verified against the tree,
not inferred.

CHANGELOG: fill in Unreleased for everything merged since #7279, grouped by
Security / Added / Changed / Fixed / Testing and CI / Documentation.

SECURITY:
- The 3.5.0 divergence figure said 133. The committed expect manifests say
  43 + 62 on the two full-corpus legs (64 distinct) and 89 across all four.
  Replaced the estimate with the per-leg table and the manifest mechanism.
- The CI paragraph described the 3.5.0 suite as a separate nightly job. It
  is now the required gate, four legs, on every pull request.
- CVE-2026-53791: the placeholder-peer-address prerequisite is fixed
  (#7303), not pending. CVE-2026-70452, -70463 and -70453 are fixed
  (#7314, #7345, #7293) and were still listed as under audit.
- The new-defensive-surface paragraph listed all eight 3.5.0 additions as
  being adopted; four have shipped and two directives have not.
- The fuzz list named 24 targets including "rsyncd_conf", which does not
  exist in fuzz/fuzz_targets. There are 26; added the three real ones that
  were missing.
- The buffer-pool hardening note claimed recycle_buffer guards buf_id with
  a debug assertion and warned against exposing io_uring to untrusted
  input. The check is a real release-mode bound returning
  BufferIdOutOfRange before any state is mutated, so the warning was false.

README:
- Status and interop sections listed 3.5.0 as built-and-cached ahead of
  gating; run_interop.sh has it in the gating version list, and the
  protocol table row still said "not yet gating".
- Added the current 3.5.0 testsuite outcomes rather than only describing
  the mechanism, so the 64 open divergences are stated plainly.
- The CVE line stopped at the 2024 batch; the 3.4.3 batch is closed and
  3.5.0 is partially closed and tracked.
- The spill CLI flags were described as planned for STN-11; both exist.
- The OC_RSYNC_BUFFER_POOL variables were attributed to the io_uring
  registered pool. All three live in crates/engine/src/local_copy/
  buffer_pool/ and tune the engine pool; the io_uring pool is a
  different, static one.
- The bgid note advised monitoring for exhaustion that measurement shows
  does not occur.
- Fixed a broken link: compressed_token/zstd_codec is a directory.
- Listed the shipped 3.5.0 option surface in the feature table.
oferchen added a commit that referenced this pull request Aug 24, 2026
…d gid (#7345)

`auth users = ,@Domain admins` names ONE group whose name contains a space.
oc split that value on commas AND THEN on whitespace, unconditionally, so it
became two entries: `@domain` and `admins`.

Both halves are wrong at once, and in opposite directions - the rule the
operator wrote never matches, and a rule they never wrote starts matching. A
false DENY and a false ALLOW from a single config line.

upstream's `conf_strtok()` (util1.c:932) has TWO modes, selected by the value
itself:

    if (*str == ',')            /* after leading whitespace */
        commas_only = 1;        /* split on ',' alone, trim each token */
    else
        strtok(str, " ,\t\r\n") /* split on whitespace OR commas */

A leading comma opts the whole list into comma-only splitting, which is how an
entry gets to contain a space. Without one, whitespace still separates - so
this is additive, not a change to the common form.

SCOPE - upstream calls conf_strtok() at exactly three sites covering two
directives, and both are fixed here:

| directive        | upstream site               | oc site           | verdict   |
|------------------|-----------------------------|-------------------|-----------|
| `auth users`     | authenticate.c:356          | parse_auth_user_list | DIVERGENT |
| `gid`            | clientserver.c:844, :861    | parse_gid_setting    | DIVERGENT |
| `hosts allow`    | access.c:259 plain strtok   | -                 | correct as-is |
| `hosts deny`     | access.c:259 plain strtok   | -                 | correct as-is |
| `refuse options` | not a conf_strtok directive | parse_dedup_list  | out of scope |

`hosts allow`/`hosts deny` are the trap: they read as the same shape of
directive, but upstream splits them with a plain `strtok(list2, " ,\t")` and has
no comma-only mode. Widening the new helper to cover them would introduce a
divergence, not remove one. `parse_dedup_list`'s only caller is
`parse_refuse_option_list`. Both facts are now written at the code so the next
reader does not "finish the job" and break the two that are already right.

The two divergent sites now share one `conf_split()` helper, mirroring
upstream's own structure - one splitter, two consumers - rather than
duplicating the mode test.

Verification: 32/32 targeted tests green, 8 of them new. Mutation - disabling
the leading-comma mode kills 4 of the 32, and 28 + 4 = 32 reconciles against
the run count, so no fail-fast truncation is hiding kills. fmt clean; clippy
-D warnings clean on the crate.

The full `-p daemon` run could NOT be completed locally and is left to CI. Two
attempts died on ENFILE (`Too many open files in system`, os error 23) and a
third on SIGABRT. That is a host condition, not this change: `kern.num_files`
sits at 195267 of 245760 at rest, and `lsof` attributes ~91000 of those to
wedged `daemon-<hash>` nextest binaries from OTHER clones, aged 8 and 20 days
(one holds 54595 fds by itself). They were left running rather than killed,
since they belong to other sessions. A local suite failure on this host must be
checked against `sysctl kern.num_files` before it is read as a code failure.
oferchen added a commit that referenced this pull request Aug 24, 2026
…te (#7423)

The changelog had not been touched since 2026-08-13 (#7279) while ~140 PRs
merged, and several factual claims in README/SECURITY had drifted far enough
to mislead an operator. Each correction below was verified against the tree,
not inferred.

CHANGELOG: fill in Unreleased for everything merged since #7279, grouped by
Security / Added / Changed / Fixed / Testing and CI / Documentation.

SECURITY:
- The 3.5.0 divergence figure said 133. The committed expect manifests say
  43 + 62 on the two full-corpus legs (64 distinct) and 89 across all four.
  Replaced the estimate with the per-leg table and the manifest mechanism.
- The CI paragraph described the 3.5.0 suite as a separate nightly job. It
  is now the required gate, four legs, on every pull request.
- CVE-2026-53791: the placeholder-peer-address prerequisite is fixed
  (#7303), not pending. CVE-2026-70452, -70463 and -70453 are fixed
  (#7314, #7345, #7293) and were still listed as under audit.
- The new-defensive-surface paragraph listed all eight 3.5.0 additions as
  being adopted; four have shipped and two directives have not.
- The fuzz list named 24 targets including "rsyncd_conf", which does not
  exist in fuzz/fuzz_targets. There are 26; added the three real ones that
  were missing.
- The buffer-pool hardening note claimed recycle_buffer guards buf_id with
  a debug assertion and warned against exposing io_uring to untrusted
  input. The check is a real release-mode bound returning
  BufferIdOutOfRange before any state is mutated, so the warning was false.

README:
- Status and interop sections listed 3.5.0 as built-and-cached ahead of
  gating; run_interop.sh has it in the gating version list, and the
  protocol table row still said "not yet gating".
- Added the current 3.5.0 testsuite outcomes rather than only describing
  the mechanism, so the 64 open divergences are stated plainly.
- The CVE line stopped at the 2024 batch; the 3.4.3 batch is closed and
  3.5.0 is partially closed and tracked.
- The spill CLI flags were described as planned for STN-11; both exist.
- The OC_RSYNC_BUFFER_POOL variables were attributed to the io_uring
  registered pool. All three live in crates/engine/src/local_copy/
  buffer_pool/ and tune the engine pool; the io_uring pool is a
  different, static one.
- The bgid note advised monitoring for exhaustion that measurement shows
  does not occur.
- Fixed a broken link: compressed_token/zstd_codec is a directory.
- Listed the shipped 3.5.0 option surface in the feature table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant