Displaying 20 results from an estimated 46 matches for "preserve_perms".
2004 Mar 05
2
Problem with --link-dest when syncing AIX to Linux
..../
file1
file2
wrote 68 bytes read 189 bytes 102.80 bytes/sec
total size is 14 speedup is 0.05
=====> Oooops. Why were file1 and file2 transferred?
I did some debugging and found out that the problem seems to be in the
function skip_file() in generator.c:
if (link_dest) {
extern int preserve_perms;
extern int preserve_uid;
extern int preserve_gid;
if(preserve_perms
&& (st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))
return 0;
This is always true when rsyncing AIX -> linux, look at this gdb output:
(gdb) print /o st->st_mode...
2003 Mar 20
2
--link-dest uid/gid checking bug?
Hi --
I was very keen to download rsync and give it a whirl with the
new --link-dest feature. However, I was terribly puzzled when I
couldn't seem to get it working, even though --compare-dest with
the same argument would work. It seemed like new files would
be transferred even though files existed in the compare-dest/link-dest
location; compare-dest would detect them but link-dest would
2006 Jun 02
3
[PATCH] --omit-dir-changes, qsort<>mergesort issues
...mp;& !(S_ISDIR(st->st_mode) && omit_dir_changes))
iflags |= ITEM_REPORT_GROUP;
} else
iflags |= ITEM_IS_NEW;
@@ -891,7 +893,7 @@
/* If we're not preserving permissions, change the file-list's
* mode based on the local permissions and some heuristics. */
- if (!preserve_perms) {
+ if (!preserve_perms || (S_ISDIR(st.st_mode) && omit_dir_changes)) {
int exists = statret == 0
&& S_ISDIR(st.st_mode) == S_ISDIR(file->mode);
file->mode = dest_mode(file->mode, st.st_mode, exists);
Index: options.c
===========================================...
2010 Jun 15
3
about rsyncing of block devices
...(fd1, 0, SEEK_SET);
+ if (off != 0)
+ rsyserr(FERROR, errno, "failed to seek back to beginning of %s to read it", fname);
+ }
+ }
+
/* If we're not preserving permissions, change the file-list's
* mode based on the local permissions and some heuristics. */
if (!preserve_perms) {
diff -pur rsync-3.0.7/rsync.c rsync-3.0.7.new/rsync.c
--- rsync-3.0.7/rsync.c 2009-12-19 21:39:49.000000000 +0000
+++ rsync-3.0.7.new/rsync.c 2010-06-14 10:24:49.339960221 +0100
@@ -34,6 +34,7 @@ extern int preserve_xattrs;
extern int preserve_perms;
extern int preserve_executability;
extern...
2003 Apr 08
1
link_dest checks perms despite no -p -o or -g
...-g haven't been specified.
if (link_dest) {
if((st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT)) {
return 0;
}
if (st->st_uid != file->uid || st->st_gid != file->gid) {
return 0;
}
}
I think the code should be this instead.
if (link_dest) {
if(preserve_perms &&
((st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))) {
return 0;
}
if ((preserve_uid && (st->st_uid != file->uid)) ||
(preserve_gid && (st->st_gid != file->gid))) {
return 0;
}
}
Tested lightly here, seems to do the ri...
2003 Nov 05
1
--link-dest
...ck ups. (I think... I didn't look at the large
picture.)
Joe
*** generator.c Thu Aug 29 09:44:55 2002
--- ../generator.c Tue Nov 4 09:12:59 2003
***************
*** 42,47 ****
--- 42,50 ----
extern int modify_window;
extern char *compare_dest;
extern int link_dest;
+ extern int preserve_perms;
+ extern int preserve_uid;
+ extern int preserve_gid;
/* choose whether to skip a particular file */
***************
*** 51,63 ****
if (st->st_size != file->length) {
return 0;
}
! if (link_dest) {
! if((st->st_mode & ~_S_I...
2005 Jul 26
1
itemize() needs to use CHMOD_BITS (patch)
...- generator.c.~1~ Thu Jun 30 13:03:14 2005
+++ generator.c Tue Jul 26 12:51:11 2005
@@ -327,7 +327,8 @@
&& (!(iflags & ITEM_XNAME_FOLLOWS) || *xname))
|| (keep_time && cmp_modtime(file->modtime, st->st_mtime) != 0))
iflags |= ITEM_REPORT_TIME;
- if (preserve_perms && file->mode != st->st_mode)
+ if (preserve_perms && (st->st_mode & CHMOD_BITS)
+ != (file->mode & CHMOD_BITS))
iflags |= ITEM_REPORT_PERMS;
if (preserve_uid && am_root && file->uid != st->st_uid)
iflags |= ITEM_REPORT_...
2008 Dec 05
0
rsync patch to allow content from one device file to be synced to another device file
...115-2333GMT/receiver.c
rsync-HEAD-20081115-2333GMT-d2d/receiver.c
--- rsync-HEAD-20081115-2333GMT/receiver.c 2008-11-15
17:50:40.000000000 -0500
+++ rsync-HEAD-20081115-2333GMT-d2d/receiver.c 2008-12-04
17:01:00.000000000 -0500
@@ -38,6 +38,7 @@
extern int preserve_hard_links;
extern int preserve_perms;
extern int preserve_xattrs;
+extern int copy_devices;
extern int basis_dir_cnt;
extern int make_backups;
extern int cleanup_got_literal;
@@ -285,7 +286,7 @@
goto report_write_error;
#ifdef HAVE_FTRUNCATE
- if (inplace && fd != -1
+ if (inplace && !...
2009 Oct 15
1
PATCH: --write-devices to allow synchronising to a block device
...diff -ru rsync-3.0.6/receiver.c rsync-3.0.6-writedev/receiver.c
--- rsync-3.0.6/receiver.c 2009-04-13 07:48:59.000000000 +1200
+++ rsync-3.0.6-writedev/receiver.c 2009-10-15 20:54:22.000000000 +1300
@@ -38,6 +38,7 @@
extern int relative_paths;
extern int preserve_hard_links;
extern int preserve_perms;
+extern int write_devices;
extern int preserve_xattrs;
extern int basis_dir_cnt;
extern int make_backups;
@@ -165,6 +166,7 @@
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
const char *fname, int fd, OFF_T total_size)
{
+ STRUCT_STAT st...
2002 Dec 21
3
am I missing something, or are permissions always preserved?
They seem to be for me, even when I don't pass in the --perms flag. This
is a problem because I'm rsyncing to a samba mount with fixed
permissions.
Looking at rsync.c (for version 2.5.5) starting at line 204, I see this
code snippet:
#ifdef HAVE_CHMOD
if (!S_ISLNK(st->st_mode)) {
if (st->st_mode != file->mode) {
updated = 1;
if
2003 Jan 02
3
Not preserving permissions really preserves some
...t (through group permissions).
Suggested solution:
I don't think changing the way permissions are created would be
that backward-compatible, so maybe a new option?
Create an option: --ignore-permissions
in receive_file_entry(), in filelist.c
========== code block ====================
if (!preserve_perms) {
extern int orig_umask;
/* set an appropriate set of permissions based on original
permissions and umask. This emulates what GNU cp does */
file->mode &= ~orig_umask; <-- change this to line below
file->mode = ((ignore_perms?0:0666) | file->mode) &a...
2003 Mar 12
1
patch: typo's and gcc warnings
...d and unsigned".
Paul Slootman
-------------- next part --------------
diff -ru orig/rsync-2.5.6/generator.c rsync-2.5.6/generator.c
--- orig/rsync-2.5.6/generator.c 2002-08-29 16:44:55.000000000 +0200
+++ rsync-2.5.6/generator.c 2003-03-07 12:06:57.000000000 +0100
@@ -241,7 +241,7 @@
!preserve_perms &&
(S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
/* if the file exists already and we aren't perserving
- presmissions then act as though the remote end sent
+ permissions then act as though the remote end sent
us th...
2008 Feb 15
4
Revised flags patch
...LINK_DONE;
diff -brpu rsync-3.0.0pre9/options.c rsync-3.0.0pre9-flags/options.c
--- rsync-3.0.0pre9/options.c Sat Jan 19 20:20:17 2008
+++ rsync-3.0.0pre9-flags/options.c Fri Feb 15 19:35:16 2008
@@ -52,6 +52,7 @@ int preserve_hard_links = 0;
int preserve_acls = 0;
int preserve_xattrs = 0;
int preserve_perms = 0;
+int preserve_fileflags = 0;
int preserve_executability = 0;
int preserve_devices = 0;
int preserve_specials = 0;
@@ -223,6 +224,7 @@ static void print_rsync_version(enum log
char const *links = "no ";
char const *iconv = "no ";
char const *ipv6 = "no ";...
2004 Jan 24
2
[PATCH] --links-depth for rsync
...evision 1.169
diff -u -r1.169 flist.c
--- flist.c 22 Jan 2004 18:39:32 -0000 1.169
+++ flist.c 24 Jan 2004 20:30:08 -0000
@@ -50,6 +50,7 @@
extern int one_file_system;
extern int make_backups;
extern int preserve_links;
+extern int follow_links_depth;
extern int preserve_hard_links;
extern int preserve_perms;
extern int preserve_devices;
@@ -725,6 +726,65 @@
/* IRIX cc cares that the operands to the ternary have the same type. */
#define MALLOC(ap, i) (ap ? (void*) string_area_malloc(ap, i) : malloc(i))
+void make_file_stat(struct file_struct * file, STRUCT_STAT *st)
+{
+ file->modtime = st->...
2002 Mar 12
2
Patch: --drop-suid Remove suid/sgid from target files
...ciently\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");
@@ -304,6 +306,7 @@
{"perms", 'p', POPT_ARG_NONE, &preserve_perms},
{"owner", 'o', POPT_ARG_NONE, &preserve_uid},
{"group", 'g', POPT_ARG_NONE, &preserve_gid},
+ {"drop-suid", 0, POPT_ARG_NONE, &drop_suid},
{"devices", 'D', POPT_ARG_NONE...
2003 Sep 05
1
new option suggestion '--backup-only'
...odify_window;
extern char *compare_dest;
extern int link_dest;
+extern int backup_only;
/* choose whether to skip a particular file */
@@ -295,6 +296,9 @@
return;
}
+ if (backup_only && statret == -1 && errno == ENOENT)
+ return;
+
if (statret == 0 &&
!preserve_perms &&
(S_ISDIR(st.st_mode) == S_ISDIR(file->mode))) {
@@ -313,6 +317,8 @@
if (dry_run) return; /* XXXX -- might cause inaccuracies?? -- mbp */
if (statret == 0 && !S_ISDIR(st.st_mode)) {
+ if (backup_only)
+ return;
if (robust_unlink(fname) != 0) {
rprint...
2009 Mar 11
0
Odd issue with locked directories and Mac OS X
...insight would be appreciated.
Mike
diff -Naur rsync-3.0.5_base/receiver.c rsync-3.0.5/receiver.c
--- rsync-3.0.5_base/receiver.c 2008-11-15 16:49:28.000000000 -0600
+++ rsync-3.0.5/receiver.c 2009-03-10 22:18:20.000000000 -0500
@@ -39,6 +42,7 @@
extern int preserve_hard_links;
extern int preserve_perms;
extern int preserve_xattrs;
+extern int force_change;
extern int basis_dir_cnt;
extern int make_backups;
extern int cleanup_got_literal;
@@ -153,6 +157,20 @@
}
#endif
+#ifdef SUPPORT_FORCE_CHANGE
+ if (fd == -1) {
+ stat_x sx;
+ if (do_stat(file->dirname, &sx.st) < 0)
+...
2003 Sep 03
1
[patch] replace dir with file error
...RROR,"%s : is a directory (recv_files)\n",
+ fnamecmp);
+ receive_data(f_in, NULL, -1, NULL, file->length);
close(fd1);
continue;
+ }
+
+ if (fd1 != -1 && !S_ISREG(st.st_mode)) {
+ close(fd1);
+ fd1 = -1;
+ buf = NULL;
}
if (fd1 != -1 && !preserve_perms) {
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw@pegasys.ws
Remember Cernan and Schmitt
2004 Jun 21
0
Problem found and fixed with --update
...change I made, ``rsync'' never took this eventuality into
> account.
>
And now his patch. We hope it's helpful:
*** rsync.c.orig Tue Mar 23 10:16:15 2004
--- rsync.c Fri Jun 18 19:51:37 2004
***************
*** 33,38 ****
--- 33,39 ----
extern int preserve_gid;
extern int preserve_perms;
extern int make_backups;
+ extern int update_only;
/*
***************
*** 235,241 ****
--- 236,261 ----
if (make_backups && !make_backup(fname))
return;
+ /* if the target has been modified since the file list was generated,
+ just delete the tmp file, leaving the...
2008 Feb 16
1
Rsync itemizing "p" even when -p, -E are off
...;itemize", the generator itemizes "p"
whenever a file's file-list permissions differ from the permissions in
its stat buffer (those of the existing destination file if any,
otherwise those of the alternate basis file). Before commit b9887818,
this itemization was conditioned on (preserve_perms ||
preserve_executability). Wayne, what was the specific rationale for
removing the condition?
I suppose one could justify unconditionally itemizing a difference
between file-list permissions and an existing destination file since
rsync sets the file-list permissions on the destination file
uncon...