mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-25 15:25:30 -04:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f240c06902 | ||
|
|
a87b3b2ac2 | ||
|
|
ed0992b888 | ||
|
|
d6dead6bb1 | ||
|
|
344fb1276b | ||
|
|
e095b568d0 | ||
|
|
4c3d16be50 |
10
Makefile.in
10
Makefile.in
@@ -30,7 +30,9 @@ OBJS=$(OBJS1) $(OBJS2) $(DAEMON_OBJ) $(LIBOBJ)
|
||||
.c.o:
|
||||
$(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@
|
||||
|
||||
all: rsync rsync.1 rsyncd.conf.5
|
||||
all: rsync
|
||||
|
||||
man: rsync.1 rsyncd.conf.5
|
||||
|
||||
install: all
|
||||
-mkdir -p ${INSTALL_BIN}
|
||||
@@ -44,12 +46,10 @@ rsync: $(OBJS)
|
||||
$(CC) $(CFLAGS) -o rsync $(OBJS) $(LIBS)
|
||||
|
||||
rsync.1: rsync.yo
|
||||
yodl2man rsync.yo
|
||||
mv rsync.man rsync.1
|
||||
yodl2man -o rsync.1 rsync.yo
|
||||
|
||||
rsyncd.conf.5: rsyncd.conf.yo
|
||||
yodl2man rsyncd.conf.yo
|
||||
mv rsyncd.conf.man rsyncd.conf.5
|
||||
yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
|
||||
|
||||
proto:
|
||||
cat *.c | awk -f mkproto.awk > proto.h
|
||||
|
||||
14
README
14
README
@@ -57,6 +57,9 @@ Options:
|
||||
--exclude-from FILE exclude files listed in FILE
|
||||
--suffix SUFFIX override backup suffix
|
||||
--version print version number
|
||||
--daemon run as a rsync daemon
|
||||
--config FILE specify alternate rsyncd.conf file
|
||||
--port PORT specify alternate rsyncd port number
|
||||
|
||||
|
||||
SETUP
|
||||
@@ -81,6 +84,14 @@ case.
|
||||
Once built put a copy of rsync in your search path on the local and
|
||||
remote systems (or use "make install"). That's it!
|
||||
|
||||
RSYNC SERVERS
|
||||
-------------
|
||||
|
||||
rsync can also talk to "rsync servers" which can provide anonymous or
|
||||
authenticated rsync. See the rsync.conf(5) man page for details on how
|
||||
to setup a rsync server. See the rsync(1) man page for info on how to
|
||||
connect to a rsync server.
|
||||
|
||||
|
||||
MAILING LIST
|
||||
------------
|
||||
@@ -138,7 +149,8 @@ paulus@cs.anu.edu.au
|
||||
AVAILABILITY
|
||||
------------
|
||||
|
||||
The main ftp site for rsync is ftp://samba.anu.edu.au/pub/rsync
|
||||
The main ftp site for rsync is ftp://samba.anu.edu.au/pub/rsync
|
||||
This is also available as rsync://samba.anu.edu.au/rsyncftp/
|
||||
|
||||
Mirrors are available at:
|
||||
|
||||
|
||||
10
flist.c
10
flist.c
@@ -573,6 +573,10 @@ struct file_list *send_file_list(int f,int argc,char *argv[])
|
||||
flist->malloced);
|
||||
if (!flist->files) out_of_memory("send_file_list");
|
||||
|
||||
if (f != -1) {
|
||||
io_start_buffering(f);
|
||||
}
|
||||
|
||||
for (i=0;i<argc;i++) {
|
||||
char fname2[MAXPATHLEN];
|
||||
char *fname = fname2;
|
||||
@@ -658,7 +662,6 @@ struct file_list *send_file_list(int f,int argc,char *argv[])
|
||||
|
||||
if (f != -1) {
|
||||
send_file_entry(NULL,f,0);
|
||||
write_flush(f);
|
||||
}
|
||||
|
||||
if (verbose && recurse && !am_server && f != -1)
|
||||
@@ -677,6 +680,11 @@ struct file_list *send_file_list(int f,int argc,char *argv[])
|
||||
write_int(f, io_error);
|
||||
}
|
||||
|
||||
if (f != -1) {
|
||||
io_end_buffering(f);
|
||||
write_flush(f);
|
||||
}
|
||||
|
||||
if (verbose > 2)
|
||||
rprintf(FINFO,"send_file_list done\n");
|
||||
|
||||
|
||||
57
io.c
57
io.c
@@ -148,7 +148,8 @@ static int readfd(int fd,char *buffer,int N)
|
||||
tv.tv_sec = io_timeout;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
if (select(fd+1, &fds, NULL, NULL, &tv) != 1) {
|
||||
if (select(fd+1, &fds, NULL, NULL,
|
||||
io_timeout?&tv:NULL) != 1) {
|
||||
check_timeout();
|
||||
}
|
||||
}
|
||||
@@ -300,7 +301,7 @@ int write_file(int f,char *buf,int len)
|
||||
}
|
||||
|
||||
|
||||
static int writefd(int fd,char *buf,int len)
|
||||
static int writefd_unbuffered(int fd,char *buf,int len)
|
||||
{
|
||||
int total = 0;
|
||||
fd_set w_fds, r_fds;
|
||||
@@ -374,6 +375,58 @@ static int writefd(int fd,char *buf,int len)
|
||||
return total;
|
||||
}
|
||||
|
||||
static char *io_buffer;
|
||||
static int io_buffer_count;
|
||||
|
||||
void io_start_buffering(int fd)
|
||||
{
|
||||
io_buffer = (char *)malloc(IO_BUFFER_SIZE);
|
||||
if (!io_buffer) out_of_memory("writefd");
|
||||
io_buffer_count = 0;
|
||||
}
|
||||
|
||||
void io_end_buffering(int fd)
|
||||
{
|
||||
if (io_buffer_count) {
|
||||
if (writefd_unbuffered(fd, io_buffer,
|
||||
io_buffer_count) !=
|
||||
io_buffer_count) {
|
||||
rprintf(FERROR,"write failed\n");
|
||||
exit_cleanup(1);
|
||||
}
|
||||
io_buffer_count = 0;
|
||||
}
|
||||
free(io_buffer);
|
||||
io_buffer = NULL;
|
||||
}
|
||||
|
||||
static int writefd(int fd,char *buf,int len1)
|
||||
{
|
||||
int len = len1;
|
||||
|
||||
if (!io_buffer) return writefd_unbuffered(fd, buf, len);
|
||||
|
||||
while (len) {
|
||||
int n = MIN(len, IO_BUFFER_SIZE-io_buffer_count);
|
||||
if (n > 0) {
|
||||
memcpy(io_buffer+io_buffer_count, buf, n);
|
||||
buf += n;
|
||||
len -= n;
|
||||
io_buffer_count += n;
|
||||
}
|
||||
|
||||
if (io_buffer_count == IO_BUFFER_SIZE) {
|
||||
if (writefd_unbuffered(fd, io_buffer,
|
||||
io_buffer_count) !=
|
||||
io_buffer_count) {
|
||||
return -1;
|
||||
}
|
||||
io_buffer_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return len1;
|
||||
}
|
||||
|
||||
|
||||
void write_int(int f,int32 x)
|
||||
|
||||
1
rsync.h
1
rsync.h
@@ -51,6 +51,7 @@
|
||||
#define WRITE_SIZE (32*1024)
|
||||
#define CHUNK_SIZE (32*1024)
|
||||
#define MAX_MAP_SIZE (4*1024*1024)
|
||||
#define IO_BUFFER_SIZE (4096)
|
||||
|
||||
#define MAX_ARGS 1000
|
||||
|
||||
|
||||
7
rsync.yo
7
rsync.yo
@@ -139,6 +139,11 @@ itemize(
|
||||
list of accessible paths on the server will be shown.
|
||||
)
|
||||
|
||||
Some paths on the remote server may require authentication. If so then
|
||||
you will receive a password prompt when you connect. You can avoid the
|
||||
password prompt by setting the environment variable RSYNC_PASSWORD to
|
||||
the password you want to use. This may be useful when scripting rsync.
|
||||
|
||||
manpagesection(RUNNING AN RSYNC SERVER)
|
||||
|
||||
An rsync server is configured using a config file which by default is
|
||||
@@ -445,7 +450,7 @@ times are transferred as unix time_t values
|
||||
file permissions, devices etc are transferred as native numerical
|
||||
values
|
||||
|
||||
see also the comments on the -delete option
|
||||
see also the comments on the --delete option
|
||||
|
||||
Please report bugs! The rsync bug tracking system is online at
|
||||
url(http://samba.anu.edu.au/rsync/)(http://samba.anu.edu.au/rsync/)
|
||||
|
||||
@@ -227,6 +227,23 @@ The default is no "hosts deny" option, which means all hosts can connect.
|
||||
|
||||
enddit()
|
||||
|
||||
manpagesection(AUTHENTICATION STRENGTH)
|
||||
|
||||
The authentication protocol used in rsync is a 128 bit MD4 based
|
||||
challenge response system. Although I believe that no one has ever
|
||||
demonstrated a brute-force break of this sort of system you should
|
||||
realise that this is not a "military strength" authentication system.
|
||||
It should be good enough for most purposes but if you want really top
|
||||
quality security then I recommend that you run rsync over ssh.
|
||||
|
||||
Also note that the rsync server protocol does not currently provide any
|
||||
encryption of the data that is transferred over the link. Only
|
||||
authentication is provided. Use ssh as the transport if you want
|
||||
encryption.
|
||||
|
||||
Future versions of rsync may support SSL for better authentication and
|
||||
encryption, but that is still being investigated.
|
||||
|
||||
manpagesection(EXAMPLES)
|
||||
|
||||
A simple rsyncd.conf file that allow anonymous rsync to a ftp area at
|
||||
|
||||
Reference in New Issue
Block a user