From 0f78b81511be65d8fe21af1e6ac674f9e80ac29d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 25 Apr 2006 20:23:34 +0000 Subject: [PATCH] - Updated the address for the FSF in the opening comment. - Standardized the format of the opening comment, including adding a brief description of what's in the file for those that lacked it. - Added some missing copyright lines. - Some minor whitespace tweaks (in a few of the files). --- access.c | 41 ++++++++++++------------- authenticate.c | 39 +++++++++++------------ backup.c | 37 +++++++++++----------- batch.c | 27 ++++++++++++---- byteorder.h | 39 +++++++++++------------ checksum.c | 37 ++++++++++++---------- chmod.c | 21 +++++++++++++ cleanup.c | 42 +++++++++++++------------ clientname.c | 48 +++++++++++++---------------- clientserver.c | 19 +++++------- compat.c | 43 ++++++++++++-------------- connection.c | 42 ++++++++++++------------- errcode.h | 42 ++++++++++++------------- exclude.c | 21 ++++++------- fileio.c | 40 ++++++++++++------------ flist.c | 42 ++++++++++++------------- generator.c | 44 +++++++++++++------------- getgroups.c | 24 ++++++--------- hlink.c | 39 ++++++++++++----------- io.c | 30 ++++++++---------- lib/compat.c | 53 ++++++++++++++------------------ lib/mdfour.c | 45 ++++++++++++++------------- lib/mdfour.h | 43 ++++++++++++-------------- lib/permstring.c | 80 +++++++++++++++++++++++++----------------------- loadparm.c | 34 ++++++++++---------- log.c | 47 +++++++++++++--------------- main.c | 44 +++++++++++++------------- match.c | 37 ++++++++++++---------- options.c | 10 +++--- params.c | 13 ++++---- pipe.c | 12 +++++--- progress.c | 12 +++++--- receiver.c | 40 ++++++++++++------------ rsync.c | 40 ++++++++++++------------ rsync.h | 38 +++++++++++------------ runtests.sh | 4 +-- sender.c | 37 ++++++++++++---------- socket.c | 50 +++++++++++++----------------- syscall.c | 49 ++++++++++++++--------------- t_stub.c | 42 ++++++++++++------------- t_unsafe.c | 26 +++++++--------- tls.c | 23 +++++--------- token.c | 43 ++++++++++++-------------- trimslash.c | 20 ++++++------ uidlist.c | 47 ++++++++++++++-------------- util.c | 30 ++++++------------ wildtest.c | 20 ++++++++++-- 47 files changed, 827 insertions(+), 829 deletions(-) diff --git a/access.c b/access.c index dcc0ddba..89f1256e 100644 --- a/access.c +++ b/access.c @@ -1,29 +1,26 @@ -/* - Copyright (C) Andrew Tridgell 1998 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - /* - hosts allow/deny code for rsync - - */ + * Routines to authenticate access to a daemon (hosts allow/deny). + * + * Copyright (C) 1998 Andrew Tridgell + * Copyright (C) 2004, 2005 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" - static int match_hostname(char *host, char *tok) { if (!host || !*host) diff --git a/authenticate.c b/authenticate.c index 7b5ecc2a..dd4af416 100644 --- a/authenticate.c +++ b/authenticate.c @@ -1,23 +1,24 @@ -/* -*- c-file-style: "linux"; -*- - - Copyright (C) 1998-2000 by Andrew Tridgell - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * Support rsync daemon authentication. + * + * Copyright (C) 1998-2000 Andrew Tridgell + * Copyright (C) 2002, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ -/* support rsync authentication */ #include "rsync.h" extern char *password_file; diff --git a/backup.c b/backup.c index cea1c8d2..b8223583 100644 --- a/backup.c +++ b/backup.c @@ -1,22 +1,23 @@ /* - Copyright (C) Andrew Tridgell 1999 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* backup handling code */ + * Backup handling code. + * + * Copyright (C) 1999 Andrew Tridgell + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/batch.c b/batch.c index f8529db4..d405f112 100644 --- a/batch.c +++ b/batch.c @@ -1,9 +1,24 @@ -/* -*- c-file-style: "linux" -*- - - Weiss 1/1999 - Batch utilities for rsync. - -*/ +/* + * Support for the batch-file options. + * + * Copyright (C) 1999 Weiss + * Copyright (C) 2004 Chris Shoemaker + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" #include "zlib/zlib.h" diff --git a/byteorder.h b/byteorder.h index 5e0a171b..b3c01593 100644 --- a/byteorder.h +++ b/byteorder.h @@ -1,25 +1,26 @@ -/* - simple byteorder handling - Copyright (C) Andrew Tridgell 1992-1995 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * Simple byteorder handling. + * + * Copyright (C) 1992-1995 Andrew Tridgell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #undef CAREFUL_ALIGNMENT -/* we know that the x86 can handle misalignment and has the "right" +/* we know that the x86 can handle misalignment and has the "right" byteorder */ #ifdef __i386__ #define CAREFUL_ALIGNMENT 0 diff --git a/checksum.c b/checksum.c index ec7ec13c..a86904b1 100644 --- a/checksum.c +++ b/checksum.c @@ -1,21 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Routines to support checksumming of bytes. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2004, 2005 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/chmod.c b/chmod.c index ace57b9d..acd3b6aa 100644 --- a/chmod.c +++ b/chmod.c @@ -1,3 +1,24 @@ +/* + * Implement the core of the --chmod option. + * + * Copyright (C) 2002 Scott Howard + * Copyright (C) 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "rsync.h" extern mode_t orig_umask; diff --git a/cleanup.c b/cleanup.c index b952cff0..1acc348a 100644 --- a/cleanup.c +++ b/cleanup.c @@ -1,23 +1,25 @@ -/* -*- c-file-style: "linux" -*- - - Copyright (C) 1996-2000 by Andrew Tridgell - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * End-of-run cleanup routines. + * + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/clientname.c b/clientname.c index 6d70827c..cf3441e5 100644 --- a/clientname.c +++ b/clientname.c @@ -1,35 +1,31 @@ -/* -*- c-file-style: "linux" -*- - - rsync -- fast file replication program - - Copyright (C) 1992-2001 by Andrew Tridgell - Copyright (C) 2001, 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * @file clientname.c - * +/* * Functions for looking up the remote name or addr of a socket. * + * Copyright (C) 1992-2001 Andrew Tridgell + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2002, 2003, 2004 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* * This file is now converted to use the new-style getaddrinfo() * interface, which supports IPv6 but is also supported on recent * IPv4-only machines. On systems that don't have that interface, we * emulate it using the KAME implementation. - **/ + */ #include "rsync.h" diff --git a/clientserver.c b/clientserver.c index 8a46f69e..c370e213 100644 --- a/clientserver.c +++ b/clientserver.c @@ -1,7 +1,9 @@ -/* -*- c-file-style: "linux"; -*- +/* + * The socket based protocol for setting up a connection with rsyncd. * - * Copyright (C) 1998-2001 by Andrew Tridgell - * Copyright (C) 2001-2002 by Martin Pool + * Copyright (C) 1998-2001 Andrew Tridgell + * Copyright (C) 2001-2002 Martin Pool + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,16 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file - * - * The socket based protocol for setting up a connection with - * rsyncd. - **/ - #include "rsync.h" extern int verbose; @@ -113,7 +108,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[]) return ret ? ret : client_run(fd, fd, -1, argc, argv); } -int start_inband_exchange(char *user, char *path, int f_in, int f_out, +int start_inband_exchange(char *user, char *path, int f_in, int f_out, int argc) { int i; diff --git a/compat.c b/compat.c index ef34b37c..c8066bda 100644 --- a/compat.c +++ b/compat.c @@ -1,27 +1,24 @@ -/* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * @file compat.c - * +/* * Compatibility routines for older rsync protocol versions. - **/ + * + * Copyright (C) Andrew Tridgell 1996 + * Copyright (C) Paul Mackerras 1996 + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/connection.c b/connection.c index ec726075..dd9e745a 100644 --- a/connection.c +++ b/connection.c @@ -1,24 +1,24 @@ -/* - Copyright (C) Andrew Tridgell 1998 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* support the max connections option */ -#include "rsync.h" +/* + * Support the max connections option. + * + * Copyright (C) 1998 Andrew Tridgell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "rsync.h" /**************************************************************************** simple routine to do connection counting @@ -39,7 +39,7 @@ int claim_connection(char *fname,int max_connections) /* find a free spot */ for (i=0;i - * Copyright (C) 1996 by Paul Mackerras - * Copyright (C) 2002 by Martin Pool + * Copyright (C) 1996-2001 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,14 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* a lot of this stuff was originally derived from GNU tar, although - it has now changed so much that it is hard to tell :) */ - -/* include/exclude cluestick added by Martin Pool */ - #include "rsync.h" extern int verbose; @@ -310,7 +307,7 @@ static char *parse_merge_name(const char *merge_file, unsigned int *len_ptr, strlcpy(fn, merge_file, len_ptr ? *len_ptr + 1 : MAXPATHLEN); clean_fname(fn, 1); } - + fn_len = strlen(fn); if (fn == buf) goto done; @@ -856,7 +853,7 @@ static const char *parse_rule_tok(const char *p, uint32 mflags, int xflags, } -static char default_cvsignore[] = +static char default_cvsignore[] = /* These default ignored items come from the CVS manual. */ "RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS" " .make.state .nse_depinfo *~ #* .#* ,* _$* *$" diff --git a/fileio.c b/fileio.c index bef7603f..138301cb 100644 --- a/fileio.c +++ b/fileio.c @@ -1,25 +1,25 @@ /* - Copyright (C) Andrew Tridgell 1998 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * File IO utilities used in rsync. + * + * Copyright (C) 1998 Andrew Tridgell + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ -/* - File IO utilities used in rsync - */ #include "rsync.h" #ifndef ENODATA diff --git a/flist.c b/flist.c index 56e742c0..b528f3df 100644 --- a/flist.c +++ b/flist.c @@ -1,29 +1,25 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2001, 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** @file flist.c - * Generate and receive file lists + * Generate and receive file lists. * - * @sa http://lists.samba.org/pipermail/rsync/2000-June/002351.html + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Wayne Davison * - **/ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/generator.c b/generator.c index e9e145c8..00726e0e 100644 --- a/generator.c +++ b/generator.c @@ -1,25 +1,25 @@ -/* -*- c-file-style: "linux" -*- - - rsync -- fast file replication program - - Copyright (C) 1996-2000 by Andrew Tridgell - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * Routines that are exclusive to the generator process. + * + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/getgroups.c b/getgroups.c index 6a8fac2e..4c67f3d5 100644 --- a/getgroups.c +++ b/getgroups.c @@ -1,29 +1,25 @@ /* - * Copyright (C) 2002 by Martin Pool - * + * Print out the gids of all groups for the current user. This is like + * `id -G` on Linux, but it's too hard to find a portable equivalent. + * + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003, 2004 Wayne Davison + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file getgroups.c - * - * Print out the gids of all groups for the current user. This is - * like `id -G` on Linux, but it's too hard to find a portable - * equivalent. - **/ - #include "rsync.h" int @@ -63,6 +59,6 @@ main(UNUSED(int argc), UNUSED(char *argv[])) if (!gid_in_list) printf("%lu", (unsigned long)gid); printf("\n"); - + return 0; } diff --git a/hlink.c b/hlink.c index 2babcece..a4433294 100644 --- a/hlink.c +++ b/hlink.c @@ -1,22 +1,25 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Routines to support hard-linking. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/io.c b/io.c index 1513ae91..c91007eb 100644 --- a/io.c +++ b/io.c @@ -1,8 +1,10 @@ -/* -*- c-file-style: "linux" -*- +/* + * Socket and pipe I/O utilities used in rsync. * - * Copyright (C) 1996-2001 by Andrew Tridgell - * Copyright (C) Paul Mackerras 1996 - * Copyright (C) 2001, 2002 by Martin Pool + * Copyright (C) 1996-2001 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,23 +18,15 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file io.c - * - * Socket and pipe I/O utilities used in rsync. - * - * rsync provides its own multiplexing system, which is used to send - * stderr and stdout over a single socket. We need this because - * stdout normally carries the binary data stream, and stderr all our - * error messages. +/* Rsync provides its own multiplexing system, which is used to send + * stderr and stdout over a single socket. * * For historical reasons this is off during the start of the * connection, but it's switched on quite early using - * io_start_multiplex_out() and io_start_multiplex_in(). - **/ + * io_start_multiplex_out() and io_start_multiplex_in(). */ #include "rsync.h" @@ -1001,7 +995,7 @@ void write_sum_head(int f, struct sum_struct *sum) static void sleep_for_bwlimit(int bytes_written) { static struct timeval prior_tv; - static long total_written = 0; + static long total_written = 0; struct timeval tv, start_tv; long elapsed_usec, sleep_usec; @@ -1010,7 +1004,7 @@ static void sleep_for_bwlimit(int bytes_written) if (!bwlimit_writemax) return; - total_written += bytes_written; + total_written += bytes_written; gettimeofday(&start_tv, NULL); if (prior_tv.tv_sec) { diff --git a/lib/compat.c b/lib/compat.c index 5b7a2696..944a23e2 100644 --- a/lib/compat.c +++ b/lib/compat.c @@ -1,34 +1,27 @@ -/* - Copyright (C) Andrew Tridgell 1998 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * @file compat.c +/* + * Reimplementations of standard functions for platforms that don't have them. * - * Reimplementations of standard functions for platforms that don't - * have them. - **/ - - + * Copyright (C) 1998 Andrew Tridgell + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" - #ifndef HAVE_STRDUP char *strdup(char *s) { @@ -86,7 +79,7 @@ /** * Find the first ocurrence in @p s of any character in @p accept. * - * Derived from glibc + * Derived from glibc **/ char *strpbrk(const char *s, const char *accept) { @@ -105,7 +98,7 @@ #ifndef HAVE_STRLCPY /** - * Like strncpy but does not 0 fill the buffer and always null + * Like strncpy but does not 0 fill the buffer and always null * terminates. * * @param bufsize is the size of the destination buffer. @@ -128,7 +121,7 @@ #ifndef HAVE_STRLCAT /** - * Like strncat() but does not 0 fill the buffer and always null + * Like strncat() but does not 0 fill the buffer and always null * terminates. * * @param bufsize length of the buffer, which should be one more than diff --git a/lib/mdfour.c b/lib/mdfour.c index 38123c67..d231a3ed 100644 --- a/lib/mdfour.c +++ b/lib/mdfour.c @@ -1,30 +1,31 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. - a implementation of MD4 designed for use in the SMB authentication protocol - Copyright (C) Andrew Tridgell 1997-1998. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Unix SMB/Netbios implementation. + * Version 1.9. + * An implementation of MD4 designed for use in the SMB authentication protocol. + * + * Copyright (C) 1997-1998 Andrew Tridgell + * Copyright (C) 2005 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" /* NOTE: This code makes no attempt to be fast! - - It assumes that a int is at least 32 bits long -*/ + * + * It assumes that a int is at least 32 bits long. */ static struct mdfour *m; diff --git a/lib/mdfour.h b/lib/mdfour.h index b0f3176f..e24bfb32 100644 --- a/lib/mdfour.h +++ b/lib/mdfour.h @@ -1,23 +1,24 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. - a implementation of MD4 designed for use in the SMB authentication protocol - Copyright (C) Andrew Tridgell 1997-1998. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Unix SMB/Netbios implementation. + * Version 1.9. + * An implementation of MD4 designed for use in the SMB authentication protocol. + * + * Copyright (C) 1997-1998 Andrew Tridgell + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ struct mdfour { uint32 A, B, C, D; @@ -29,7 +30,3 @@ void mdfour_begin(struct mdfour *md); void mdfour_update(struct mdfour *md, unsigned char *in, uint32 n); void mdfour_result(struct mdfour *md, unsigned char *out); void mdfour(unsigned char *out, unsigned char *in, int n); - - - - diff --git a/lib/permstring.c b/lib/permstring.c index 3834b7a1..c1747926 100644 --- a/lib/permstring.c +++ b/lib/permstring.c @@ -1,40 +1,40 @@ -/* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2001 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * A single utility routine. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001 Martin Pool + * Copyright (C) 2003, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" -/** - * Produce a string representation of Unix mode bits like that used by - * ls(1). - * - * @param buf buffer of at least 11 characters - **/ +/* Produce a string representation of Unix mode bits like that used by ls(1). + * The "buf" buffer must be at least 11 characters. */ void permstring(char *perms, mode_t mode) { static const char *perm_map = "rwxrwxrwx"; int i; strcpy(perms, "----------"); - - for (i=0;i<9;i++) { - if (mode & (1< + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* some fixes + * + * Copyright (C) 2001, 2002 Martin Pool + */ /* * Load parameters. diff --git a/log.c b/log.c index 135a57a1..db212300 100644 --- a/log.c +++ b/log.c @@ -1,30 +1,25 @@ -/* -*- c-file-style: "linux"; -*- - - Copyright (C) 1998-2001 by Andrew Tridgell - Copyright (C) 2000-2001 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - /* - Logging and utility functions. - tridge, May 1998 + * Logging and utility functions. + * + * Copyright (C) 1998-2001 Andrew Tridgell + * Copyright (C) 2000-2001 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ - Mapping to human-readable messages added by Martin Pool - , Oct 2000. - */ #include "rsync.h" #if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H #include @@ -769,7 +764,7 @@ void log_exit(int code, const char *file, int line) /* VANISHED is not an error, only a warning */ if (code == RERR_VANISHED) { - rprintf(FINFO, "rsync warning: %s (code %d) at %s(%d) [%s=%s]\n", + rprintf(FINFO, "rsync warning: %s (code %d) at %s(%d) [%s=%s]\n", name, code, file, line, who_am_i(), RSYNC_VERSION); } else { rprintf(FERROR, "rsync error: %s (code %d) at %s(%d) [%s=%s]\n", diff --git a/main.c b/main.c index 3acdfd31..1237447d 100644 --- a/main.c +++ b/main.c @@ -1,23 +1,25 @@ -/* -*- c-file-style: "linux" -*- - - Copyright (C) 1996-2001 by Andrew Tridgell - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2001, 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * The startup routines, including main(), for rsync. + * + * Copyright (C) 1996-2001 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" #if defined CONFIG_LOCALE && defined HAVE_LOCALE_H @@ -189,7 +191,7 @@ static void handle_stats(int f) /* this is the client */ if (f < 0 && !am_sender) /* e.g. when we got an empty file list. */ - ; + ; else if (!am_sender) { /* Read the first two in opposite order because the meaning of * read/write swaps when switching from sender to receiver. */ diff --git a/match.c b/match.c index 1f36a585..81c3d9e2 100644 --- a/match.c +++ b/match.c @@ -1,21 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Block matching used by the file-transfer code. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/options.c b/options.c index 6f26bea8..5f4c6338 100644 --- a/options.c +++ b/options.c @@ -1,7 +1,9 @@ -/* -*- c-file-style: "linux" -*- +/* + * Command-line (and received via daemon-socket) option parsing. * - * Copyright (C) 1998-2001 by Andrew Tridgell - * Copyright (C) 2000, 2001, 2002 by Martin Pool + * Copyright (C) 1998-2001 Andrew Tridgell + * Copyright (C) 2000, 2001, 2002 Martin Pool + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "rsync.h" diff --git a/params.c b/params.c index e70685b1..7064e156 100644 --- a/params.c +++ b/params.c @@ -1,7 +1,7 @@ -/* - This modules is based on the params.c module from Samba, written by Karl Auer - and much modifed by Christopher Hertel. +/* This modules is based on the params.c module from Samba, written by Karl Auer + and much modifed by Christopher Hertel. */ +/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -14,9 +14,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * -------------------------------------------------------------------------- ** + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* -------------------------------------------------------------------------- ** * * Module name: params * diff --git a/pipe.c b/pipe.c index 84706085..0614021f 100644 --- a/pipe.c +++ b/pipe.c @@ -1,8 +1,10 @@ -/* -*- c-file-style: "linux" -*- +/* + * Routines used to setup various kinds of inter-process pipes. * - * Copyright (C) 1996-2000 by Andrew Tridgell - * Copyright (C) Paul Mackerras 1996 - * Copyright (C) 2001, 2002 by Martin Pool + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "rsync.h" diff --git a/progress.c b/progress.c index db30a84a..5a08d16b 100644 --- a/progress.c +++ b/progress.c @@ -1,8 +1,10 @@ -/* -*- c-file-style: "linux" -*- +/* + * Routines to output progress information during a file transfer. * - * Copyright (C) 1996-2000 by Andrew Tridgell - * Copyright (C) Paul Mackerras 1996 - * Copyright (C) 2001, 2002 by Martin Pool + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "rsync.h" diff --git a/receiver.c b/receiver.c index 143e27b5..663b1c07 100644 --- a/receiver.c +++ b/receiver.c @@ -1,22 +1,24 @@ -/* -*- c-file-style: "linux" -*- - - Copyright (C) 1996-2000 by Andrew Tridgell - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ +/* + * Routines only used by the receiving process. + * + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/rsync.c b/rsync.c index 69c98217..47268f4d 100644 --- a/rsync.c +++ b/rsync.c @@ -1,24 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* this file contains code used by more than one part of the rsync - process */ + * Routines common to more than one of the rsync processes. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" #if defined HAVE_ICONV_OPEN && defined HAVE_ICONV_H diff --git a/rsync.h b/rsync.h index e21410b0..93886473 100644 --- a/rsync.h +++ b/rsync.h @@ -1,23 +1,23 @@ /* - Copyright (C) by Andrew Tridgell 1996, 2000 - Copyright (C) Paul Mackerras 1996 - Copyright (C) 2001, 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - + * Copyright (C) 1996, 2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #define False 0 #define True 1 diff --git a/runtests.sh b/runtests.sh index 0056de92..bb8d98cd 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,6 +1,7 @@ #! /bin/sh # Copyright (C) 2001, 2002 by Martin Pool +# Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version @@ -13,8 +14,7 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # rsync top-level test script -- this invokes all the other more # detailed tests in order. This script can either be called by `make diff --git a/sender.c b/sender.c index 76546f11..04993042 100644 --- a/sender.c +++ b/sender.c @@ -1,21 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Routines only used by the sending process. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" diff --git a/socket.c b/socket.c index c2f534eb..efbc69d0 100644 --- a/socket.c +++ b/socket.c @@ -1,35 +1,29 @@ -/* -*- c-file-style: "linux" -*- - - rsync -- fast file replication program - - Copyright (C) 1992-2001 by Andrew Tridgell - Copyright (C) 2001, 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * @file socket.c - * +/* * Socket functions used in rsync. * - * This file is now converted to use the new-style getaddrinfo() + * Copyright (C) 1992-2001 Andrew Tridgell + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* This file is now converted to use the new-style getaddrinfo() * interface, which supports IPv6 but is also supported on recent * IPv4-only machines. On systems that don't have that interface, we - * emulate it using the KAME implementation. - **/ + * emulate it using the KAME implementation. */ #include "rsync.h" #include diff --git a/syscall.c b/syscall.c index 5cee2326..2d724345 100644 --- a/syscall.c +++ b/syscall.c @@ -1,28 +1,25 @@ -/* - Copyright (C) Andrew Tridgell 1998 - Copyright (C) 2002 by Martin Pool - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/** - * @file syscall.c - * +/* * Syscall wrappers to ensure that nothing gets done in dry_run mode * and to handle system peculiarities. - **/ + * + * Copyright (C) 1998 Andrew Tridgell + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" @@ -168,10 +165,10 @@ void trim_trailing_slashes(char *name) /* Some BSD systems cannot make a directory if the name * contains a trailing slash. * */ - + /* Don't change empty string; and also we can't improve on * "/" */ - + l = strlen(name); while (l > 1) { if (name[--l] != '/') @@ -184,7 +181,7 @@ int do_mkdir(char *fname, mode_t mode) { if (dry_run) return 0; RETURN_ERROR_IF_RO_OR_LO; - trim_trailing_slashes(fname); + trim_trailing_slashes(fname); return mkdir(fname, mode); } diff --git a/t_stub.c b/t_stub.c index c2e972d5..0687f5ef 100644 --- a/t_stub.c +++ b/t_stub.c @@ -1,31 +1,27 @@ -/* -*- c-file-style: "linux" -*- - * - * Copyright (C) 2001, 2002 by Martin Pool +/* + * This file contains really simple implementations for rsync global + * functions, so that module test harnesses can run standalone. + * + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" -/** - * @file t_stub.c - * - * This file contains really simple implementations for rsync global - * functions, so that module test harnesses can run standalone. - **/ - int modify_window = 0; int module_id = -1; int relative_paths = 0; diff --git a/t_unsafe.c b/t_unsafe.c index 094447c0..279b5ac4 100644 --- a/t_unsafe.c +++ b/t_unsafe.c @@ -1,36 +1,32 @@ /* - * Copyright (C) 2002 by Martin Pool - * + * Test harness for unsafe_symlink(). Not linked into rsync itself. + * + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003 Wayne Davison + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file - * - * Test harness for unsafe_symlink(). Not linked into @c rsync itself. - * - * Prints either "safe" or "unsafe" depending on the two arguments. - * Always returns 0 unless something extraordinary happens. - **/ +/* Prints either "safe" or "unsafe" depending on the two arguments. + * Always returns 0 unless something extraordinary happens. */ #include "rsync.h" int dry_run, read_only, list_only, verbose; int preserve_perms = 0; - int main(int argc, char **argv) { @@ -41,6 +37,6 @@ main(int argc, char **argv) printf("%s\n", unsafe_symlink(argv[1], argv[2]) ? "unsafe" : "safe"); - + return 0; } diff --git a/tls.c b/tls.c index 569c55b2..2f5b6b44 100644 --- a/tls.c +++ b/tls.c @@ -1,6 +1,8 @@ -/* -*- c-file-style: "linux" -*- +/* + * Trivial ls for comparing two directories after running an rsync. * - * Copyright (C) 2001, 2002 by Martin Pool + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005 Wayne Davison * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version @@ -13,15 +15,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file tls.c - * - * Trivial @c ls for comparing two directories after running an rsync. - * - * The problem with using the system's own ls is that some features +/* The problem with using the system's own ls is that some features * have little quirks that make directories look different when for * our purposes they're the same -- for example, the BSD braindamage * about setting the mode on symlinks based on your current umask. @@ -34,9 +31,7 @@ * * A key requirement for this program is that the output be "very * reproducible." So we mask away information that can accidentally - * change. - **/ - + * change. */ #include "rsync.h" @@ -48,7 +43,6 @@ int read_only = 1; int list_only = 0; int preserve_perms = 0; - static void failed(char const *what, char const *where) { fprintf(stderr, PROGRAM ": %s %s: %s\n", @@ -56,8 +50,6 @@ static void failed(char const *what, char const *where) exit(1); } - - static void list_file(const char *fname) { STRUCT_STAT buf; @@ -124,7 +116,6 @@ static void list_file(const char *fname) datebuf, fname, linkbuf); } - int main(int argc, char *argv[]) { diff --git a/token.c b/token.c index e504b46d..edb5642d 100644 --- a/token.c +++ b/token.c @@ -1,21 +1,24 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + * Routines used by the file-transfer code. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2003, 2004, 2005 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #include "rsync.h" #include "zlib/zlib.h" @@ -105,7 +108,6 @@ static int32 simple_recv_token(int f, char **data) return n; } - /* non-compressing send token */ static void simple_send_token(int f, int32 token, struct map_struct *buf, OFF_T offset, int32 n) @@ -124,7 +126,6 @@ static void simple_send_token(int f, int32 token, struct map_struct *buf, write_int(f, -(token+1)); } - /* Flag bytes in compressed stream are encoded as follows: */ #define END_FLAG 0 /* that's all folks */ #define TOKEN_LONG 0x20 /* followed by 32-bit token number */ @@ -188,10 +189,8 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, last_run_end = 0; run_start = token; flush_pending = 0; - } else if (last_token == -2) { run_start = token; - } else if (nb != 0 || token != last_token + 1 || token >= run_start + 65536) { /* output previous run */ @@ -295,7 +294,6 @@ send_deflated_token(int f, int32 token, struct map_struct *buf, OFF_T offset, } } - /* tells us what the receiver is in the middle of doing */ static enum { r_init, r_idle, r_running, r_inflating, r_inflated } recv_state; @@ -494,7 +492,6 @@ void send_token(int f, int32 token, struct map_struct *buf, OFF_T offset, send_deflated_token(f, token, buf, offset, n, toklen); } - /* * receive a token or buffer from the other end. If the reurn value is >0 then * it is a data buffer of that length, and *data will point at the data. diff --git a/trimslash.c b/trimslash.c index 80852244..227c2e0f 100644 --- a/trimslash.c +++ b/trimslash.c @@ -1,19 +1,22 @@ /* - * Copyright (C) 2002 by Martin Pool - * + * Simple utility used only by the test harness. + * + * Copyright (C) 2002 Martin Pool + * Copyright (C) 2003 Wayne Davison + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "rsync.h" @@ -24,16 +27,11 @@ int read_only = 1; int list_only = 0; int preserve_perms = 0; -/** - * @file trimslash.c - * - * Test harness; not linked into release. - **/ int main(int argc, char **argv) { int i; - + if (argc <= 1) { fprintf(stderr, "trimslash: needs at least one argument\n"); return 1; diff --git a/uidlist.c b/uidlist.c index 1747c836..5b252439 100644 --- a/uidlist.c +++ b/uidlist.c @@ -1,27 +1,28 @@ /* - Copyright (C) Andrew Tridgell 1996 - Copyright (C) Paul Mackerras 1996 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* handle the mapping of uid/gid and user/group names between systems. - If the source username/group does not exist on the target then use - the numeric IDs. Never do any mapping for uid=0 or gid=0 as these - are special. -*/ + * Handle the mapping of uid/gid and user/group names between systems. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2004, 2005, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* If the source username/group does not exist on the target then use + * the numeric IDs. Never do any mapping for uid=0 or gid=0 as these + * are special. */ #include "rsync.h" diff --git a/util.c b/util.c index dcb48f5c..2ec56a7c 100644 --- a/util.c +++ b/util.c @@ -1,8 +1,10 @@ -/* -*- c-file-style: "linux" -*- +/* + * Utility routines used in rsync. * - * Copyright (C) 1996-2000 by Andrew Tridgell - * Copyright (C) Paul Mackerras 1996 - * Copyright (C) 2001, 2002 by Martin Pool + * Copyright (C) 1996-2000 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras + * Copyright (C) 2001, 2002 Martin Pool + * Copyright (C) 2003, 2004, 2005, 2006 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,15 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * @file - * - * Utilities used in rsync - **/ - #include "rsync.h" extern int verbose; @@ -39,11 +35,7 @@ extern struct filter_list_struct server_filter_list; int sanitize_paths = 0; - - -/** - * Set a fd into nonblocking mode - **/ +/* Set a fd into nonblocking mode. */ void set_nonblocking(int fd) { int val; @@ -56,9 +48,7 @@ void set_nonblocking(int fd) } } -/** - * Set a fd into blocking mode - **/ +/* Set a fd into blocking mode. */ void set_blocking(int fd) { int val; @@ -759,7 +749,7 @@ unsigned int clean_fname(char *name, BOOL collapse_dot_dot) * of the path. Use -1 to allow unlimited depth. * * We also clean the path in a manner similar to clean_fname() but with a - * few differences: + * few differences: * * Turns multiple adjacent slashes into a single slash, gets rid of "." dir * elements (INCLUDING a trailing dot dir), PRESERVES a trailing slash, and diff --git a/wildtest.c b/wildtest.c index 6189f1f6..5286b64b 100644 --- a/wildtest.c +++ b/wildtest.c @@ -1,6 +1,22 @@ /* -** wildmatch test suite. -*/ + * Test suite for the wildmatch code. + * + * Copyright (C) 2003, 2004, 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*#define COMPARE_WITH_FNMATCH*/ -- 2.34.1