Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/almalinux-8-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ jobs:
attr libattr-devel acl libacl-devel \
zstd libzstd-devel \
lz4 lz4-devel \
xxhash xxhash-devel
xxhash xxhash-devel \
libidn2 libidn2-devel
alternatives --set python3 /usr/bin/python3.9
pip3 install commonmark
- name: configure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-static-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# checksums and its bundled zlib.
./configure --host=${{ matrix.triple }} --build=x86_64-pc-linux-gnu \
--enable-ipv6 \
--disable-zstd --disable-lz4 --disable-xxhash --disable-openssl \
--disable-zstd --disable-lz4 --disable-xxhash --disable-openssl --disable-idn \
--disable-iconv --disable-iconv-open \
--disable-acl-support --disable-xattr-support \
--disable-md2man --disable-roll-simd \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/asan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: prep
run: |
sudo apt-get update
sudo apt-get install -y clang acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev openssl
sudo apt-get install -y clang acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev openssl
echo "/usr/local/bin" >>"$GITHUB_PATH"
- name: configure
# -DNDEBUG builds as a shipped release does (assert() compiled out), so
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: prep
run: |
sudo apt-get update
sudo apt-get install -y acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev python3-cmarkgfm openssl gcovr
sudo apt-get install -y acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev python3-cmarkgfm openssl gcovr
echo "/usr/local/bin" >>"$GITHUB_PATH"
- name: configure
run: ./configure --enable-coverage --with-rrsync
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cygwin-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: choco install -y --no-progress cygwin cyg-get
- name: prep
run: |
cyg-get make autoconf automake gcc-core attr libattr-devel python39 python39-pip libzstd-devel liblz4-devel libssl-devel libxxhash0 libxxhash-devel
cyg-get make autoconf automake gcc-core attr libattr-devel python39 python39-pip libzstd-devel liblz4-devel libssl-devel libxxhash0 libxxhash-devel libidn2-devel
echo "C:/tools/cygwin/bin" >>$Env:GITHUB_PATH
- name: commonmark
run: bash -c 'python3 -mpip install --user commonmark'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fleettest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y gcc g++ gawk autoconf automake \
acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev \
acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev \
python3-cmarkgfm openssl rsync openssh-server
- name: set up ssh to localhost
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/freebsd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
pkg install -y bash autotools m4 devel/xxhash zstd liblz4 python3 archivers/liblz4 git
run: |
freebsd-version
./configure --with-rrsync -disable-zstd --disable-md2man --disable-xxhash --disable-lz4
./configure --with-rrsync -disable-zstd --disable-md2man --disable-xxhash --disable-lz4 --disable-idn
make
./rsync --version
make check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
- name: prep
run: |
brew install automake openssl xxhash zstd lz4
brew install automake openssl xxhash zstd lz4 libidn2
pip3 install --user --break-system-packages commonmark
echo "$(brew --prefix)/bin" >>"$GITHUB_PATH"
- name: configure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/netbsd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
ln -sf /usr/pkg/bin/python3.12 /usr/pkg/bin/python3
run: |
uname -a
./configure --with-rrsync --disable-zstd --disable-md2man --disable-xxhash --disable-lz4
./configure --with-rrsync --disable-zstd --disable-md2man --disable-xxhash --disable-lz4 --disable-idn
make
./rsync --version
make check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openbsd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uname -a
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
./configure --with-rrsync --disable-zstd --disable-md2man --disable-xxhash --disable-lz4
./configure --with-rrsync --disable-zstd --disable-md2man --disable-xxhash --disable-lz4 --disable-idn
make
./rsync --version
make check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: prep
run: |
sudo apt-get update
sudo apt-get install -y clang clang-tools acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev openssl
sudo apt-get install -y clang clang-tools acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev openssl
- name: configure (under scan-build)
# Run configure under scan-build so its analyzer compiler-wrapper is baked
# into the Makefile's $(CC); --disable-md2man avoids the doc toolchain.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solaris-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
pkg install bash automake gnu-m4 pkg://solaris/runtime/python-35 autoconf gcc git
run: |
uname -a
./configure --with-rrsync -disable-zstd --disable-md2man --disable-xxhash --disable-lz4
./configure --with-rrsync -disable-zstd --disable-md2man --disable-xxhash --disable-lz4 --disable-idn
make
./rsync --version
make check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-22.04-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0
- name: prep
run: |
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev python3-cmarkgfm openssl
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev python3-cmarkgfm openssl
echo "/usr/local/bin" >>"$GITHUB_PATH"
- name: configure
run: ./configure --with-rrsync
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fetch-depth: 0
- name: prep
run: |
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev python3-cmarkgfm openssl
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev python3-cmarkgfm openssl
echo "/usr/local/bin" >>"$GITHUB_PATH"
- name: configure
run: ./configure --with-rrsync
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-version-mix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fetch-depth: 0
- name: prep
run: |
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev python3-cmarkgfm openssl
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev libidn2-dev python3-cmarkgfm openssl
echo "/usr/local/bin" >>"$GITHUB_PATH"
- name: configure
run: ./configure --with-rrsync
Expand Down
14 changes: 14 additions & 0 deletions access.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#ifdef HAVE_NETGROUP_H
#include <netgroup.h>
#endif
#ifdef SUPPORT_IDN
#include <idn2.h>
#endif

static int allow_forward_dns;

Expand All @@ -33,6 +36,9 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
struct hostent *hp;
unsigned int i;
const char *host = *host_ptr;
#ifdef SUPPORT_IDN
char idn_tok[1024], *idn;
#endif

if (!host || !*host)
return 0;
Expand All @@ -42,6 +48,14 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
return innetgr(tok + 1, host, NULL, NULL);
#endif

#ifdef SUPPORT_IDN
if (idn2_to_ascii_8z(tok, &idn, IDN2_NFC_INPUT | IDN2_NONTRANSITIONAL) == IDN2_OK) {
strlcpy(idn_tok, idn, sizeof idn_tok);
idn2_free(idn);
tok = idn_tok;
}
#endif

/* First check if the reverse-DNS-determined hostname matches. */
if (iwildmatch(tok, host))
return 1;
Expand Down
23 changes: 22 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h dl.h \
popt.h popt/popt.h linux/falloc.h netinet/in_systm.h netgroup.h \
zlib.h xxhash.h openssl/md4.h openssl/md5.h zstd.h lz4.h sys/file.h \
bsd/string.h)
bsd/string.h idn2.h)
AC_CHECK_HEADERS([netinet/ip.h], [], [], [[#include <netinet/in.h>]])
AC_HEADER_MAJOR_FIXED

Expand Down Expand Up @@ -626,6 +626,27 @@ else
AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING([whether to enable IDN support])
AC_ARG_ENABLE([idn],
AS_HELP_STRING([--disable-idn], [disable to omit IDN (Internationalized Domain Name) support]))
AH_TEMPLATE([SUPPORT_IDN],
[Undefine if you do not want IDN support. By default this is defined.])
if test x"$enable_idn" != x"no"; then
if test x"$ac_cv_header_idn2_h" = x"yes"; then
AC_MSG_RESULT(yes)
AC_SEARCH_LIBS(idn2_lookup_ul, idn2,
[AC_DEFINE(SUPPORT_IDN)],
[err_msg="$err_msg$nl- Failed to find idn2_lookup_ul function in idn2 lib.";
no_lib="$no_lib idn"])
else
AC_MSG_RESULT(no)
err_msg="$err_msg$nl- Failed to find idn2.h for IDN support."
no_lib="$no_lib idn"
fi
else
AC_MSG_RESULT(no)
fi

if test x"$no_lib" != x; then
echo ""
echo "Configure found the following issues:"
Expand Down
15 changes: 15 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#ifdef __TANDEM
#include <floss.h(floss_execlp)>
#endif
#ifdef SUPPORT_IDN
#include <idn2.h>
#endif

extern int dry_run;
extern int list_only;
Expand Down Expand Up @@ -517,6 +520,18 @@ static pid_t do_cmd(char *cmd, char *machine, char *user, char **remote_argv, in
char *args[MAX_ARGS], *need_to_free = NULL;
pid_t pid;
int dash_l_set = 0;
#ifdef SUPPORT_IDN
char idn_machine[1024];

if (machine && daemon_connection > 0) {
char *idn;
if (idn2_lookup_ul(machine, &idn, IDN2_NONTRANSITIONAL) == IDN2_OK) {
strlcpy(idn_machine, idn, sizeof idn_machine);
idn2_free(idn);
machine = idn_machine;
}
}
#endif

if (!read_batch && !local_server) {
char *t, *f, in_quote = '\0';
Expand Down
12 changes: 12 additions & 0 deletions socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#include <netinet/ip.h>
#endif
#include <netinet/tcp.h>
#ifdef SUPPORT_IDN
#include <idn2.h>
#endif

extern char *bind_address;
extern char *sockopts;
Expand Down Expand Up @@ -196,6 +199,15 @@ int open_socket_out(char *host, int port, const char *bind_addr, int af_hint)
int proxied = 0;
char buffer[1024];
char *proxy_user = NULL, *proxy_pass = NULL;
#ifdef SUPPORT_IDN
char *idn, idn_host[1024];

if (idn2_lookup_ul(host, &idn, IDN2_NONTRANSITIONAL) == IDN2_OK) {
strlcpy(idn_host, idn, sizeof idn_host);
idn2_free(idn);
host = idn_host;
}
#endif

/* if we have a RSYNC_PROXY env variable then redirect our
* connection via a web proxy at the given address. */
Expand Down
Loading