Every other failure condition in that function was alreadying doing this,
and I saw a case with a lot of "mkstemp...No space left on device" messages
started becoming "mkstemp...Too many open files" messages because of this
bug. Not that it makes a whole lot of difference, since nothing gets copied
because the disk was out of space.
reduce symbol dependencies between files and therefore make it easier
to write unit tests. The diff is large, but the actual code changes
are pretty small.
clients when writing to a rsync server
it works like this:
- we have an extra pipe from the receiver to the generator
- the server always runs with multiplexing on
- errors from the generator go down the multiplexed connection
- errors from the receiver go over the pipe, and from there to
the multiplexed conn
it required some incredibly ugly code. damn.
--compare-dest. It was due to an incomplete analysis of the problem,
sorry. I left a comment in its place indicating that normally the
parent directories should already have been created.
It turned out to actually be a bug in nsbd in which it was not always
including all the parent directories in the include list like it was
supposed to. The files themselves were still being sent but that was only
because my exclude_the_rest optimization was kicking in; if it weren't,
excluding the parent directories would have had the side effect of
excluding the files too. So it really had nothing to do with the
--compare-dest option after all, just with the requirement that if you use
--exclude '*' you need to explicitly include all parent directories of
files you include.
target destination were not getting created. There was a case in
receiver.c to do that but it was only getting invoked when the -R option is
specified, although I don't know why it was limited to that.
It's too bad I didn't get a chance to more fully test the use of
--compare-dest by my nsbd program before releasing rsync 2.3.0. I'll
probably need to put a workaround in nsbd too until the next release
of rsync.
other access resulted in group and other access being left off when the
'-p' option was not used. This fixes it by reintroducing the ACCESSPERMS
mask and setting permissions to (file->mode & ACCESSPERMS) if preserve_perms
is off. I decided to change the mask INITPERMMASK to INITACCESSPERMS at
the same time. When preserve_perms is off, rsync is restored to the
previous behavior of having the permissions of the original file with the
umask and setuid/setgid bits shut off.
Also, I decided that a check for "(updated && (file->mode & ~ACCESSPERMS))"
is no longer needed since as far as I can tell that would have only affected
permissions when not running as root and when a chgrp was done to a group
the user was not a member of, using system V chgrp semantics. This is no
longer allowed.
an obscure race-condition security hole where a file may for a short time
have the wrong group. Could have used 707 instead but that's just too weird
of a permission. The define name used to be ACCESSPERMS but that is defined
as 777 on Linux, so changed the name to INITPERMMASK.
in receiver.c because it confuses people when they do something like
rsync /etc/passwd /tmp/nonexistentdir/passwd
and it printed out something like
open /tmp/noniexistentdir/.passwd.a004d5 : No such file or directory
Reported by kurt_granroth@pobox.com in PR #1253.
Jason Andrade convinced me to add ftpd style logging of transfers,
enabled with a "transfer logging" option in rsyncd.conf
you can customise the format in log.c