Compare commits

...

18 Commits

Author SHA1 Message Date
Wayne Davison
618c8a73db Preparing for release of 2.6.3 2004-09-30 16:36:42 +00:00
Wayne Davison
aa0ea373cd Mention the enhancement that was made (quite a while ago) to the
daemon's wildcard-expansion limit (formerly 1000 items, now memory
limited).
2004-09-30 10:46:43 +00:00
Wayne Davison
6c3fda83ba Refined the text of a few of the news items. 2004-09-30 09:58:39 +00:00
Wayne Davison
a3571c6cce - Mention the fix for lost output with 2>&1.
- Prepare the file for the 2.6.3 final release.
2004-09-30 09:37:38 +00:00
Wayne Davison
6fcedb7dbe Mention the (anticipated) 2.6.3 release date. 2004-09-30 09:36:29 +00:00
Wayne Davison
18882701d2 Set our stderr output to blocking I/O to avoid any loss of output. 2004-09-29 17:58:07 +00:00
Wayne Davison
30c041f9ad Changed the errors concerning the secrets file to output with FLOG
instead of FERROR.
2004-09-24 17:04:05 +00:00
Wayne Davison
be7cf82299 - Make sure that match_address() always restores the "tok" string,
even on error.
- Turned the various FERROR messages into (the more proper) FLOG.
2004-09-24 16:50:07 +00:00
Wayne Davison
fde045cd77 Turned the various FERROR messages into (the more proper) FLOG. 2004-09-24 16:39:41 +00:00
Wayne Davison
183150b741 Added some more --inplace info (i.e. it implies --partial and conflicts
with 3 basis-file-affecting options).
2004-09-23 21:15:04 +00:00
Wayne Davison
a2570930e8 Made the refused-option message clearer, like Paul suggested. 2004-09-23 17:39:05 +00:00
Wayne Davison
fdb6716c0f Create a FIFO using mkfifo. 2004-09-23 16:34:43 +00:00
Wayne Davison
a20a88d235 Assume that gettimeofday() takes two arguments when cross-compiling. 2004-09-23 16:00:44 +00:00
Wayne Davison
48d3ff94c9 Only output major/minor info for a character/block device, not for
a FIFO or a socket.
2004-09-23 05:33:48 +00:00
Wayne Davison
a33857da09 Mention that --partial-dir now sets an exclude that helps to avoid
losing the partial data when deleting, and avoid copying any partial
data from the sender.
2004-09-22 04:14:43 +00:00
Wayne Davison
13791b1eeb If the partial-dir value is relative, add a directory-exclude for it
to the end of the user's exclude list.
2004-09-22 04:12:13 +00:00
Wayne Davison
9a5e37fca8 In get_exclude_tok(), if XFLG_DIRECTORY was passed in the xflags,
set MATCHFLG_DIRECTORY in the mflags we return.
2004-09-22 04:11:15 +00:00
Wayne Davison
3e976df0fb Added XFLG_DIRECTORY define. 2004-09-22 04:10:10 +00:00
15 changed files with 110 additions and 73 deletions

41
NEWS
View File

@@ -1,4 +1,4 @@
NEWS for rsync 2.6.3 (UNRELEASED)
NEWS for rsync 2.6.3 (30 Sep 2004)
Protocol: 28 (unchanged)
Changes since 2.6.2:
@@ -26,12 +26,16 @@ Changes since 2.6.2:
with each newline transformed into a question mark (which prevents a
filename from causing an empty line to be output).
- The "backed up ..." message that is output when at least 2 --verbose
options are specified is now the same both with and without the
--backup-dir option.
BUG FIXES:
- Fixed a crash bug that might appear when --delete was used and
multiple source directories were specified.
- Fixed the 32-bit truncation of the file length when generating the
- Fixed a 32-bit truncation of the file length when generating the
checksums.
- The --backup code no longer attempts to create some directories
@@ -73,13 +77,13 @@ Changes since 2.6.2:
option (mentioned below) for a way to specify that behavior.
- Error messages from the daemon server's option-parsing (such as
refused options) now get sent back to the client (the server used
to just exit because the socket wasn't in the right state to send
the message).
refused options) are now successfully transferred back to the client
(the server used to fail to send the message because the socket
wasn't in the right state for the message to get through).
- Most errors that occur during a daemon transfer are now returned to
the user in addition to being logged (some messages are intended to
be daemon-only).
- Most transfer errors that occur during a daemon transfer are now
returned to the user in addition to being logged (some messages are
intended to be daemon-only and are not affected by this).
- Fixed a bug in the daemon authentication code when using one of the
batch-processing options.
@@ -97,8 +101,8 @@ Changes since 2.6.2:
- When using --delete and a --backup-dir that contains files that are
hard-linked to their destination equivalents, rsync now makes sure
that removed files really get removed (works around a really weird
rename() behavior).
that removed files really get removed (avoids a really weird rename()
behavior).
- Avoid a bogus run-time complaint about a lack of 64-bit integers when
the int64 type is defined as an off_t and it actually has 64-bits.
@@ -115,13 +119,13 @@ Changes since 2.6.2:
exist, rsync now produces a correct report of files that would be
sent instead of dying with a chdir() error.
- The "backed up ..." message that is output when at least 2 --verbose
options are specified is now the same both with and without the
--backup-dir option.
- Fixed a bug that could cause a slow-to-connect rsync daemon to die
with an error instead of waiting for the connection to finish.
- Fixed an ssh interaction that could cause output to be lost when the
user chose to combine the output of rsync's stdout and stderr (e.g.
using the "2>&1").
ENHANCEMENTS:
- Added the --partial-dir=DIR option that lets you specify where to
@@ -182,6 +186,10 @@ Changes since 2.6.2:
- Added the ability to parse a literal IPv6 address in an "rsync:" URL
(e.g. rsync://[2001:638:500:101::21]:873/module/dir).
- The daemon's wildcard expanding code can now handle more than 1000
filenames (it's now limited by memory instead of having a hard-wired
limit).
INTERNAL:
- Some cleanup in the exclude code has saved some per-exclude memory
@@ -227,10 +235,13 @@ Changes since 2.6.2:
- The variable $STRIP (that is optionally set by the install-strip
target's rule) was changed to $INSTALL_STRIP because some systems
have $STRIP set in the environment.
have $STRIP already set in the environment.
- Fixed a build problem when SUPPORT_HARD_LINKS isn't defined.
- When cross-compiling, the gettimeofday() function is now assumed to
be a modern version that takes two-args (since we can't test it).
DEVELOPER RELATED:
- The scripts in the testsuite dir were cleaned up a bit and a few

View File

@@ -790,6 +790,7 @@ Changes since 2.4.6:
Partial Protocol History
RELEASE DATE VER. DATE OF COMMIT PROTOCOL
30 Sep 2004 2.6.3 28
30 Apr 2004 2.6.2 28
26 Apr 2004 2.6.1 08 Jan 2004 28
01 Jan 2004 2.6.0 10 Apr 2003 27 (MAX=40)

View File

@@ -88,9 +88,13 @@ static int match_address(char *addr, char *tok)
/* Fail quietly if tok is a hostname (not an address) */
if (strspn(tok, ".0123456789") != len
#ifdef INET6
&& !strchr(tok, ':')
&& strchr(tok, ':') == NULL
#endif
) return 0;
) {
if (p)
*p = '/';
return 0;
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
@@ -99,17 +103,18 @@ static int match_address(char *addr, char *tok)
hints.ai_flags = AI_NUMERICHOST;
#endif
gai = getaddrinfo(addr, NULL, &hints, &resa);
if (gai) return 0;
if (getaddrinfo(addr, NULL, &hints, &resa) != 0) {
if (p)
*p = '/';
return 0;
}
gai = getaddrinfo(tok, NULL, &hints, &rest);
if (p)
*p++ = '/';
if (gai) {
rprintf(FERROR,
"error matching address %s: %s\n",
tok,
gai_strerror(gai));
if (gai != 0) {
rprintf(FLOG, "error matching address %s: %s\n",
tok, gai_strerror(gai));
freeaddrinfo(resa);
return 0;
}
@@ -152,7 +157,7 @@ static int match_address(char *addr, char *tok)
}
#endif
default:
rprintf(FERROR,"unknown family %u\n", rest->ai_family);
rprintf(FLOG, "unknown family %u\n", rest->ai_family);
ret = 0;
goto out;
}
@@ -169,14 +174,14 @@ static int match_address(char *addr, char *tok)
#ifdef HAVE_STRTOL
bits = strtol(p, &ep, 10);
if (!*p || *ep) {
rprintf(FERROR,"malformed mask in %s\n", tok);
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}
#else
for (pp = (unsigned char *)p; *pp; pp++) {
if (!isascii(*pp) || !isdigit(*pp)) {
rprintf(FERROR,"malformed mask in %s\n", tok);
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}
@@ -188,7 +193,7 @@ static int match_address(char *addr, char *tok)
goto out;
}
if (bits < 0 || bits > (addrlen << 3)) {
rprintf(FERROR,"malformed mask in %s\n", tok);
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}

View File

@@ -87,19 +87,19 @@ static int get_secret(int module, char *user, char *secret, int len)
return 0;
if (do_stat(fname, &st) == -1) {
rsyserr(FERROR, errno, "stat(%s)", fname);
rsyserr(FLOG, errno, "stat(%s)", fname);
ok = 0;
} else if (lp_strict_modes(module)) {
if ((st.st_mode & 06) != 0) {
rprintf(FERROR,"secrets file must not be other-accessible (see strict modes option)\n");
rprintf(FLOG, "secrets file must not be other-accessible (see strict modes option)\n");
ok = 0;
} else if (am_root && (st.st_uid != 0)) {
rprintf(FERROR,"secrets file must be owned by root when running as root (see strict modes)\n");
rprintf(FLOG, "secrets file must be owned by root when running as root (see strict modes)\n");
ok = 0;
}
}
if (!ok) {
rprintf(FERROR,"continuing without secrets file\n");
rprintf(FLOG, "continuing without secrets file\n");
close(fd);
return 0;
}

View File

@@ -122,7 +122,7 @@ char *client_name(int fd)
hint.ai_socktype = SOCK_STREAM;
if ((err = getaddrinfo(addr, NULL, &hint, &answer)) != 0) {
rprintf(FERROR, RSYNC_NAME ": malformed address %s: %s\n",
rprintf(FLOG, "malformed address %s: %s\n",
addr, gai_strerror(err));
return name_buf;
}
@@ -145,8 +145,8 @@ char *client_name(int fd)
client_sockaddr(fd, &ss, &ss_len);
}
if (!lookup_name(fd, &ss, ss_len, name_buf, sizeof name_buf,
port_buf, sizeof port_buf))
if (lookup_name(fd, &ss, ss_len, name_buf, sizeof name_buf,
port_buf, sizeof port_buf) == 0)
check_name(fd, &ss, name_buf);
return name_buf;
@@ -168,7 +168,7 @@ void client_sockaddr(int fd,
if (getpeername(fd, (struct sockaddr *) ss, ss_len)) {
/* FIXME: Can we really not continue? */
rsyserr(FERROR, errno, "getpeername on fd%d failed", fd);
rsyserr(FLOG, errno, "getpeername on fd%d failed", fd);
exit_cleanup(RERR_SOCKETIO);
}
@@ -223,9 +223,8 @@ int lookup_name(int fd, const struct sockaddr_storage *ss,
NI_NAMEREQD | NI_NUMERICSERV);
if (name_err != 0) {
strcpy(name_buf, default_name);
rprintf(FERROR, RSYNC_NAME ": name lookup failed for %s: %s\n",
client_addr(fd),
gai_strerror(name_err));
rprintf(FLOG, "name lookup failed for %s: %s\n",
client_addr(fd), gai_strerror(name_err));
return name_err;
}
@@ -246,8 +245,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai,
const char fn[] = "compare_addrinfo_sockaddr";
if (ai->ai_family != ss_family) {
rprintf(FERROR,
"%s: response family %d != %d\n",
rprintf(FLOG, "%s: response family %d != %d\n",
fn, ai->ai_family, ss_family);
return 1;
}
@@ -271,8 +269,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai,
sin2 = (const struct sockaddr_in6 *) ai->ai_addr;
if (ai->ai_addrlen < sizeof (struct sockaddr_in6)) {
rprintf(FERROR,
"%s: too short sockaddr_in6; length=%d\n",
rprintf(FLOG, "%s: too short sockaddr_in6; length=%d\n",
fn, ai->ai_addrlen);
return 1;
}
@@ -318,8 +315,7 @@ int check_name(int fd,
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(name_buf, NULL, &hints, &res0);
if (error) {
rprintf(FERROR,
RSYNC_NAME ": forward name lookup for %s failed: %s\n",
rprintf(FLOG, "forward name lookup for %s failed: %s\n",
name_buf, gai_strerror(error));
strcpy(name_buf, default_name);
return error;
@@ -336,23 +332,17 @@ int check_name(int fd,
if (!res0) {
/* We hit the end of the list without finding an
* address that was the same as ss. */
rprintf(FERROR, RSYNC_NAME
": no known address for \"%s\": "
"spoofed address?\n",
name_buf);
rprintf(FLOG, "no known address for \"%s\": "
"spoofed address?\n", name_buf);
strcpy(name_buf, default_name);
} else if (res == NULL) {
/* We hit the end of the list without finding an
* address that was the same as ss. */
rprintf(FERROR, RSYNC_NAME
": %s is not a known address for \"%s\": "
"spoofed address?\n",
client_addr(fd),
name_buf);
rprintf(FLOG, "%s is not a known address for \"%s\": "
"spoofed address?\n", client_addr(fd), name_buf);
strcpy(name_buf, default_name);
}
freeaddrinfo(res0);
return 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.3pre2
RSYNC_VERSION=2.6.3
AC_SUBST(RSYNC_VERSION)
AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])
@@ -543,7 +543,7 @@ AC_TRY_RUN([
#include <unistd.h>
main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes,rsync_cv_HAVE_GETTIMEOFDAY_TZ=no,rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" != x"no"; then
AC_DEFINE(HAVE_GETTIMEOFDAY_TZ, 1, [ ])
fi

View File

@@ -261,6 +261,8 @@ static const char *get_exclude_tok(const char *p, unsigned int *len_ptr,
s += 2;
} else if (xflags & XFLG_DEF_INCLUDE)
mflags |= MATCHFLG_INCLUDE;
if (xflags & XFLG_DIRECTORY)
mflags |= MATCHFLG_DIRECTORY;
if (xflags & XFLG_WORD_SPLIT) {
const unsigned char *cp = s;

10
main.c
View File

@@ -657,6 +657,16 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
if (protocol_version >= 23 && !read_batch)
io_start_multiplex_in();
/* We set our stderr file handle to blocking because ssh might have
* set it to non-blocking. This can be particularly troublesome if
* stderr is a clone of stdout, because ssh would have set our stdout
* to non-blocking at the same time (which can easily cause us to lose
* output from our print statements). This kluge shouldn't cause ssh
* any problems for how we use it. Note also that we delayed setting
* this until after the above protocol setup so that we know for sure
* that ssh is done twiddling its file descriptors. */
set_blocking(STDERR_FILENO);
if (am_sender) {
keep_dirlinks = 0; /* Must be disabled on the sender. */
io_start_buffering_out();

View File

@@ -623,7 +623,7 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
struct poptOption *op =
&long_options[opt-OPT_REFUSED_BASE];
int n = snprintf(err_buf, sizeof err_buf,
"This server does not support --%s\n",
"The server is configured to refuse --%s\n",
op->longName) - 1;
if (op->shortName) {
snprintf(err_buf+n, sizeof err_buf-n,
@@ -839,6 +839,10 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
if (partial_dir) {
if (!*partial_dir || strcmp(partial_dir, ".") == 0)
partial_dir = NULL;
else if (*partial_dir != '/') {
add_exclude(&exclude_list, partial_dir,
XFLG_DIRECTORY);
}
keep_partial = 1;
}
}

View File

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

View File

@@ -108,6 +108,7 @@
#define XFLG_DEF_INCLUDE (1<<1)
#define XFLG_WORDS_ONLY (1<<2)
#define XFLG_WORD_SPLIT (1<<3)
#define XFLG_DIRECTORY (1<<4)
#define PERMS_REPORT (1<<0)
#define PERMS_SKIP_MTIME (1<<1)

View File

@@ -1,5 +1,5 @@
mailto(rsync-bugs@samba.org)
manpage(rsync)(1)(21 Sep 2004)()()
manpage(rsync)(1)(30 Sep 2004)()()
manpagename(rsync)(faster, flexible replacement for rcp)
manpagesynopsis()
@@ -518,10 +518,17 @@ from the sender.
dit(bf(--inplace)) This causes rsync not to create a new copy of the file
and then move it into place. Instead rsync will overwrite the existing
file, meaning that the rsync algorithm can't extract the full amount of
network reduction it might otherwise.
network reduction it might otherwise (since it does not yet try to sort
data matches -- a future version may improve this).
This option is useful for transfer of large files with block-based change
or appended data, and also on systems that are disk bound not network bound.
This option is useful for transfer of large files with block-based changes
or appended data, and also on systems that are disk bound, not network
bound.
The option implies --partial (since an interrupted transfer does not delete
the file), but conflicts with --partial-dir, --compare-dest, and
--link-dest (a future rsync version will hopefully update the protocol to
remove these restrictions).
WARNING: The file's data will be in an inconsistent state during the
transfer (and possibly afterward if the transfer gets interrupted), so you
@@ -923,11 +930,16 @@ in the destination file's directory (rsync will also try to remove the DIR
if a partial file was found to exist at the start of the transfer and the
DIR was specified as a relative path).
If you are deleting files on the destination and your partial-dir is
inside the destination hierarchy, make sure you specify an exclude to
prevent the partial file from being deleted (it could get deleted at the
end of the transfer when using --delete-after, or at the beginning of the
transfer when using --delete). E.g. "--exclude=.rsync-partial/".
If the partial-dir value is not an absolute path, rsync will also add an
--exclude of this value at the end of all your existing excludes. This
will prevent partial-dir files from being transferred and also prevent the
untimely deletion of partial-dir items on the receiving side. An example:
the above --partial-dir option would add an "--exclude=.rsync-partial/"
rule at the end of any other include/exclude rules. Note that if you are
supplying your own include/exclude rules, you may need to manually insert a
rule for this directory exclusion somewhere higher up in the list so that
it has a high enough priority to be effective (e.g., if your rules specify
a trailing --exclude=* rule, the auto-added rule will be ineffective).
IMPORTANT: the --partial-dir should not be writable by other users or it
is a security risk. E.g. AVOID "/tmp".
@@ -970,9 +982,9 @@ the file, and the addition of a total-transfer summary in parentheses.
These additional numbers tell you how many files have been updated, and
what percent of the total number of files has been scanned.
dit(bf(-P)) The -P option is equivalent to --partial --progress. I
found myself typing that combination quite often so I created an
option to make it easier.
dit(bf(-P)) The -P option is equivalent to --partial --progress. Its
purpose is to make it much easier to specify these two options for a long
transfer that may be interrupted.
dit(bf(--password-file)) This option allows you to provide a password
in a file for accessing a remote rsync server. Note that this option

View File

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

View File

@@ -28,6 +28,7 @@ mknod "$fromdir/char3" c 42 69 || test_skipped "Can't create char device node u
mknod "$fromdir/block" b 42 69 || test_skipped "Can't create block device node unless root"
mknod "$fromdir/block2" b 42 73 || test_skipped "Can't create block device node unless root"
mknod "$fromdir/block3" b 105 73 || test_skipped "Can't create block device node unless root"
mkfifo "$fromdir/fifo" || test_skipped "Can't run mkfifo"
checkit "$RSYNC -aHvv \"$fromdir/\" \"$todir/\"" "$fromdir" "$todir"

2
tls.c
View File

@@ -113,7 +113,7 @@ static void list_file(const char *fname)
/* TODO: Perhaps escape special characters in fname? */
printf("%s ", permbuf);
if (IS_DEVICE(buf.st_mode)) {
if (S_ISCHR(buf.st_mode) || S_ISBLK(buf.st_mode)) {
printf("%5ld,%6ld",
(long)major(buf.st_rdev),
(long)minor(buf.st_rdev));