Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
handle hard links on systems with 16 bit ino_t
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
9681827
..
5ca73e2
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-441,6
+441,15
@@
static void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
#if SUPPORT_LINKS
char lnk[MAXPATHLEN];
int l;
#if SUPPORT_LINKS
char lnk[MAXPATHLEN];
int l;
+ extern int safe_symlinks;
+
+ if (safe_symlinks && unsafe_symlink(file->link, fname)) {
+ if (verbose) {
+ rprintf(FINFO,"ignoring unsafe symlink %s -> %s\n",
+ fname,file->link);
+ }
+ return;
+ }
if (statret == 0) {
l = readlink(fname,lnk,MAXPATHLEN-1);
if (l > 0) {
if (statret == 0) {
l = readlink(fname,lnk,MAXPATHLEN-1);
if (l > 0) {
@@
-457,9
+466,10
@@
static void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
fname,file->link,strerror(errno));
} else {
set_perms(fname,file,NULL,0);
fname,file->link,strerror(errno));
} else {
set_perms(fname,file,NULL,0);
- if (verbose)
+ if (verbose)
{
rprintf(FINFO,"%s -> %s\n",
fname,file->link);
rprintf(FINFO,"%s -> %s\n",
fname,file->link);
+ }
}
#endif
return;
}
#endif
return;
@@
-688,7
+698,7
@@
static void delete_one(struct file_struct *f)
static struct delete_list {
dev_t dev;
static struct delete_list {
dev_t dev;
-
ino_t
inode;
+
INO_T
inode;
} *delete_list;
static int dlist_len, dlist_alloc_len;
} *delete_list;
static int dlist_len, dlist_alloc_len;
@@
-845,7
+855,7
@@
static void finish_transfer(char *fname, char *fnametmp, struct file_struct *fil
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
if (errno == EXDEV) {
/* rename failed on cross-filesystem link.
Copy the file instead. */
- if (copy_file(fnametmp,fname, file->mode)) {
+ if (copy_file(fnametmp,fname, file->mode
& ACCESSPERMS
)) {
rprintf(FERROR,"copy %s -> %s : %s\n",
fnametmp,fname,strerror(errno));
} else {
rprintf(FERROR,"copy %s -> %s : %s\n",
fnametmp,fname,strerror(errno));
} else {