Skip to content

Add IDN support - #986

Merged
steadytao merged 4 commits into
RsyncProject:masterfrom
cicku:master
Aug 20, 2026
Merged

Add IDN support#986
steadytao merged 4 commits into
RsyncProject:masterfrom
cicku:master

Conversation

@cicku

@cicku cicku commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

rsync can now connect to IDN (internationalized domain name) hosts, and IDN names are recognized in a daemon's hosts allow/deny.

Closes #851.

@cicku
cicku force-pushed the master branch 2 times, most recently from 45f99f7 to b6c29d8 Compare June 13, 2026 13:43
@cicku

cicku commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@tridge requesting a review

@steadytao steadytao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apologies, I have been attending to some personal matters recently. This needs careful review against IDNA/punycode behaviour and daemon allow/deny matching semantics before merge. I would want tests covering Unicode input, punycode input, mixed-case hostnames, invalid IDNs and allow/deny matching to make sure this does not widen host access unexpectedly.

@cicku

cicku commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Tests added

Comment thread util1.c Outdated
steadytao

This comment was marked as outdated.

@steadytao steadytao added bug Something isn't working MergeOnCIPass labels Aug 12, 2026
@cicku
cicku force-pushed the master branch 2 times, most recently from 8254de4 to beff021 Compare August 17, 2026 04:40
@steadytao

Copy link
Copy Markdown
Member

Ah, can you update the clang informational-latest job as well please?

cicku added 3 commits August 18, 2026 10:59
rsync can now connect to IDN (internationalized domain name) hosts, and
IDN names are recognized in a daemon's hosts allow/deny.
The IDNA mapping folds some non-ASCII characters onto ASCII ones, so
running a whole hosts allow/deny token through idn2_to_ascii_8z() could
hand back a pattern the admin never wrote: a "*" (U+FF0A FULLWIDTH
ASTERISK) entry came back as "*" and let every host in.

Convert label by label instead, keeping an ASCII label byte for byte and
using a converted label only when it comes back as a bare A-label. An
ASCII-only config now behaves as it did before there was IDN support, and
a token that cannot be converted is left alone and so matches nothing. The
client side shares the same helper, and neither side truncates a name at
its 1024-byte buffer any more. strlower() folds only ASCII now, since its
one caller is the hosts allow/deny list, which can hold UTF-8.

Adds testsuite/daemon-access-idn and extends testsuite/idn to cover
Unicode, punycode, mixed-case and invalid input on both sides.
The client path called idn2_lookup_ul() without IDN2_NFC_INPUT while the
daemon path passed it to idn2_to_ascii_8z(). Both normalize either way --
idn2_lookup_ul() ors the flag in itself, and TR46 normalizes as it maps --
but there is no reason for the two calls to read differently, so pass one set
of flags from one place. The flag asks libidn2 to normalize the label rather
than promising that it already is: it gates the u32_normalize() call, and
without it a decomposed label comes back IDN2_NOT_NFC.

Adds composed/decomposed cases to testsuite/idn, which sees the exact host
name rsync hands out, and a decomposed hosts allow token to
testsuite/daemon-access-idn.
@cicku

cicku commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Done

@steadytao steadytao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM -- Thank you for your work @cicku.

@steadytao

Copy link
Copy Markdown
Member

Cygwin died for some reason and cannot be cancelled. Need to refresh.

@cicku

cicku commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Is the test order non-deterministic...? (I don't think so)

@steadytao

Copy link
Copy Markdown
Member

Is the test order non-deterministic...? (I don't think so)

Some tests are flaky. Working on this under #1059 when I have time.

@steadytao
steadytao merged commit f0177d8 into RsyncProject:master Aug 20, 2026
22 of 23 checks passed
@steadytao

Copy link
Copy Markdown
Member

Thanks a lot for your work!

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

Labels

bug Something isn't working MergeOnCIPass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support for IDN (Internationalized Domain Names)

2 participants