mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-25 07:15:35 -04:00
Compare commits
36 Commits
v2.6.1pre2
...
v2.6.2pre1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55ffed7e42 | ||
|
|
e00df64bae | ||
|
|
080ddf58ae | ||
|
|
4ce48a5bfd | ||
|
|
20bf7f847f | ||
|
|
b66d00853b | ||
|
|
8b602edda4 | ||
|
|
9f27cd8ca6 | ||
|
|
b084f9e092 | ||
|
|
4220e1098e | ||
|
|
c30468169a | ||
|
|
c0d9e8c76b | ||
|
|
90a973fe8a | ||
|
|
7f0feb4dd6 | ||
|
|
33a5432ea6 | ||
|
|
968ff560d2 | ||
|
|
cd59be1d5e | ||
|
|
8b2869c0d2 | ||
|
|
82a51ea53d | ||
|
|
20af605eba | ||
|
|
a6536635e3 | ||
|
|
adddd075eb | ||
|
|
a0c823b22b | ||
|
|
9fdb334e85 | ||
|
|
f89e890b87 | ||
|
|
1c666c3fcb | ||
|
|
2a383be0f1 | ||
|
|
ac1d2d3384 | ||
|
|
acfcfa7053 | ||
|
|
8ef81dd452 | ||
|
|
67340e9523 | ||
|
|
a7ceddae34 | ||
|
|
24e1569f8b | ||
|
|
de31639fff | ||
|
|
8b46340924 | ||
|
|
d008bcb5cd |
231
NEWS
231
NEWS
@@ -1,138 +1,153 @@
|
||||
NEWS for rsync 2.6.1 (UNRELEASED)
|
||||
NEWS for rsync 2.6.1 (26 Apr 2004)
|
||||
Protocol: 28 (changed)
|
||||
Changes since 2.6.0:
|
||||
|
||||
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 and more optimal transfer of data over
|
||||
the socket (see the INTERNAL section for details).
|
||||
- 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
|
||||
- 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 --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.
|
||||
- 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.
|
||||
- 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.
|
||||
- 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.
|
||||
- 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).
|
||||
- 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.
|
||||
- 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 a byte-order problem in --batch-mode on big-endian machines.
|
||||
(Jay Fenlason)
|
||||
|
||||
* Fixed configure bug when running "./configure --disable-ipv6".
|
||||
- Fixed configure bug when running "./configure --disable-ipv6".
|
||||
|
||||
* Fixed "make test" bug when build dir is not the source dir.
|
||||
- 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 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).
|
||||
- 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 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.
|
||||
- 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.
|
||||
- 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
|
||||
- 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
|
||||
- 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 without telling us
|
||||
about the backup-dir.
|
||||
- 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.
|
||||
- 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 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)
|
||||
- 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.
|
||||
- Optimizations to the name-handling/comparing code have made some
|
||||
significant reductions in user-CPU time for large file sets.
|
||||
|
||||
* Some variable-type cleanup that makes the code more consistent.
|
||||
- Some cleanup of the variable types make the code more consistent.
|
||||
|
||||
* Reduced memory requirements of hard link preservation.
|
||||
- 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 +156,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.)
|
||||
|
||||
@@ -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.2pre1
|
||||
AC_SUBST(RSYNC_VERSION)
|
||||
AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
|
||||
|
||||
@@ -282,7 +282,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
|
||||
|
||||
|
||||
51
exclude.c
51
exclude.c
@@ -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
22
flist.c
@@ -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;
|
||||
|
||||
|
||||
@@ -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
3
log.c
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Summary: Program for efficient remote updates of files.
|
||||
Name: rsync
|
||||
Version: 2.6.1pre-2
|
||||
Version: 2.6.2pre1
|
||||
Release: 1
|
||||
Copyright: GPL
|
||||
Group: Applications/Networking
|
||||
|
||||
@@ -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 ! */
|
||||
|
||||
@@ -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);
|
||||
|
||||
7
rsync.h
7
rsync.h
@@ -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;
|
||||
|
||||
65
rsync.yo
65
rsync.yo
@@ -1,5 +1,5 @@
|
||||
mailto(rsync-bugs@samba.org)
|
||||
manpage(rsync)(1)(17 Apr 2004)()()
|
||||
manpage(rsync)(1)(29 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 --excludde='*' 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mailto(rsync-bugs@samba.org)
|
||||
manpage(rsyncd.conf)(5)(17 Apr 2004)()()
|
||||
manpage(rsyncd.conf)(5)(29 Apr 2004)()()
|
||||
manpagename(rsyncd.conf)(configuration file for rsync server)
|
||||
manpagesynopsis()
|
||||
|
||||
|
||||
2
t_stub.c
2
t_stub.c
@@ -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. */
|
||||
|
||||
@@ -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
32
util.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user