Compare commits

...

45 Commits

Author SHA1 Message Date
Wayne Davison
d8195637d4 Additional testing confirmed the limited scope of the sources affected
by the -R sorting bug.
2004-04-30 19:14:52 +00:00
Wayne Davison
c8d771a0fb Preparing for release of 2.6.2 2004-04-30 18:03:33 +00:00
Wayne Davison
9130776c4e Mention the last few tweaks that made it into 2.6.2. 2004-04-30 17:53:51 +00:00
Wayne Davison
9eac94a4dd Improved the program that checks for broken large-file locking. 2004-04-30 17:38:22 +00:00
Wayne Davison
6e06d2f31a Don't rely on the local shell's wildcard expansion to make the test
work right -- it might not be quite as compatible as we need.
2004-04-30 17:24:49 +00:00
Wayne Davison
6a6d21136a Only refer to AI_NUMERICHOST if it is defined. 2004-04-30 16:10:45 +00:00
Wayne Davison
f28bd83346 Fixed a few typos. 2004-04-30 15:46:41 +00:00
Wayne Davison
96fb478eae Mention the desire to improve how a daemon returns errors. 2004-04-29 21:12:46 +00:00
Wayne Davison
8752b3fcd8 Describe the changes for 2.6.2. 2004-04-29 21:09:33 +00:00
Wayne Davison
55ffed7e42 Preparing for release of 2.6.2pre1 2004-04-29 20:36:22 +00:00
Wayne Davison
e00df64bae Got rid of unused check for sys/sysctl.h. 2004-04-29 19:40:17 +00:00
Wayne Davison
080ddf58ae Fixed a sorting problem when an entry has an empty (but not NULL)
dirname (which I had thought impossible, but it appears to occur
with --relative in some instances).
2004-04-29 19:37:15 +00:00
Wayne Davison
4ce48a5bfd Restore old behavior of logging most daemon errors instead of sending
them to the user.  This should eventually be improved to duplicate
some of these messages to the user to keep them informed about what
went wrong.
2004-04-29 19:34:31 +00:00
Wayne Davison
20bf7f847f Undefined __attribute__ in some circumstances. 2004-04-28 17:35:08 +00:00
Wayne Davison
b66d00853b Fixed the use of an uninitialized variable in map_uid() and map_gid(). 2004-04-28 17:31:31 +00:00
Wayne Davison
8b602edda4 In copy_file(), check len < 0 before checking the close() return values. 2004-04-27 19:59:37 +00:00
Wayne Davison
9f27cd8ca6 Check the return code from close() and output an error if it
fails.
2004-04-27 19:51:33 +00:00
Wayne Davison
b084f9e092 Got rid of a debug-output statement. 2004-04-27 16:41:33 +00:00
Wayne Davison
4220e1098e Preparing for release of 2.6.1 2004-04-27 03:55:37 +00:00
Wayne Davison
c30468169a - Tweaked the bullet char so that vim can auto-format the items more
easily (and then used vim to re-flow the items).
- Added a mention about the daemon security fix.
- Added the 2.6.1 release date.
2004-04-27 03:53:28 +00:00
Wayne Davison
c0d9e8c76b - Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY.
- Got rid of HP-UX kludge (since it didn't help).
2004-04-27 01:36:16 +00:00
Wayne Davison
90a973fe8a Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY. 2004-04-27 01:36:10 +00:00
Wayne Davison
7f0feb4dd6 - Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY.
- Don't parse comment lines in add_exclude_file() when XFLG_WORD_SPLIT
  is set.
2004-04-27 01:36:06 +00:00
Wayne Davison
33a5432ea6 Got rid of HP-UX kludge (since it didn't help). 2004-04-27 01:36:00 +00:00
Wayne Davison
968ff560d2 Made a comment clearer. 2004-04-27 01:00:58 +00:00
Wayne Davison
cd59be1d5e One more try at getting the HP-UX system in the build farm to compile
popt.
2004-04-25 20:36:41 +00:00
Wayne Davison
8b2869c0d2 Don't use __attribute__((__unused__)) on HP-UX w/o gcc. 2004-04-25 16:10:09 +00:00
Wayne Davison
82a51ea53d Improved the debug string for the local_exclude_list. 2004-04-24 08:00:39 +00:00
Wayne Davison
20af605eba Improved the EXCLUDE PATTERNS section some more. 2004-04-24 06:16:04 +00:00
Wayne Davison
a6536635e3 Fixed a comment. 2004-04-23 08:09:13 +00:00
Wayne Davison
adddd075eb Mention how --update behaves when the type of the file differs on
the source and destination systems.
2004-04-23 05:14:39 +00:00
Wayne Davison
a0c823b22b Recently added caveat is no longer true. 2004-04-23 01:33:35 +00:00
Wayne Davison
9fdb334e85 Restore the old include behavior where a command-line include could
override a .cvsignore exclude.
2004-04-22 22:17:15 +00:00
Wayne Davison
f89e890b87 Got rid of a wrong paragraph. 2004-04-22 21:35:45 +00:00
Wayne Davison
1c666c3fcb Got rid of a bunch of cruft. 2004-04-22 21:17:58 +00:00
Wayne Davison
2a383be0f1 Updated the default list of cvs-excluded files and added some extra
info on how the option interacts with other include/exclude rules.
2004-04-22 18:17:30 +00:00
Wayne Davison
ac1d2d3384 Added "debug_type" to the exclude_list_struct. 2004-04-22 09:58:24 +00:00
Wayne Davison
acfcfa7053 No need to pass a debug string to check_exclude() anymore. 2004-04-22 09:58:21 +00:00
Wayne Davison
8ef81dd452 No need to pass a debug string to check_exclude() anymore. When we
free an exclude list, make sure we don't clear the debug_type string.
2004-04-22 09:58:18 +00:00
Wayne Davison
67340e9523 Initialize the new debug_type string in each exclude list and output
it in a couple extra debug messages.  When we free an exclude list,
make sure we don't clear the debug_type string.
2004-04-22 09:58:15 +00:00
Wayne Davison
a7ceddae34 Changed check_exclude()'s prototype. 2004-04-22 09:58:11 +00:00
Wayne Davison
24e1569f8b The debug output for add_exclude() now needs to limit the pattern to
print only "pat_len" chars.
2004-04-22 08:41:03 +00:00
Wayne Davison
de31639fff A couple minor text improvements. 2004-04-19 17:52:39 +00:00
Wayne Davison
8b46340924 Mentioned the better handling of option paths when a daemon is not
running with chroot enabled.
2004-04-18 06:29:06 +00:00
Wayne Davison
d008bcb5cd Made the device-changes section agree with the latest code. 2004-04-17 19:58:12 +00:00
18 changed files with 346 additions and 268 deletions

318
NEWS
View File

@@ -1,138 +1,192 @@
NEWS for rsync 2.6.1 (UNRELEASED)
Protocol: 28 (changed)
Changes since 2.6.0:
ENHANCEMENTS:
* Lower memory use and more optimal transfer of data over
the socket (see the INTERNAL section for details).
* The RSYNC_PROXY environment variable can now contain a
"USER:PASS@" prefix before the "HOST:PORT" information.
(Bardur Arantsson)
* 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.
* The configure script now accepts --with-rsyncd-conf=PATH
to override the default value of the /etc/rsyncd.conf file.
* Added a couple extra diffs in the "patches" dir, removed the
ones that got applied, and rebuilt the rest.
NEWS for rsync 2.6.2 (30 Apr 2004)
Protocol: 28 (unchanged)
Changes since 2.6.1:
BUG FIXES:
* 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.
- Fixed a major bug in the sorting of the filenames when --relative
is used for some sources (just sources such as "/" and "/*" were
affected). This fix ensures that we ask for the right file-list
item when requesting changes from the sender.
* 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.
- Rsync now checks the return value of the close() function to
better report disk-full problems on an NFS file system.
* 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.
- Restored the old daemon-server behavior of logging error messages
rather than returning them to the user. (A better long-term fix
will be sought in the future.)
* Fixed a byte-order problem in --batch-mode on big-endian
machines. (Jay Fenlason)
- An obscure uninitialized-variable bug was fixed in the uid/gid
code. (This bug probably had no ill effects.)
* Fixed configure bug when running "./configure --disable-ipv6".
- Got rid of the configure check for sys/sysctl.h (it wasn't used
and was causing a problem on some systems). Also improved the
broken-largefile-locking test to try to avoid failure due to an
NFS build-dir.
* Fixed "make test" bug when build dir is not the source dir.
- Fixed a compile problem on systems that don't define
AI_NUMERICHOST.
* 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).
* 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 without telling us
about the backup-dir.
* 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 a compile problem in the popt source for compilers that
don't support __attribute__.
INTERNAL:
* Most of the I/O is now buffered, which results in a pretty
large speedup when running under MS Windows. (Craig Barratt)
- Improved the testsuite's "merge" test to work on OSF1.
* Optimizations to the name-handling/comparing code have made
some significant reductions in user-CPU time for large file
sets.
- Two new diffs were added to the patches dir.
* Some variable-type cleanup that makes the code more consistent.
NEWS for rsync 2.6.1 (26 Apr 2004)
Protocol: 28 (changed)
Changes since 2.6.0:
* Reduced memory requirements of hard link preservation.
SECURITY FIXES:
- Paths sent to an rsync daemon are more thoroughly sanitized when
chroot is not used. If you're running a non-read-only rsync
daemon with chroot disabled, *please upgrade*, ESPECIALLY if the
user privs you run rsync under is anything above "nobody".
ENHANCEMENTS:
- Lower memory use, more optimal transfer of data over the socket,
and lower CPU usage (see the INTERNAL section for details).
- The RSYNC_PROXY environment variable can now contain a
"USER:PASS@" prefix before the "HOST:PORT" information.
(Bardur Arantsson)
- 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.
- The configure script now accepts --with-rsyncd-conf=PATH to
override the default value of the /etc/rsyncd.conf file.
- Added a couple extra diffs in the "patches" dir, removed the ones
that got applied, and rebuilt the rest.
- Documentation changes now attempt to describe some often mis-
understood features more clearly.
BUG FIXES:
- 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
per-directory's .cvsignore file once again only affect that one
directory (not all following directories too). The items are also
now properly word-split and parsed without any +/- prefix parsing.
- 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.
INTERNAL:
- Most of the I/O is now buffered, which results in a pretty large
speedup when running under MS Windows. (Craig Barratt)
- Optimizations to the name-handling/comparing code have made some
significant reductions in user-CPU time for large file sets.
- Some cleanup of the variable types make the code more consistent.
- Reduced memory requirements of hard link preservation.
(J.W. Schultz)
* Implemented a new algorithm for hard-link handling that speeds
up the code significantly. (J.W. Schultz and Wayne Davison)
- Implemented a new algorithm for hard-link handling that speeds up
the code significantly. (J.W. Schultz and Wayne Davison)
* The --hard-link option now uses the first existing file in the
- 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.
* 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)
- 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)
* More optimal data transmission for --hard-links (protocol 28).
- More optimal data transmission for --hard-links (protocol 28).
* More optimal data transmission for --checksum (protocol 28).
- More optimal data transmission for --checksum (protocol 28).
* Less memory is used when --checksum is specified.
- Less memory is used when --checksum is specified.
* Less memory is used in the file list (a per-file savings).
- Less memory is used in the file list (a per-file savings).
* The generator is now better about not modifying the file list
- 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,
@@ -141,33 +195,35 @@ Changes since 2.6.0:
are being preserved, the shared memory should remain that way
for the entire transfer.
* 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)
- 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 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).
- 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 (which mainly affected hard-link messages and
verbose --stats output).
* 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.
- Improved the internal uid/gid code to be more portable and a
little more optimized.
* Improved the internal uid/gid code to be more portable and
a little more optimized.
- 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 (with both ends of the
connection are using protocol 28). Note that optimizations in the
binary protocol for sending the device numbers often results in
fewer bytes being used than before, even though more precision is
now available.
* Device numbers are now sent as separate major/minor values
with 32-bit accuracy for each one (protocol 28). Previously
hard-link device data was sent as a single 64-bit number, and
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.
- Some cleanup of the exclude/include structures and its code made
things clearer (internally), simpler, and more efficient.
* Some cleanup of the exclude/include structures and its code
made things clearer, simpler, and more efficient.
- 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. (Note that the
batch code is still considered to be experimental.)

4
TODO
View File

@@ -425,7 +425,9 @@ Improve error messages
our load? (Debian #28416) Probably fixed now, but a test case would
be good.
When running as a daemon, some errors should both be returned to the
user and logged. This will make interacting with a daemon less
cryptic.
-- --

View File

@@ -118,7 +118,9 @@ char *client_name(int fd)
memset(&hint, 0, sizeof hint);
#ifdef AI_NUMERICHOST
hint.ai_flags = AI_NUMERICHOST;
#endif
hint.ai_socktype = SOCK_STREAM;
if ((err = getaddrinfo(addr, NULL, &hint, &answer)) != 0) {

View File

@@ -5,7 +5,7 @@ AC_CONFIG_SRCDIR([byteorder.h])
AC_CONFIG_HEADER(config.h)
AC_PREREQ(2.52)
RSYNC_VERSION=2.6.1pre-2
RSYNC_VERSION=2.6.2
AC_SUBST(RSYNC_VERSION)
AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
@@ -146,21 +146,26 @@ AC_TRY_RUN([
int main(void)
{
struct flock lock;
int status;
int fd = open("conftest.dat", O_CREAT|O_RDWR, 0600);
int status;
char tpl[32] = "/tmp/locktest.XXXXXX";
int fd = mkstemp(tpl);
if (fd < 0) {
strcpy(tpl, "conftest.dat");
fd = open(tpl, O_CREAT|O_RDWR, 0600);
}
lock.l_type = F_WRLCK;
lock.l_whence = SEEK_SET;
lock.l_start = 0;
lock.l_len = 1;
lock.l_pid = 0;
fcntl(fd,F_SETLK,&lock);
if (fork() == 0) {
lock.l_start = 1;
exit(fcntl(fd,F_SETLK,&lock) == 0);
}
wait(&status);
unlink("conftest.dat");
lock.l_start = 1;
_exit(fcntl(fd,F_SETLK,&lock) == 0);
}
wait(&status);
unlink(tpl);
exit(WEXITSTATUS(status));
}
],
@@ -282,7 +287,7 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \
unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \
sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \
sys/un.h glob.h mcheck.h sys/sysctl.h arpa/inet.h arpa/nameser.h \
sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \
netdb.h malloc.h float.h)
AC_HEADER_MAJOR

View File

@@ -33,9 +33,9 @@ extern int recurse;
extern char curr_dir[];
struct exclude_list_struct exclude_list;
struct exclude_list_struct local_exclude_list;
struct exclude_list_struct server_exclude_list;
struct exclude_list_struct exclude_list = { 0, 0, "" };
struct exclude_list_struct local_exclude_list = { 0, 0, "per-dir .cvsignore " };
struct exclude_list_struct server_exclude_list = { 0, 0, "server " };
char *exclude_path_prefix = NULL;
/** Build an exclude structure given a exclude pattern */
@@ -103,15 +103,17 @@ void free_exclude_list(struct exclude_list_struct *listp)
{
struct exclude_struct *ent, *next;
if (verbose > 2)
rprintf(FINFO, "[%s] clearing exclude list\n", who_am_i());
if (verbose > 2) {
rprintf(FINFO, "[%s] clearing %sexclude list\n",
who_am_i(), listp->debug_type);
}
for (ent = listp->head; ent; ent = next) {
next = ent->next;
free_exclude(ent);
}
memset(listp, 0, sizeof listp[0]);
listp->head = listp->tail = NULL;
}
static int check_one_exclude(char *name, struct exclude_struct *ex,
@@ -203,7 +205,7 @@ static void report_exclude_result(char const *name,
* case we add it back in here. */
if (verbose >= 2) {
rprintf(FINFO, "[%s] %scluding %s %s because of %s %s%s\n",
rprintf(FINFO, "[%s] %scluding %s %s because of %spattern %s%s\n",
who_am_i(), ent->include ? "in" : "ex",
name_is_dir ? "directory" : "file", name, type,
ent->pattern, ent->directory ? "/" : "");
@@ -212,18 +214,18 @@ static void report_exclude_result(char const *name,
/*
* Return true if file NAME is defined to be excluded by the specified
* exclude list.
* Return -1 if file "name" is defined to be excluded by the specified
* exclude list, 1 if it is included, and 0 if it was not matched.
*/
int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir,
const char *type)
int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir)
{
struct exclude_struct *ent;
for (ent = listp->head; ent; ent = ent->next) {
if (check_one_exclude(name, ent, name_is_dir)) {
report_exclude_result(name, ent, name_is_dir, type);
return !ent->include;
report_exclude_result(name, ent, name_is_dir,
listp->debug_type);
return ent->include ? 1 : -1;
}
}
@@ -234,8 +236,8 @@ int check_exclude(struct exclude_list_struct *listp, char *name, int name_is_dir
/* Get the next include/exclude arg from the string. The token will not
* be '\0' terminated, so use the returned length to limit the string.
* Also, be sure to add this length to the returned pointer before passing
* it back to ask for the next token. This routine will not split off a
* prefix of "+ " or "- " unless xflags contains XFLG_NO_PREFIXES. The
* it back to ask for the next token. This routine will not parse the +/-
* prefixes or the "!" token when xflags contains XFLG_WORDS_ONLY. The
* *incl_ptr value will be 1 for an include, 0 for an exclude, and -1 for
* the list-clearing "!" token.
*/
@@ -254,7 +256,7 @@ static const char *get_exclude_tok(const char *p, int *len_ptr, int *incl_ptr,
}
/* Is this a '+' or '-' followed by a space (not whitespace)? */
if (!(xflags & XFLG_NO_PREFIXES)
if (!(xflags & XFLG_WORDS_ONLY)
&& (*s == '-' || *s == '+') && s[1] == ' ') {
*incl_ptr = *s == '+';
s += 2;
@@ -270,7 +272,7 @@ static const char *get_exclude_tok(const char *p, int *len_ptr, int *incl_ptr,
} else
len = strlen(s);
if (*p == '!' && len == 1 && !(xflags & XFLG_NO_PREFIXES))
if (*p == '!' && len == 1 && !(xflags & XFLG_WORDS_ONLY))
*incl_ptr = -1;
*len_ptr = len;
@@ -300,8 +302,9 @@ void add_exclude(struct exclude_list_struct *listp, const char *pattern,
make_exclude(listp, cp, pat_len, incl);
if (verbose > 2) {
rprintf(FINFO, "[%s] add_exclude(%s,%s)\n",
who_am_i(), cp,
rprintf(FINFO, "[%s] add_exclude(%.*s, %s%s)\n",
who_am_i(), pat_len, cp,
listp->debug_type,
incl ? "include" : "exclude");
}
}
@@ -352,8 +355,8 @@ void add_exclude_file(struct exclude_list_struct *listp, const char *fname,
*s++ = ch;
}
*s = '\0';
/* Skip lines starting with semicolon or pound. */
if (*line && *line != ';' && *line != '#')
/* Skip an empty token and (when line parsing) comments. */
if (*line && (word_split || (*line != ';' && *line != '#')))
add_exclude(listp, line, xflags);
if (ch == EOF)
break;
@@ -430,14 +433,14 @@ void add_cvs_excludes(void)
char *p;
add_exclude(&exclude_list, default_cvsignore,
XFLG_WORD_SPLIT | XFLG_NO_PREFIXES);
XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
if ((p = getenv("HOME"))
&& pathjoin(fname, sizeof fname, p, ".cvsignore") < sizeof fname) {
add_exclude_file(&exclude_list, fname,
XFLG_WORD_SPLIT | XFLG_NO_PREFIXES);
XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
}
add_exclude(&exclude_list, getenv("CVSIGNORE"),
XFLG_WORD_SPLIT | XFLG_NO_PREFIXES);
XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
}

22
flist.c
View File

@@ -211,6 +211,8 @@ int link_stat(const char *path, STRUCT_STAT * buffer)
*/
static int check_exclude_file(char *fname, int is_dir, int exclude_level)
{
int rc;
#if 0 /* This currently never happens, so avoid a useless compare. */
if (exclude_level == NO_EXCLUDES)
return 0;
@@ -227,17 +229,15 @@ static int check_exclude_file(char *fname, int is_dir, int exclude_level)
}
}
if (server_exclude_list.head
&& check_exclude(&server_exclude_list, fname, is_dir,
"server pattern"))
&& check_exclude(&server_exclude_list, fname, is_dir) < 0)
return 1;
if (exclude_level != ALL_EXCLUDES)
return 0;
if (exclude_list.head
&& check_exclude(&exclude_list, fname, is_dir, "pattern"))
return 1;
&& (rc = check_exclude(&exclude_list, fname, is_dir)) != 0)
return rc < 0;
if (local_exclude_list.head
&& check_exclude(&local_exclude_list, fname, is_dir,
"local-cvsignore"))
&& check_exclude(&local_exclude_list, fname, is_dir) < 0)
return 1;
return 0;
}
@@ -947,7 +947,7 @@ void send_file_name(int f, struct file_list *flist, char *fname,
if (recursive && S_ISDIR(file->mode)
&& !(file->flags & FLAG_MOUNT_POINT)) {
struct exclude_list_struct last_list = local_exclude_list;
memset(&local_exclude_list, 0, sizeof local_exclude_list);
local_exclude_list.head = local_exclude_list.tail = NULL;
send_directory(f, flist, f_name_to(file, fbuf));
free_exclude_list(&local_exclude_list);
local_exclude_list = last_list;
@@ -989,7 +989,7 @@ static void send_directory(int f, struct file_list *flist, char *dir)
if (strlcpy(p, ".cvsignore", MAXPATHLEN - offset)
< MAXPATHLEN - offset) {
add_exclude_file(&local_exclude_list, fname,
XFLG_WORD_SPLIT | XFLG_NO_PREFIXES);
XFLG_WORD_SPLIT | XFLG_WORDS_ONLY);
} else {
io_error |= IOERR_GENERAL;
rprintf(FINFO,
@@ -1517,11 +1517,17 @@ int f_name_cmp(struct file_struct *f1, struct file_struct *f2)
if (!(c1 = (uchar*)f1->dirname)) {
state1 = fnc_BASE;
c1 = (uchar*)f1->basename;
} else if (!*c1) {
state1 = fnc_SLASH;
c1 = (uchar*)"/";
} else
state1 = fnc_DIR;
if (!(c2 = (uchar*)f2->dirname)) {
state2 = fnc_BASE;
c2 = (uchar*)f2->basename;
} else if (!*c2) {
state2 = fnc_SLASH;
c2 = (uchar*)"/";
} else
state2 = fnc_DIR;

View File

@@ -1,48 +1 @@
Makefile
a
b
config.cache
config.h
config.log
config.status
dist.tar.gz
dummy
rsync
rsync-0.1
rsync-0.1
rsync-0.1
rsync-0.1.tar.gz
rsync-0.2
rsync-0.2
rsync-0.2.tar.gz
rsync-0.3
rsync-0.3
rsync-0.3.tar.gz
rsync-0.4
rsync-0.4
rsync-0.4.tar.gz
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5.tar.gz
rsync-0.6
rsync-0.7
rsync-0.7
rsync-0.8
rsync-0.8
rsync-0.8
rsync-0.8
rsync-ERSION
rsync.aux
rsync.dvi
rsync.log
tech_report.aux
tech_report.dvi
tech_report.log
tech_report.ps
test

3
log.c
View File

@@ -182,7 +182,8 @@ void rwrite(enum logcode code, char *buf, int len)
send_msg((enum msgcode)code, buf, len);
return;
}
if (io_multiplex_write((enum msgcode)code, buf, len))
if (!am_daemon
&& io_multiplex_write((enum msgcode)code, buf, len))
return;
}

View File

@@ -1,6 +1,6 @@
Summary: Program for efficient remote updates of files.
Name: rsync
Version: 2.6.1pre-2
Version: 2.6.2
Release: 1
Copyright: GPL
Group: Applications/Networking

View File

@@ -19,6 +19,14 @@
#include <unistd.h>
#endif
#if !defined(__GNUC__) || defined(APPLE)
/* Apparently the OS X port of gcc gags on __attribute__.
*
* <http://www.opensource.apple.com/bugs/X/gcc/2512150.html> */
#define __attribute__(x)
#endif
#ifdef __NeXT
/* access macros are not declared in non posix mode in unistd.h -
don't try to use posix on NeXTstep 3.3 ! */

View File

@@ -458,7 +458,11 @@ int recv_files(int f_in,struct file_list *flist,char *local_name)
if (fd1 != -1) {
close(fd1);
}
close(fd2);
if (close(fd2) < 0) {
rprintf(FERROR, "close failed on %s: %s\n",
full_fname(fnametmp), strerror(errno));
exit_cleanup(RERR_FILEIO);
}
if (verbose > 2)
rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname);

View File

@@ -106,7 +106,7 @@
#define XFLG_FATAL_ERRORS (1<<0)
#define XFLG_DEF_INCLUDE (1<<1)
#define XFLG_NO_PREFIXES (1<<2)
#define XFLG_WORDS_ONLY (1<<2)
#define XFLG_WORD_SPLIT (1<<3)
#define FULL_FLUSH 1
@@ -502,6 +502,7 @@ struct exclude_struct {
struct exclude_list_struct {
struct exclude_struct *head;
struct exclude_struct *tail;
char *debug_type;
};
struct stats {
@@ -760,10 +761,6 @@ int inet_pton(int af, const char *src, void *dst);
const char *get_panic_action(void);
#endif
#if !(defined(__hpux) || defined(_hpux) || defined (hpux))
#define UNUSED(x) x __attribute__((__unused__))
#else
#define UNUSED(x) x
#endif
extern const char *io_write_phase, *io_read_phase;

View File

@@ -1,5 +1,5 @@
mailto(rsync-bugs@samba.org)
manpage(rsync)(1)(17 Apr 2004)()()
manpage(rsync)(1)(30 Apr 2004)()()
manpagename(rsync)(faster, flexible replacement for rcp)
manpagesynopsis()
@@ -469,6 +469,13 @@ dit(bf(-u, --update)) This forces rsync to skip any files for which the
destination file already exists and has a date later than the source
file.
In the currently implementation, a difference of file format is always
considered to be important enough for an update, no matter what date
is on the objects. In other words, if the source has a directory or a
symlink where the destination has a file, the transfer would occur
regardless of the timestamps. This might change in the future (feel
free to comment on this on the mailing list if you have an opinion).
dit(bf(-l, --links)) When symlinks are encountered, recreate the
symlink on the destination.
@@ -636,16 +643,17 @@ a file should be ignored.
The exclude list is initialized to:
quote(RCS/ SCCS/ CVS/ .svn/ CVS.adm RCSLOG cvslog.* tags TAGS .make.state
.nse_depinfo *~ #* .#* ,* *.old *.bak *.BAK *.orig *.rej .del-*
*.a *.o *.obj *.so *.Z *.elc *.ln core)
quote(RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state
.nse_depinfo *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej
.del-* *.a *.olb *.o *.obj *.so *.exe *.Z *.elc *.ln core .svn/)
then files listed in a $HOME/.cvsignore are added to the list and any
files listed in the CVSIGNORE environment variable (space delimited).
files listed in the CVSIGNORE environment variable (all cvsignore names
are delimited by whitespace).
Finally, any file is ignored if it is in the same directory as a
.cvsignore file and matches one of the patterns listed therein. See
the bf(cvs(1)) manual for more information.
.cvsignore file and matches one of the patterns listed therein.
See the bf(cvs(1)) manual for more information.
dit(bf(--exclude=PATTERN)) This option allows you to selectively exclude
certain files from the list of files to be transferred. This is most
@@ -911,7 +919,7 @@ is where the tree starts to be duplicated in the destination directory.
This root governs where patterns that start with a / match (see below).
Because the matching is relative to the transfer-root, changing the
trailing slash on the source path or changing your use of the --relative
trailing slash on a source path or changing your use of the --relative
option affects the path you need to use in your matching (in addition to
changing how much of the file tree is duplicated on the destination
system). The following examples demonstrate this.
@@ -954,6 +962,11 @@ Note that, when using the --recursive (-r) option (which is implied by -a),
every subcomponent of
every path is visited from the top down, so include/exclude patterns get
applied recursively to each subcomponent.
The exclude patterns actually short-circuit the directory traversal stage
when rsync finds the files to send. If a pattern excludes a particular
parent directory, it can render a deeper include pattern ineffectual
because rsync did not descend through that excluded section of the
hierarchy.
Note also that the --include and --exclude options take one pattern
each. To add multiple patterns use the --include-from and
@@ -1005,16 +1018,36 @@ itemize(
The +/- rules are most useful in a list that was read from a file, allowing
you to have a single exclude list that contains both include and exclude
options.
options in the proper order.
If you end an exclude list with --exclude '*', note that since the
algorithm is applied recursively that unless you explicitly include
parent directories of files you want to include then the algorithm
will stop at the parent directories and never see the files below
them. To include all directories, use --include '*/' before the
--exclude '*'.
Remember that the matching occurs at every step in the traversal of the
directory hierarchy, so you must be sure that all the parent directories of
the files you want to include are not excluded. This is particularly
important when using a trailing '*' rule. For instance, this won't work:
Here are some exclude/include examples:
verb(
+ /some/path/this-file-will-not-be-found
+ /file-is-included
- *
)
This fails because the parent directory "some" is excluded by the '*' rule,
so rsync never visits any of the files in the "some" or "some/path"
directories. One solution is to ask for all directories in the hierarchy
to be included by using a single rule: --include='*/' (put it somewhere
before the --exclude='*' rule). Another solution is to add specific
include rules for all the parent dirs that need to be visited. For
instance, this set of rules works fine:
verb(
+ /some/
+ /some/path/
+ /some/path/this-file-is-found
+ /file-also-included
- *
)
Here are some examples of exclude/include matching:
itemize(
it() --exclude "*.o" would exclude all filenames matching *.o
@@ -1034,7 +1067,7 @@ itemize(
manpagesection(BATCH MODE)
bf(Note:) Batch mode should be considered experimental in this version
of rsync. The interface or behaviour may change before it stabilizes.
of rsync. The interface or behavior may change before it stabilizes.
Batch mode can be used to apply the same set of updates to many
identical systems. Suppose one has a tree which is replicated on a
@@ -1116,7 +1149,7 @@ reports.
manpagesection(SYMBOLIC LINKS)
Three basic behaviours are possible when rsync encounters a symbolic
Three basic behaviors are possible when rsync encounters a symbolic
link in the source directory.
By default, symbolic links are not transferred at all. A message
@@ -1177,7 +1210,7 @@ dit(bf(2)) Protocol incompatibility
dit(bf(3)) Errors selecting input/output files, dirs
dit(bf(4)) Requested action not supported: an attempt
was made to manipulate 64-bit files on a platform that cannot support
them; or an option was specifed that is supported by the client and
them; or an option was specified that is supported by the client and
not by the server.
dit(bf(5)) Error starting client-server protocol
dit(bf(10)) Error in socket I/O
@@ -1237,7 +1270,7 @@ manpagebugs()
times are transferred as unix time_t values
When transferring to FAT filesystems rsync may resync
When transferring to FAT filesystems rsync may re-sync
unmodified files.
See the comments on the --modify-window option.

View File

@@ -1,5 +1,5 @@
mailto(rsync-bugs@samba.org)
manpage(rsyncd.conf)(5)(17 Apr 2004)()()
manpage(rsyncd.conf)(5)(30 Apr 2004)()()
manpagename(rsyncd.conf)(configuration file for rsync server)
manpagesynopsis()

View File

@@ -46,7 +46,7 @@ struct exclude_list_struct server_exclude_list;
}
int check_exclude(UNUSED(struct exclude_list_struct *listp), UNUSED(char *name),
UNUSED(int name_is_dir), UNUSED(const char *type))
UNUSED(int name_is_dir))
{
/* This function doesn't really get called in this test context, so
* just return 0. */

View File

@@ -43,9 +43,9 @@ cp -p "$from2dir"/sub1/uno "$from3dir"/sub1/dos "$from2dir"/sub1/tres "$chkdir"/
cp -p "$from3dir"/sub2/subby "$chkdir"/sub2
# Get rid of any directory-time differences
touch "$fromdir"? "$chkdir" "$fromdir"?/sub? "$chkdir"/sub?
$RSYNC -av --existing --include='*/' --exclude='*' "$from1dir/" "$from2dir/" "$from3dir/" "$chkdir/"
checkit "$RSYNC -aHvv \"$fromdir\"?/ \"$todir/\"" "$chkdir" "$todir"
checkit "$RSYNC -aHvv \"$from1dir/\" \"$from2dir/\" \"$from3dir/\" \"$todir/\"" "$chkdir" "$todir"
# The script would have aborted on error, so getting here means we've won.
exit 0

View File

@@ -81,7 +81,7 @@ static char *gid_to_name(gid_t gid)
static int map_uid(int id, char *name)
{
uid_t uid;
if (uid != 0 && name_to_uid(name, &uid))
if (id != 0 && name_to_uid(name, &uid))
return uid;
return id;
}
@@ -89,7 +89,7 @@ static int map_uid(int id, char *name)
static int map_gid(int id, char *name)
{
gid_t gid;
if (gid != 0 && name_to_gid(name, &gid))
if (id != 0 && name_to_gid(name, &gid))
return gid;
return id;
}
@@ -161,7 +161,7 @@ static struct idlist *recv_add_uid(int id, char *name)
int id2 = name ? map_uid(id, name) : id;
struct idlist *node;
node = add_to_list(&uidlist, id, name, map_uid(id, name));
node = add_to_list(&uidlist, id, name, id2);
if (verbose > 3) {
rprintf(FINFO, "uid %d(%s) maps to %d\n",

32
util.c
View File

@@ -253,20 +253,20 @@ int copy_file(char *source, char *dest, mode_t mode)
ifd = do_open(source, O_RDONLY, 0);
if (ifd == -1) {
rprintf(FERROR,"open %s: %s\n",
source,strerror(errno));
full_fname(source), strerror(errno));
return -1;
}
if (robust_unlink(dest) && errno != ENOENT) {
rprintf(FERROR,"unlink %s: %s\n",
dest,strerror(errno));
full_fname(dest), strerror(errno));
return -1;
}
ofd = do_open(dest, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode);
if (ofd == -1) {
rprintf(FERROR,"open %s: %s\n",
dest,strerror(errno));
full_fname(dest), strerror(errno));
close(ifd);
return -1;
}
@@ -274,19 +274,29 @@ int copy_file(char *source, char *dest, mode_t mode)
while ((len = safe_read(ifd, buf, sizeof buf)) > 0) {
if (full_write(ofd, buf, len) < 0) {
rprintf(FERROR,"write %s: %s\n",
dest,strerror(errno));
full_fname(dest), strerror(errno));
close(ifd);
close(ofd);
return -1;
}
}
close(ifd);
close(ofd);
if (len < 0) {
rprintf(FERROR,"read %s: %s\n",
source,strerror(errno));
rprintf(FERROR, "read %s: %s\n",
full_fname(source), strerror(errno));
close(ifd);
close(ofd);
return -1;
}
if (close(ifd) < 0) {
rprintf(FINFO, "close failed on %s: %s\n",
full_fname(source), strerror(errno));
}
if (close(ofd) < 0) {
rprintf(FERROR, "close failed on %s: %s\n",
full_fname(dest), strerror(errno));
return -1;
}
@@ -476,8 +486,7 @@ static int exclude_server_path(char *arg)
if (server_exclude_list.head) {
for (s = arg; (s = strchr(s, '/')) != NULL; ) {
*s = '\0';
if (check_exclude(&server_exclude_list, arg, 1,
"server pattern")) {
if (check_exclude(&server_exclude_list, arg, 1) < 0) {
/* We must leave arg truncated! */
return 1;
}
@@ -806,7 +815,6 @@ char *alloc_sanitize_path(const char *path, const char *rootdir)
rlen--;
buf[rlen] = '\0';
}
fprintf(stderr, "p:`%s'\n", buf);
return buf;
}