Skip to content

rsync-ssl, testsuite: accept --type=SSL_TYPE anywhere in the args - #1047

Open
Zeno-sole wants to merge 1 commit into
RsyncProject:masterfrom
Zeno-sole:master
Open

rsync-ssl, testsuite: accept --type=SSL_TYPE anywhere in the args#1047
Zeno-sole wants to merge 1 commit into
RsyncProject:masterfrom
Zeno-sole:master

Conversation

@Zeno-sole

Copy link
Copy Markdown

The --type=... option was only recognized as the first argument, so a command such as "rsync-ssl --dry-run --type=stunnel host::mod" passed the option through to the underlying rsync, which rejected it as unknown. Scan the full argument list for --type=..., export RSYNC_SSL_TYPE, and drop the option before handing the remaining args to rsync. The manpage no longer says the option must be first.

Adds a test that runs rsync-ssl with a fake rsync in PATH and checks that --type= is consumed in first, middle, and last positions.

The --type=... option was only recognized as the first argument, so a
command such as "rsync-ssl --dry-run --type=stunnel host::mod" passed
the option through to the underlying rsync, which rejected it as
unknown.  Scan the full argument list for --type=..., export
RSYNC_SSL_TYPE, and drop the option before handing the remaining args
to rsync.  The manpage no longer says the option must be first.

Adds a test that runs rsync-ssl with a fake rsync in PATH and checks
that --type= is consumed in first, middle, and last positions.
@Zeno-sole

Copy link
Copy Markdown
Author

Before repair:
RSYNC_SSL_CA_CERT=/tmp/server.crt rsync-ssl --dry-run --type=stunnel 10.20.8.153::backuprsync: --type=stunnel: unknown option
rsync error: syntax or usage error (code 1) at main.c(1806) [client=3.4.4]

After repair:
RSYNC_SSL_CA_CERT=/tmp/server.crt rsync-ssl --dry-run --type=stunnel 10.20.8.153::backup
drwxrwxr-x 4,096 2026/08/13 17:54:16 .
-rw-rw-r-- 0 2026/08/13 17:54:16 111

@Zeno-sole

Copy link
Copy Markdown
Author

I would like to kindly request a code review from the upstream author/maintainer. @tridge

@steadytao

steadytao commented Aug 14, 2026

Copy link
Copy Markdown
Member

No need to ping after less then 24 hours. 1) a release has just been made with major security concerns, we are resting. 2) its been less then 24 hours :D

Let's be respectful. "kindly" doesn't make something respectful.

Comment thread rsync-ssl
Comment on lines +229 to +237
args=()
for arg in "$@"; do
if [[ "$arg" == --type=* ]]; then
export RSYNC_SSL_TYPE="${arg#--type=}"
else
args+=("$arg")
fi
done
set -- "${args[@]}"

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.

Stop interpreting wrapper options at --

As written, rsync-ssl -- --type=stunnel consumes an operand that was explicitly protected from option parsing. Preserve -- and every subsequent argument, and add a regression for this case.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants