[Bug 8440] New: rsync goes interactive on missing --password-file
samba-bugs at samba.org
samba-bugs at samba.org
Tue Sep 6 15:19:58 MDT 2011
https://bugzilla.samba.org/show_bug.cgi?id=8440
Summary: rsync goes interactive on missing --password-file
Product: rsync
Version: 3.1.0
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedBy: rsync-bugzilla at dimebar.com
QAContact: rsync-qa at samba.org
I've a script which calls:
rsync --password-file=password.txt rsync://server/files /files
However, due to an unrelated error password.txt was missing.
In authenticate.c:auth_client, the code tries to read from the password file,
then tries the RSYNC_PASSWORD env var, then calls getpass(3). This last step is
causing problems as, even though the script is intended to run unattended, it
stops at the password prompt.
This only happens when running with a controlling tty (more specifically,
without a controlling tty getpass(3) can't open /dev/tty), for example, in the
%post script of a Redhat / Fedora kickstart file.
Demonstration:
# rsync -vv --password-file=password.txt rsync://server/files /files <
/dev/null
opening tcp connection to server port 873
opening connection using --server --sender -vv . files
rsync: could not open password file "password.txt": No such file or directory
(2)
Password:
<< rsync waits forever here >>
Suggested fix is to error-out in auth_client() when the given requested
--password-file can't be used, rather than trying to continue with other
credentials.
Wrapping up rsync in a setsid caller avoids the problem, but dissociates from
the shell so it's impossible to catch exit status.
Quoting the manpage, "You can avoid the password prompt by ... using the
--password-file option." This is not true in all cases.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the rsync
mailing list