Skip to content

Client stderr diagnostics print control bytes raw; rsync 3.5.2 escapes them #8884

Done

Description

@oferchen

rsync 3.5.2 escapes non-printable bytes in the diagnostics it writes to the client's stderr. oc writes them raw.

Measured (found while fixing #8738)

A --filter rule containing a vertical tab (VT, 0x0B) after its prefix is refused by both, with the same exit code. The text differs:

'%c' detail and echoed rule
3.5.2 the VT is printed as \#013 in both places
oc the raw 0x0B byte in both places

A tab is not escaped by 3.5.2, and oc matches there. The VT row was left out of the #8738 oracle cell for this reason.

Upstream

Messages reach stderr through rwrite() / filtered_fwrite() in log.c, which turns a byte that is not printable into \#ooo (octal). This applies to every client diagnostic, not only filter errors.

oc today

The daemon log file (logging-sink) escapes control bytes. Client stderr does not.

Target

Client stderr diagnostics escape non-printable bytes exactly as filtered_fwrite() does, with an oracle cell that includes the VT case. This is related to #8486 (valid UTF-8 names on stdout), which concerns the opposite direction: bytes oc escapes that 3.5.2 prints raw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions