X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/cc3e685d09b2095099fc396157d19172ab3ef7c4..4c15e80040f6ac2fc79d599d1722cf209cc30536:/flags.diff diff --git a/flags.diff b/flags.diff index 8ad65fc..2673e91 100644 --- a/flags.diff +++ b/flags.diff @@ -48,7 +48,7 @@ diff --git a/configure.in b/configure.in + chflags strerror putenv iconv_open locale_charset nl_langinfo getxattr \ extattr_get_link sigaction sigprocmask setattrlist) - AC_CHECK_FUNCS(getpgrp tcgetpgrp) + dnl cygwin iconv.h defines iconv_open as libiconv_open diff --git a/flist.c b/flist.c --- a/flist.c +++ b/flist.c @@ -60,7 +60,7 @@ diff --git a/flist.c b/flist.c extern int uid_ndx; extern int gid_ndx; extern int eol_nulls; -@@ -345,6 +346,9 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -344,6 +345,9 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ { static time_t modtime; static mode_t mode; @@ -83,7 +83,7 @@ diff --git a/flist.c b/flist.c if ((preserve_devices && IS_DEVICE(mode)) || (preserve_specials && IS_SPECIAL(mode))) { -@@ -523,6 +533,10 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ +@@ -522,6 +532,10 @@ static void send_file_entry(int f, struct file_struct *file, int ndx, int first_ } if (!(xflags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); @@ -94,7 +94,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) write_int(f, uid); -@@ -611,6 +625,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -610,6 +624,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist, { static int64 modtime; static mode_t mode; @@ -104,7 +104,7 @@ diff --git a/flist.c b/flist.c #ifdef SUPPORT_HARD_LINKS static int64 dev; #endif -@@ -742,9 +759,12 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -741,9 +758,12 @@ static struct file_struct *recv_file_entry(struct file_list *flist, } if (!(xflags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); @@ -118,7 +118,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx && !(xflags & XMIT_SAME_UID)) { if (protocol_version < 30) -@@ -866,6 +886,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist, +@@ -865,6 +885,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist, OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32); } file->mode = mode; @@ -129,7 +129,7 @@ diff --git a/flist.c b/flist.c if (uid_ndx) F_OWNER(file) = uid; if (gid_ndx) { -@@ -1196,6 +1220,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, +@@ -1193,6 +1217,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32); } file->mode = st.st_mode; @@ -263,7 +263,7 @@ diff --git a/generator.c b/generator.c } } -@@ -1296,7 +1307,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1294,7 +1305,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, * full later (right before we handle its contents). */ if (statret == 0 && (S_ISDIR(sx.st.st_mode) @@ -272,7 +272,7 @@ diff --git a/generator.c b/generator.c goto cleanup; /* Any errors get reported later. */ if (do_mkdir(fname, file->mode & 0700) == 0) file->flags |= FLAG_DIR_CREATED; -@@ -1308,7 +1319,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1306,7 +1317,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, * we need to delete it. If it doesn't exist, then * (perhaps recursively) create it. */ if (statret == 0 && !S_ISDIR(sx.st.st_mode)) { @@ -281,7 +281,7 @@ diff --git a/generator.c b/generator.c goto skipping_dir_contents; statret = -1; } -@@ -1437,7 +1448,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1435,7 +1446,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, } /* Not the right symlink (or not a symlink), so * delete it. */ @@ -290,7 +290,7 @@ diff --git a/generator.c b/generator.c goto cleanup; } else if (basis_dir[0] != NULL) { int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx, -@@ -1516,7 +1527,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1514,7 +1525,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, goto return_with_success; goto cleanup; } @@ -299,7 +299,7 @@ diff --git a/generator.c b/generator.c goto cleanup; } else if (basis_dir[0] != NULL) { int j = try_dests_non(file, fname, ndx, fnamecmpbuf, &sx, -@@ -1607,7 +1618,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, +@@ -1605,7 +1616,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, fnamecmp_type = FNAMECMP_FNAME; if (statret == 0 && !S_ISREG(sx.st.st_mode)) { @@ -311,7 +311,7 @@ diff --git a/generator.c b/generator.c diff --git a/options.c b/options.c --- a/options.c +++ b/options.c -@@ -51,6 +51,7 @@ int preserve_hard_links = 0; +@@ -52,6 +52,7 @@ int preserve_hard_links = 0; int preserve_acls = 0; int preserve_xattrs = 0; int preserve_perms = 0; @@ -319,7 +319,7 @@ diff --git a/options.c b/options.c int preserve_executability = 0; int preserve_devices = 0; int preserve_specials = 0; -@@ -222,6 +223,7 @@ static void print_rsync_version(enum logcode f) +@@ -223,6 +224,7 @@ static void print_rsync_version(enum logcode f) char const *links = "no "; char const *iconv = "no "; char const *ipv6 = "no "; @@ -327,7 +327,7 @@ diff --git a/options.c b/options.c STRUCT_STAT *dumstat; #if SUBPROTOCOL_VERSION != 0 -@@ -251,6 +253,9 @@ static void print_rsync_version(enum logcode f) +@@ -252,6 +254,9 @@ static void print_rsync_version(enum logcode f) #ifdef ICONV_OPTION iconv = ""; #endif @@ -337,7 +337,7 @@ diff --git a/options.c b/options.c rprintf(f, "%s version %s protocol version %d%s\n", RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol); -@@ -264,8 +269,8 @@ static void print_rsync_version(enum logcode f) +@@ -265,8 +270,8 @@ static void print_rsync_version(enum logcode f) (int)(sizeof (int64) * 8)); rprintf(f, " %ssocketpairs, %shardlinks, %ssymlinks, %sIPv6, batchfiles, %sinplace,\n", got_socketpair, hardlinks, links, ipv6, have_inplace); @@ -348,7 +348,7 @@ diff --git a/options.c b/options.c #ifdef MAINTAINER_MODE rprintf(f, "Panic Action: \"%s\"\n", get_panic_action()); -@@ -332,6 +337,7 @@ void usage(enum logcode F) +@@ -333,6 +338,7 @@ void usage(enum logcode F) rprintf(F," -K, --keep-dirlinks treat symlinked dir on receiver as dir\n"); rprintf(F," -H, --hard-links preserve hard links\n"); rprintf(F," -p, --perms preserve permissions\n"); @@ -356,7 +356,7 @@ diff --git a/options.c b/options.c rprintf(F," -E, --executability preserve the file's executability\n"); rprintf(F," --chmod=CHMOD affect file and/or directory permissions\n"); #ifdef SUPPORT_ACLS -@@ -472,6 +478,8 @@ static struct poptOption long_options[] = { +@@ -473,6 +479,8 @@ static struct poptOption long_options[] = { {"perms", 'p', POPT_ARG_VAL, &preserve_perms, 1, 0, 0 }, {"no-perms", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 }, {"no-p", 0, POPT_ARG_VAL, &preserve_perms, 0, 0, 0 }, @@ -365,7 +365,7 @@ diff --git a/options.c b/options.c {"executability", 'E', POPT_ARG_NONE, &preserve_executability, 0, 0, 0 }, {"acls", 'A', POPT_ARG_NONE, 0, 'A', 0, 0 }, {"no-acls", 0, POPT_ARG_VAL, &preserve_acls, 0, 0, 0 }, -@@ -1287,6 +1295,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) +@@ -1289,6 +1297,15 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain) } #endif @@ -381,7 +381,7 @@ diff --git a/options.c b/options.c if (write_batch && read_batch) { snprintf(err_buf, sizeof err_buf, "--write-batch and --read-batch can not be used together\n"); -@@ -1795,6 +1812,9 @@ void server_options(char **args, int *argc_p) +@@ -1803,6 +1820,9 @@ void server_options(char **args, int *argc_p) if (xfer_dirs && !recurse && delete_mode && am_sender) args[ac++] = "--no-r"; @@ -419,7 +419,7 @@ diff --git a/rsync.c b/rsync.c static const char *default_charset(void) { # if defined HAVE_LIBCHARSET_H && defined HAVE_LOCALE_CHARSET -@@ -337,6 +348,41 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, +@@ -338,6 +349,41 @@ mode_t dest_mode(mode_t flist_mode, mode_t stat_mode, int dflt_perms, return new_mode; } @@ -461,7 +461,7 @@ diff --git a/rsync.c b/rsync.c int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, const char *fnamecmp, int flags) { -@@ -468,6 +514,15 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, +@@ -469,6 +515,15 @@ int set_file_attrs(const char *fname, struct file_struct *file, stat_x *sxp, } #endif @@ -477,7 +477,7 @@ diff --git a/rsync.c b/rsync.c if (verbose > 1 && flags & ATTRS_REPORT) { if (updated) rprintf(FCLIENT, "%s\n", fname); -@@ -527,6 +582,9 @@ void finish_transfer(const char *fname, const char *fnametmp, +@@ -530,6 +585,9 @@ int finish_transfer(const char *fname, const char *fnametmp, set_file_attrs(fnametmp, file, NULL, fnamecmp, ok_to_set_time ? 0 : ATTRS_SKIP_MTIME); @@ -487,14 +487,14 @@ diff --git a/rsync.c b/rsync.c /* move tmp file over real file */ if (verbose > 2) rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname); -@@ -541,6 +599,9 @@ void finish_transfer(const char *fname, const char *fnametmp, +@@ -547,6 +605,9 @@ int finish_transfer(const char *fname, const char *fnametmp, } if (ret == 0) { /* The file was moved into place (not copied), so it's done. */ +#ifdef SUPPORT_FLAGS + undo_make_mutable(fname, file->mode, F_FFLAGS(file)); +#endif - return; + return 1; } /* The file was copied, so tweak the perms of the copied file. If it diff --git a/rsync.h b/rsync.h