make proto
---- orig/Makefile.in 2004-08-13 07:18:58
+--- orig/Makefile.in 2005-07-07 23:11:07
+++ Makefile.in 2004-07-03 20:13:41
-@@ -34,7 +34,7 @@ ZLIBOBJ=zlib/deflate.o zlib/infblock.o z
+@@ -33,7 +33,7 @@ ZLIBOBJ=zlib/deflate.o zlib/inffast.o zl
OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
main.o checksum.o match.o syscall.o log.o backup.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
OBJS3=progress.o pipe.o
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
---- orig/chmod.c 2004-06-18 17:22:08
-+++ chmod.c 2004-06-18 17:22:08
-@@ -0,0 +1,184 @@
+--- orig/chmod.c 2005-07-09 16:09:14
++++ chmod.c 2005-07-09 16:09:14
+@@ -0,0 +1,195 @@
+#include "rsync.h"
+
++extern int orig_umask;
++
+#define FLAG_X_KEEP (1<<0)
+#define FLAG_DIRS_ONLY (1<<1)
+#define FLAG_FILES_ONLY (1<<2)
+
+ while (state != STATE_ERROR) {
+ if (!*modestr || *modestr == ',') {
++ int bits;
++
+ if (!op) {
+ state = STATE_ERROR;
+ break;
+ first_mode = curr_mode;
+ curr_mode->next = NULL;
+
++ if (where)
++ bits = where * what;
++ else {
++ where = 0111;
++ bits = (where * what) & ~orig_umask;
++ }
++
+ switch (op) {
+ case CHMOD_ADD:
+ curr_mode->ModeAND = 07777;
-+ curr_mode->ModeOR = (where * what) + topoct;
++ curr_mode->ModeOR = bits + topoct;
+ break;
+ case CHMOD_SUB:
-+ curr_mode->ModeAND = 07777 - (where * what) - topoct;
++ curr_mode->ModeAND = 07777 - bits - topoct;
+ curr_mode->ModeOR = 0;
+ break;
+ case CHMOD_EQ:
-+ curr_mode->ModeAND = 07777 - (where * 7);
-+ curr_mode->ModeOR = where * what - topoct;
++ curr_mode->ModeAND = 07777 - (where * 7) - (topoct ? topbits : 0);
++ curr_mode->ModeOR = bits + topoct;
+ break;
+ }
+
+ }
+ return 0;
+}
---- orig/flist.c 2004-09-21 09:40:27
+--- orig/flist.c 2005-08-17 06:45:07
+++ flist.c 2004-09-18 01:51:11
-@@ -65,6 +65,8 @@ extern int delete_excluded;
- extern int orig_umask;
- extern int list_only;
+@@ -62,6 +62,8 @@ extern struct file_list *the_file_list;
+
+ extern char curr_dir[MAXPATHLEN];
+extern struct chmod_mode_struct *chmod_modes;
+
- extern struct exclude_list_struct exclude_list;
- extern struct exclude_list_struct server_exclude_list;
- extern struct exclude_list_struct local_exclude_list;
-@@ -869,7 +871,10 @@ skip_excludes:
+ extern struct filter_list_struct filter_list;
+ extern struct filter_list_struct server_filter_list;
+
+@@ -883,7 +885,10 @@ skip_filters:
file->flags = flags;
file->modtime = st.st_mtime;
file->length = st.st_size;
file->uid = st.st_uid;
file->gid = st.st_gid;
---- orig/options.c 2004-09-20 05:10:48
-+++ options.c 2004-07-03 20:13:41
-@@ -126,6 +126,7 @@ char *log_format = NULL;
+--- orig/options.c 2005-08-27 21:11:26
++++ options.c 2005-08-27 21:18:52
+@@ -141,6 +141,7 @@ char *log_format = NULL;
char *password_file = NULL;
char *rsync_path = RSYNC_PATH;
char *backup_dir = NULL;
+char *chmod_mode = NULL;
char backup_dir_buf[MAXPATHLEN];
- int rsync_port = RSYNC_PORT;
- int link_dest = 0;
-@@ -138,6 +139,8 @@ int list_only = 0;
+ int rsync_port = 0;
+ int compare_dest = 0;
+@@ -160,6 +161,8 @@ int list_only = 0;
#define MAX_BATCH_NAME_LEN 256 /* Must be less than MAXPATHLEN-13 */
char *batch_name = NULL;
+struct chmod_mode_struct *chmod_modes = NULL;
+
static int daemon_opt; /* sets am_daemon after option error-reporting */
+ static int F_option_cnt = 0;
static int modify_window_set;
-
-@@ -253,6 +256,7 @@ void usage(enum logcode F)
- rprintf(F," -g, --group preserve group\n");
+@@ -289,6 +292,7 @@ void usage(enum logcode F)
rprintf(F," -D, --devices preserve devices (root only)\n");
rprintf(F," -t, --times preserve times\n");
+ rprintf(F," -O, --omit-dir-times omit directories when preserving times\n");
+ rprintf(F," --chmod=CHMOD change destination permissions\n");
rprintf(F," -S, --sparse handle sparse files efficiently\n");
rprintf(F," -n, --dry-run show what would have been transferred\n");
- rprintf(F," -W, --whole-file copy whole files, no incremental checks\n");
-@@ -360,6 +364,7 @@ static struct poptOption long_options[]
- {"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 0, 0 },
- {"owner", 'o', POPT_ARG_NONE, &preserve_uid, 0, 0, 0 },
- {"group", 'g', POPT_ARG_NONE, &preserve_gid, 0, 0, 0 },
+ rprintf(F," -W, --whole-file copy files whole (without rsync algorithm)\n");
+@@ -411,6 +415,7 @@ static struct poptOption long_options[]
+ {"no-relative", 0, POPT_ARG_VAL, &relative_paths, 0, 0, 0 },
+ {"no-R", 0, POPT_ARG_VAL, &relative_paths, 0, 0, 0 },
+ {"no-implied-dirs", 0, POPT_ARG_VAL, &implied_dirs, 0, 0, 0 },
+ {"chmod", 0, POPT_ARG_STRING, &chmod_mode, 0, 0, 0 },
- {"devices", 'D', POPT_ARG_NONE, &preserve_devices, 0, 0, 0 },
- {"times", 't', POPT_ARG_NONE, &preserve_times, 0, 0, 0 },
- {"checksum", 'c', POPT_ARG_NONE, &always_checksum, 0, 0, 0 },
-@@ -804,6 +809,13 @@ int parse_arguments(int *argc, const cha
- return 0;
- }
+ {"ignore-times", 'I', POPT_ARG_NONE, &ignore_times, 0, 0, 0 },
+ {"size-only", 0, POPT_ARG_NONE, &size_only, 0, 0, 0 },
+ {"one-file-system", 'x', POPT_ARG_NONE, &one_file_system, 0, 0, 0 },
+@@ -1122,6 +1127,13 @@ int parse_arguments(int *argc, const cha
+ if (make_backups && !backup_dir)
+ omit_dir_times = 1;
+ if (chmod_mode && !(chmod_modes = parse_chmod(chmod_mode))) {
+ snprintf(err_buf, sizeof err_buf,
+ return 0;
+ }
+
- if (do_progress && !verbose)
- verbose = 1;
-
-@@ -1083,6 +1095,11 @@ void server_options(char **args,int *arg
- args[ac++] = compare_dest;
+ if (log_format) {
+ if (log_format_has(log_format, 'i'))
+ log_format_has_i = 1;
+@@ -1507,6 +1519,11 @@ void server_options(char **args,int *arg
+ }
}
+ if (chmod_mode && !am_sender) {
+ args[ac++] = chmod_mode;
+ }
+
- if (files_from && (!am_sender || remote_filesfrom_file)) {
- if (remote_filesfrom_file) {
+ if (files_from && (!am_sender || filesfrom_host)) {
+ if (filesfrom_host) {
args[ac++] = "--files-from";
---- orig/rsync.yo 2004-09-20 05:10:48
-+++ rsync.yo 2004-07-03 20:13:41
-@@ -330,6 +330,7 @@ verb(
- -g, --group preserve group
+--- orig/rsync.yo 2005-08-27 21:05:12
++++ rsync.yo 2005-01-24 01:48:43
+@@ -323,6 +323,7 @@ to the detailed description below for a
-D, --devices preserve devices (root only)
-t, --times preserve times
+ -O, --omit-dir-times omit directories when preserving times
+ --chmod=CHMOD change destination permissions
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
- -W, --whole-file copy whole files, no incremental checks
-@@ -603,6 +604,14 @@ cause the next transfer to behave as if
- updated (though the rsync algorithm will make the update fairly efficient
- if the files haven't actually changed, you're much better off using -t).
+ -W, --whole-file copy files whole (without rsync algorithm)
+@@ -695,6 +696,14 @@ it is preserving modification times (see
+ the directories on the receiving side, it is a good idea to use bf(-O).
+ This option is inferred if you use bf(--backup) without bf(--backup-dir).
+dit(bf(--chmod)) This options tells rsync to apply the listed "chmod" pattern
+to the permission of the files on the destination. In addition to the normal
dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
instead it will just report the actions it would have taken.
---- orig/testsuite/chmod-option.test 2004-06-18 17:22:09
-+++ testsuite/chmod-option.test 2004-06-18 17:22:09
-@@ -0,0 +1,43 @@
+--- orig/testsuite/chmod-option.test 2005-07-09 15:49:59
++++ testsuite/chmod-option.test 2005-07-09 15:49:59
+@@ -0,0 +1,44 @@
+#! /bin/sh
+
+# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
+checkit "$RSYNC -avv \"$fromdir/\" \"$checkdir/\"" "$fromdir" "$checkdir"
+
+# And then manually make the changes which should occur
++umask 002
+chmod ug-s,a+rX "$checkdir"/*
-+chmod g+w "$checkdir" "$checkdir"/dir*
++chmod +w "$checkdir" "$checkdir"/dir*
+
-+checkit "$RSYNC -avv --chmod ug-s,a+rX,Dg+w \"$fromdir/\" \"$todir/\"" "$checkdir" "$todir"
++checkit "$RSYNC -avv --chmod ug-s,a+rX,D+w \"$fromdir/\" \"$todir/\"" "$checkdir" "$todir"
+
+# The script would have aborted on error, so getting here means we've won.
+exit 0