Mention the latest protocol-29 changes.
[rsync/rsync.git] / NEWS
diff --git a/NEWS b/NEWS
index 8d1fbef..edbd15f 100644 (file)
--- a/NEWS
+++ b/NEWS
-NEWS for rsync 2.6.1 (UNRELEASED)
-Protocol: 28 (changed)
-Changes since 2.6.0:
+NEWS for rsync 2.6.4 (UNRELEASED)
+Protocol: 29 (changed)
+Changes since 2.6.3:
+
+  OUTPUT CHANGES:
+
+    - When rsync deletes a directory and outputs a verbose message about
+      it, it now appends a trailing slash to the name instead of (only
+      sometimes) outputting a preceding "directory " string.
+
+    - The --stats output will contain file-list time-statistics if both
+      sides are 2.6.4, or if the local side is 2.6.4 and the files are
+      being pushed (since the stats come from the sending side).
+      (Requires protocol 29 for a pull.)
+
+    - The "%o" (operation) log-format escape now has a third value (besides
+      "send" and "recv"):  "del." (with trailing dot to make it 4 chars).
+      This changes the way deletions are logged in the daemon's log file.
+
+    - When the --log-format option is combined with --verbose, rsync now
+      avoids outputting the name of the file twice in most circumstances.
+      As long as the --log-format item does not refer to any post-transfer
+      items (such as %b or %c), the --log-format message is output prior to
+      the transfer with --verbose being the equivalent of a --log-format of
+      '%n%L' (which outputs the name and any symlink info).  If the log
+      output must occur after the transfer to be complete, the only time
+      the name is also output prior to the transfer is when --progress was
+      specified (so that the name will precede the progress stats, and the
+      full --log-format output will come after).
+  
+  BUG FIXES:
 
-  ENHANCEMENTS:
+    - Restore the list-clearing behavior of "!" in a .cvsignore file (2.6.3
+      was only treating it as a special token in an rsync include/exclude
+      file).
 
-    * Lower memory use and more optimal transfer of data over
-      the socket (see the INTERNAL section for details).
+    - The combination of --verbose and --dry-run now mentions the full list
+      of changes that would be output without --dry-run.
 
-    * The RSYNC_PROXY environment variable can now contain a
-      "USER:PASS@" prefix before the "HOST:PORT" information.
-      (Bardur Arantsson)
+    - Avoid a mkdir warning when removing a directory in the destination
+      that already exists in the --backup-dir.
 
-    * The --progress output now mentions how far along in the
-      transfer we are, including both a count of files transferred
-      and a percentage of the total file-count that we've processed.
-      It also shows better current-rate-of-transfer and remaining-
-      transfer-time values.
+    - An OS that has a binary mode for its files (such as cygwin) needed
+      setmode(fd, O_BINARY) called on the temp-file we opened with
+      mkstemp().  (Fix derived from the cygwin's 2.6.3 rsync package.)
 
-    * The configure script now accepts --with-rsyncd-conf=PATH
-      to override the default value of the /etc/rsyncd.conf file.
+    - Fixed a potential hang when verbosity is high, the client side is
+      the sender, and the file-list is large.
 
-    * Added a couple extra diffs in the "patches" dir, removed the
-      ones that got applied, and rebuilt the rest.
+    - Fixed a potential protocol-corrupting bug where the generator
+      might accidentally merge a message from the receiver into the
+      middle of a multiplexed packet of data that is waiting for the
+      socket to allow it to flush.
 
-  BUG FIXES:
+    - We now check if the OS doesn't support using mknod() for creating
+      FIFOs and sockets, and compile-in using mkfifo() and socket() when
+      necessary.
 
-    * When -x (--one-file-system) is combined with -L (--copy-links)
-      or --copy-unsafe-links, no symlinked files are skipped, even
-      if the referent file is on a different filesystem.
-
-    * The --link-dest code now works properly for a non-root user
-      when (1) the UIDs of the source and destination differ and -o
-      was specified, or (2) when the group of the source can't be
-      used on the destination and -g was specified.
-
-    * Fixed a bug in the handling of -H (hard-links) that might
-      cause the expanded PATH/NAME value of the current item to
-      get overwritten (due to an expanded-name caching bug).
-      
-    * We now reset the "new data has been sent" flag at the start
-      of each file we send.  This makes sure that an interrupted
-      transfer with the --partial option set doesn't keep a shorter
-      temp file than the current basis file when no new data has been
-      transfered over the wire for that file.
-
-    * Fixed a byte-order problem in --batch-mode on big-endian
-      machines.  (Jay Fenlason)
-
-    * Fixed configure bug when running "./configure --disable-ipv6".
-
-    * Fixed "make test" bug when build dir is not the source dir.
-
-    * When using --cvs-exclude, the exclude items we get from a
-      directory's .cvsignore file once again only affect that one
-      directory (and not all following directories too).  The
-      items are also now properly word-split and parsed without
-      any +/- prefix munging.
-
-    * When specifying the USER@HOST: prefix for a file, the USER
-      part can now contain an '@', if needed (i.e. the last '@'
-      is used to find the HOST, not the first).
-
-    * Fixed some bugs in the handling of group IDs for non-root
-      users:  (1) It properly handles a group that the sender didn't
-      have a name for (it would previously skip changing the group
-      on any files in that group).  (2) If --numeric-ids is used,
-      rsync no longer attempts to set groups that the user doesn't
-      have the permission to set.
-
-    * Fixed the "refuse options" setting in the rsyncd.conf file.
-
-    * Improved the -x (--one-file-system) flag's handling of any
-      mount-point directories we encounter.  It is both more optimal
-      (in that it no longer does a useless scan of the contents of
-      the mount-point dirs) and also fixes a bug where a remapped
-      mount of the original filesystem could get discovered in a
-      subdir we should be ignoring.
-
-    * Rsync no longer discards a double-slash at the start of a filename
-      when trying to open the file.  It also no longer constructs names
-      that start with a double slash (unless the user supplied them).
-
-    * Path-specifying options to a daemon should now work the same with
-      or without chroot turned on.  Previously, such a option (such as
-      --link-dest) would get its absolute path munged into a relative
-      one if chroot was not on, making that setting fairly useless.
-      Rsync now transforms the path into one that is based on the
-      module's base dir when chroot is not enabled.
-
-    * Fixed compilation problem on Tru64 Unix (having to do with
-      sockaddr.sa_len and sockaddr.sin_len).
-
-    * Fixed a compatibility problem interacting with older rsync
-      versions that might send us an empty --suffix value without
-      telling us that --backup-dir was specified.
-
-    * The "hosts allow" option for a daemon-over-remote-shell
-      process now has improved support for IPv6 addresses and a fix
-      for systems that have a length field in their socket structs.
-
-    * Fixed the ability to request an empty backup --suffix when
-      sending files to an rsync daemon.
+    - Fixed an off-by-one error in the handling of --max-delete=N.
 
-  INTERNAL:
+    - One place in the code wasn't checking if fork() failed.
+
+    - The "ignore nonreadable" daemon parameter used to erroneously affect
+      symlinks that pointed to a non-existent file.  This has been fixed.
 
-    * Most of the I/O is now buffered, which results in a pretty
-      large speedup when running under MS Windows.  (Craig Barratt)
+    - If the OS does not have lchown() and a chown() of a symlink will
+      affect the referent of a symlink (as it should), we no longer try
+      to set the user and group of a symlink.
 
-    * Optimizations to the name-handling/comparing code have made
-      some significant reductions in user-CPU time for large file
-      sets.
+    - The generator now properly runs the hard-link loop and the dir-time
+      rewriting loop after we're sure that the redo phase is complete.
 
-    * Some variable-type cleanup that makes the code more consistent.
+    - When --backup was specified with --partial-dir=DIR (where DIR is a
+      relative path), the backup code was erroneously trying to backup a
+      file that was put into the partial-dir.
 
-    * Reduced memory requirements of hard link preservation.
-      (J.W. Schultz)
+    - If a file gets resent in a single transfer and the --backup option is
+      enabled along with --inplace, rsync no longer performs a duplicate
+      backup (it used to overwrite the first backup with the failed file).
 
-    * Implemented a new algorithm for hard-link handling that speeds
-      up the code significantly.  (J.W. Schultz and Wayne Davison)
+    - One call to flush_write_file() was not being checked for an error.
 
-    * The --hard-link option now uses the first existing file in the
-      group of linked files as the basis for the transfer.  This
-      prevents the sub-optimal transfer of a file's data when a new
-      hardlink is added on the sending side and it sorts alphabetically
-      earlier in the list than the files that are already present on the
-      receiving side.
+    - The --no-relative option was not being sent from the client to a
+      server sender.
 
-    * Dropped support for protocol versions less than 20
-      (2.3.0 released 15 Mar 1999) and activated warnings for
-      protocols less than 25 (2.5.0 released 23 Aug 2001)
-          (Wayne Davison and J.W. Schultz, severally)
+    - If an rsync daemon specified "dont compress = ..." for a file and the
+      client tried to specify --compress, the libz code was not handling a
+      compression level of 0 properly.  This could cause a transfer failure
+      if the block-size for a file was large enough (e.g. rsync might have
+      exited with an error for large files).
 
-    * More optimal data transmission for --hard-links (protocol 28).
+    - Fixed a bug that would sometimes surface when using --compress and
+      sending a file with a block-size larger than 64K (either manually
+      specified, or computed due to the file being really large).  Prior
+      versions of rsync would sometimes fail to decompress the data
+      properly, and thus the transferred file would fail its verification.
 
-    * More optimal data transmission for --checksum (protocol 28).
+    - If a daemon can't open the specified log file (i.e. syslog is not
+      being used), die without crashing.  We also output an error about
+      the failure on stderr (which will only be seen if --no-detach was
+      specified).
 
-    * Less memory is used when --checksum is specified.
+    - A local transfer no longer duplicates all its include/exclude options
+      (since the forked process already has a copy of the exclude list,
+      there's no need to send them a set of duplicates).
 
-    * Less memory is used in the file list (a per-file savings).
+    - When --progress is specified, the output of items that the generator
+      is creating (e.g. dirs, symlinks) is now integrated into the progress
+      output without overlapping it.  (Requires protocol 29.)
 
-    * The generator is now better about not modifying the file list
-      during the transfer in order to avoid a copy-on-write memory
-      bifurcation (on systems where fork() uses shared memory).
-      Previously, rsync's shared memory would slowly become unshared,
-      resulting in real memory usage nearly doubling on the receiving
-      side by the end of the transfer.  Now, as long as permissions
-      are being preserved, the shared memory should remain that way
-      for the entire transfer.
+    - When --timeout is specified, lulls that occur in the transfer while
+      the generator is doing work that does not generate socket traffic
+      (looking for changed files, deleting files, doing directory-time
+      touch-ups, etc.) will cause a new keep-alive packet to be sent that
+      should keep the transfer going as long as the generator continues to
+      make progress.  (Requires protocol 29.)
 
-    * Changed hardlink info and file_struct + strings to use
-      allocation pools.  This reduces memory use for large file-
-      sets and permits freeing memory to the OS.  (J.W. Schultz) 
+    - The stat size of a device is not added to the total file size of the
+      items in the transfer since the size might be undefined on some OSes.
 
-    * The 2 pipes used between the receiver and generator processes
-      (which are forked on the same machine) were reduced to 1 pipe
-      and the protocol improved so that (1) it is now impossible to
-      have the "redo" pipe fill up and hang rsync, and (2) trailing
-      messages from the receiver don't get lost on their way through
-      the generator over to the sender (the latter mainly affected
-      hard-link messages and verbose --stats output).
+    - Fixed a problem with refused-option messages sometimes not making it
+      back to the client side when a remote --files-from was in effect and
+      the daemon was the receiver.
 
-    * The reading & writing of the file-list in batch-mode is now
-      handled by the same code that sends & receives the list over
-      the wire.  This makes it much easier to maintain.
+    - The --compare-dest option was not updating a file that differred in
+      (the preserved) attributes from the version in the compare-dest DIR.
 
-    * Improved the internal uid/gid code to be more portable and
-      a little more optimized.
+    - When rsync is copying files into a write-protected directory, fixed
+      the changed-report output for the directory so that we don't report
+      an identical directory as changed.
 
-    * The device numbers sent when using --devices are now sent as
-      separate major/minor values with 32-bit accuracy (protocol 28).
-      Previously, the copied devices were sent as a single 32-bit
-      number.  This will make inter-operation of 64-bit binaries more
-      compatible with their 32-bit brethren.  Note that optimizations
-      in the binary protocol often sends the device data using fewer
-      bytes than before, even though more precision is now available.
+  ENHANCEMENTS:
+
+    - Rsync now supports popt's option aliases, which means that you can
+      use /etc/popt and/or ~/.popt to create your own option aliases.
+
+    - Added the --delete-during (--del) option which will delete files
+      from the receiving side incrementally as each directory in the
+      transfer is being processed.  This makes it more efficient than the
+      default, before-the-transfer behavior, which is now available as
+      --delete-before (and is still the default --delete-WHEN option that
+      will be chosen if --delete or --delete-excluded is specified without
+      a --delete-WHEN choice).  All the --del* options infer --delete, so
+      an rsync daemon that refuses "delete" will still refuse to allow any
+      file-deleting options.
+
+    - All the --delete-WHEN options are now more memory efficient:
+      Previously an entire duplicate set of file-list objects was created
+      on the receiving side for the entire destination hierarchy.  The new
+      algorithm only creates one directory of objects at a time (for files
+      inside the transfer).
+
+    - Added support for specifying multiple --compare-dest or --link-dest
+      options, but only of a single type. (Promoted from the patches dir
+      and enhanced.) (Requires protocol 29.)
+
+    - Added the --max-size option. (Promoted from the patches dir.)
+
+    - The daemon-mode options were separated from the normal rsync options
+      so that they can't be mixed together.  This makes it impossible to
+      start a daemon that had improper default option values that could
+      cause problems when a client connects (e.g. a hang or an abort).
+
+    - The --bwlimit option may now be used in combination with --daemon
+      to specify both a default value for the daemon side and a value
+      that cannot be exceeded by a user-specified --bwlimit option.
+
+    - Added the "port" parameter to the rsyncd.conf file. (Promoted from
+      the patches dir.)  Also added "address".  A command-line option
+      will take precedence over a config-file option, as expected.
+
+    - In _exit_cleanup(): when we are exiting with a partially-received
+      file, we now flush any data in the write-cache before closing the
+      partial file.
+
+    - The --inplace support was enhanced to work with --compare-dest and
+      --link-dest. (Requires protocol 29.)
+
+    - Added the --dirs (-d) option for an easier way to copy directories
+      without recursion.
+
+    - Added the --list-only option, which is mainly a way for the client to
+      put the server into listing mode without needing to resort to any
+      internal option kluges (e.g. the age-old use of "-r --exclude="/*/*"
+      for a non-recursive listing).  This option is used automatically
+      (behind the scenes) when a modern rsync speaks to a modern daemon,
+      but may also be specified manually if you want to force the use of
+      the --list-only option over a remote-shell connection.
+
+    - Added the --omit-dir-times (-O) option, which will avoid updating
+      the modified time for directories when --times was specified.  This
+      option will avoid an extra pass through the file-list at the end of
+      the transfer (to tweak all the directory times), which can result in
+      an appreciable speedup for a really large transfer. (Promoted from
+      the patches dir.)
+
+    - Added the --filter (-f) option and its helper option, -F.  Filter
+      rules are an extension to the existing include/exclude handling
+      that also supports nested filter files as well as per-directory
+      filter files (like .cvsignore, but with full filter-rule parsing).
+      This new option was chosen in order to ensure that all existing
+      include/exclude processing remained 100% compatible with older
+      versions.  Protocol 29 is needed for full filter-rule support, but
+      backward-compatible rules work with earlier protocol versions.
+      (Promoted from the patches dir and enhanced.)
+
+    - Added the --delay-updates option that puts all updated files into
+      a temporary directory (by default ".~tmp~", but settable via the
+      --partial-dir=DIR option) until the end of the transfer.  This
+      makes the updates a little more atomic for a large transfer.
+
+    - If rsync is put into the background, any output from --progress is
+      reduced.
+
+    - Documented the "max verbosity" setting for rsyncd.conf.  (This
+      setting was added a couple releases ago, but left undocumented.)
+
+    - The sender and the generator now double-check the file-list index
+      they are given, and refuse to try to do a file transfer on a
+      non-file index (since that would indicate that something had gone
+      very wrong).
+
+    - Added the --itemize-changes (-i) option, which is a way to output a
+      more detailed list of what files changed in any way and how they
+      changed.  The effect is the same as specifying a --log-format of
+      "%i %n%L" (see the rsyncd.conf manpage).  Works with --dry-run too.
+
+    - Added the --fuzzy option, which attempts to find a basis file for a
+      file that is being created from scratch.  The current algorithm
+      only looks in the destination directory for the created file, but
+      it does attempt to find a match based on size/mod-time (in case the
+      file was renamed with no other changes) as well as based on a fuzzy
+      name-matching algorithm.  This option requires protocol 29 because
+      it needs the new file-sorting order.  (Promoted from patches dir
+      and enhanced.) (Requires protocol 29.)
+
+    - Added the --remove-sent-files option, which lets you move files
+      between systems.
+
+    - The hostname in HOST:PATH or HOST::PATH may now be an IPv6 literal
+      enclosed in '[' and ']' (e.g. "[::1]").  (We already allowed IPv6
+      literals in the rsync://HOST:PORT/PATH format.)
+
+    - When building under windows, the default for --daemon is now to
+      avoid detaching, requiring the new --detach option to force rsync
+      to detach.
+
+    - Improved the option descriptions in the --help text.
+
+  SUPPORT FILES:
+
+    - Added atomic-rsync to the support dir: a perl script that will
+      transfer some files using rsync, and then move the updated files into
+      place all at once at the end of the transfer.  Only works when
+      pulling, and uses --link-dest and a parallel hierarchy of files to
+      effect its update.
+
+    - Added mnt-excl to the support dir: a perl script that takes the
+      /proc/mounts file and translates it into a set of excludes that will
+      exclude all mount points (even mapped mounts to the same disk).  The
+      excludes are made relative to the specified source dir and properly
+      anchored.
+
+    - Added savetransfer.c to the support dir: a C program that can make
+      a copy of all the data that flows over the wire.  This lets you test
+      for data corruption (by saving the data on both the sending side and
+      the receiving side) or provides a way to help debug a protocol error.
+
+    - Added rrsync to the support dir: this is my version of Joe Smith's
+      restricted rsync perl script.  This helps to ensure that only certain
+      rsync commands can be run by an ssh invocation.
+
+  INTERNAL:
 
-    * Some cleanup of the exclude/include structures and its code
-      made things clearer, simpler, and more efficient.
+    - Added better checking of the checksum-header values that come over
+      the socket.
+
+    - Merged a variety of file-deleting functions into a single function so
+      that it is easier to maintain.
+
+    - Improved the type of some variables (particularly blocksize vars) for
+      consistency and proper size.
+
+    - Got rid of the uint64 type (which we didn't need).
+
+    - Use a slightly more compatible set of core #include directives.
+
+    - Defined int32 in a way that ensures that the build dies if we can't
+      find a variable with at least 32 bits.
+
+    - The daemon's "read only" config item now sets an internal read_only
+      variable that makes extra sure that no write/delete calls on the
+      read-only side can succeed.
+
+  PROTOCOL DIFFERENCES FOR VERSION 29:
+
+    - A 16-bit flag-word is transmitted after every file-list index.  This
+      indicates what is changing between the sender and the receiver.  The
+      generator now transmits an index and a flag-word to indicate when
+      dirs and symlinks have changed (instead of producing a message),
+      which makes the outputting of the information more consistent and
+      less prone to screen corruption (because either the receiver or the
+      sender is now outputting all the file-change info).
+
+    - If a file is being hard-linked, the appropriate bit is enabled in
+      the flag-word and the name of the file that was linked immediately
+      follows in vstring format (see below).
+
+    - If a file is being transferred with an alternate-basis file, the
+      appropriate bit is enabled in the flag-word and a single-byte
+      follows, indicating what type of basis file was chosen.  If that
+      indicates that a fuzzy-match was selected, the name of the match
+      immediately follows in vstring format.  A vstring is a variable
+      length string that has its size written prior to the string, and
+      no terminating null.  If the string is from 1-127 bytes, the length
+      is a single byte.  If it is from 128-32767 bytes, the length is
+      written as ((len >> 8) | 0x80) followed by (len % 0x100).
+
+    - The sending of exclude names is done using filter-rule syntax.  This
+      means that all names have a prefixed rule indicator, even excludes
+      (which used to be sent as a bare pattern, when possible).  The -C
+      option will include the per-dir .cvsignore merge file in the list of
+      filter rules so it is positioned correctly (unlike in some older
+      transfer scenarios).
+
+    - Rsync sorts the filename list in a different way: it sorts the subdir
+      names after the non-subdir names for each dir's contents, and it
+      always puts a dir's contents immediately after the dir's name in the
+      list.  (Previously an item named "foo.txt" would sort in between
+      directory "foo/" and "foo/bar".)
+
+    - When talking to a protocol 29 rsync daemon, a list-only request
+      is able to note this before the options are sent over the wire and
+      the new --list-only option is included in the options.
+
+    - When the --stats bytes are sent over the wire (or stored in a batch),
+      they now include two elapsed-time values: one for how long it took to
+      build the file-list, and one for how long it took to send it over the
+      wire (each expressed in thousandths of a second).
+
+    - When --delete-excluded is specified with some filter excludes, a
+      client sender will now initiate a send of the filter rules to the
+      receiver (older protocols used to omit the sending of excludes in
+      this situation since there were no receiver-specific rules that
+      survived --delete-excluded back then).  Note that, as with all the
+      filter-list sending, only items that are significant to the other
+      side will actually be sent over the wire, so the filter-rule list
+      is often empty in this scenario.
+
+    - A protocol-29 batch file includes a bit for the setting of the --dirs
+      option.  Also, the shell script created by --write-batch will use the
+      --filter option instead of --exclude-from to capture any filter rules.
+
+    - An index equal to the file-list count is sent as a keep-alive packet
+      from the generator to the sender, which then forwards it on to the
+      receiver.  This normally invalid index is only a valid keep-alive
+      packet if the 16-bit flag-word that follows it contains a single bit
+      (ITEM_IS_NEW, which is normally an illegal flag to appear alone).
+
+  BUILD CHANGES:
+
+    - Handle an operating system that use mkdev() in place of makedev().
+
+    - Improved configure to better handle cross-compiling.