Repository navigation
auth: read only the first password-file line - #1137
Merged
steadytao merged 2 commits intoOct 23, 2026
Merged
Conversation
strtok() skips leading delimiters, so an empty first line followed by a password was interpreted as that password. Stop at the first CR/LF instead, keeping an empty first line empty and making file and stdin behavior consistent. Add daemon-auth regression coverage for LF, CRLF, empty input, an empty first line, and a final line without a newline for both input sources. Fixes RsyncProject#1134. Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
sairex53
force-pushed
the
fix-1134-password-first-line
branch
from
October 21, 2026 10:00
f4107e9 to
1ea8f84
Compare
steadytao
requested changes
Oct 21, 2026
Supply the valid daemon password through RSYNC_PASSWORD in negative cases, then require exit status 1 and the password read diagnostic. Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getpassf()usedstrtok(), which skips leading CR/LF delimiters. An empty first line could therefore make rsync use a later password, contrary to the documented first-line behavior.Stop at the first CR/LF without skipping it. This keeps an empty first line empty and makes password-file and stdin handling consistent. The regression test covers LF, CRLF, empty input, an empty first line followed by a password, and a final line without a newline for both input sources.
Fixes #1134.
Testing on Fedora 44 ARM64:
make -j4 check— 274 passed, 99 skipped, 0 failedgit diff --check