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
The uid & gid are now stored using an id_pair structure.
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
6d2812c
..
d78a085
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-82,9
+82,9
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
updated = 1;
}
updated = 1;
}
- change_uid = am_root && preserve_uid && st->st_uid != file->uid;
- change_gid = preserve_gid && file->gid != GID_NONE
- && st->st_gid != file->gid;
+ change_uid = am_root && preserve_uid && st->st_uid != file->
ids->
uid;
+ change_gid = preserve_gid && file->
ids->
gid != GID_NONE
+ && st->st_gid != file->
ids->
gid;
#if !defined HAVE_LCHOWN && !defined CHOWN_MODIFIES_SYMLINK
if (S_ISLNK(st->st_mode))
;
#if !defined HAVE_LCHOWN && !defined CHOWN_MODIFIES_SYMLINK
if (S_ISLNK(st->st_mode))
;
@@
-95,19
+95,19
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
if (change_uid) {
rprintf(FINFO,
"set uid of %s from %ld to %ld\n",
if (change_uid) {
rprintf(FINFO,
"set uid of %s from %ld to %ld\n",
-
safe_fname(fname)
,
- (long)st->st_uid, (long)file->uid);
+
fname
,
+ (long)st->st_uid, (long)file->
ids->
uid);
}
if (change_gid) {
rprintf(FINFO,
"set gid of %s from %ld to %ld\n",
}
if (change_gid) {
rprintf(FINFO,
"set gid of %s from %ld to %ld\n",
-
safe_fname(fname)
,
- (long)st->st_gid, (long)file->gid);
+
fname
,
+ (long)st->st_gid, (long)file->
ids->
gid);
}
}
if (do_lchown(fname,
}
}
if (do_lchown(fname,
- change_uid ? file->uid : st->st_uid,
- change_gid ? file->gid : st->st_gid) != 0) {
+ change_uid ? file->
ids->
uid : st->st_uid,
+ change_gid ? file->
ids->
gid : st->st_gid) != 0) {
/* shouldn't have attempted to change uid or gid
* unless have the privilege */
rsyserr(FERROR, errno, "%s %s failed",
/* shouldn't have attempted to change uid or gid
* unless have the privilege */
rsyserr(FERROR, errno, "%s %s failed",
@@
-143,9
+143,9
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
enum logcode code = daemon_log_format_has_i || dry_run
? FCLIENT : FINFO;
if (updated)
enum logcode code = daemon_log_format_has_i || dry_run
? FCLIENT : FINFO;
if (updated)
- rprintf(code, "%s\n",
safe_fname(fname)
);
+ rprintf(code, "%s\n",
fname
);
else
else
- rprintf(code, "%s is uptodate\n",
safe_fname(fname)
);
+ rprintf(code, "%s is uptodate\n",
fname
);
}
return updated;
}
}
return updated;
}
@@
-175,7
+175,7
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
if (inplace) {
if (verbose > 2)
if (inplace) {
if (verbose > 2)
- rprintf(FINFO, "finishing %s\n",
safe_fname(fname)
);
+ rprintf(FINFO, "finishing %s\n",
fname
);
goto do_set_perms;
}
goto do_set_perms;
}
@@
-186,15
+186,13
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
set_perms(fnametmp, file, NULL, ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
/* move tmp file over real file */
set_perms(fnametmp, file, NULL, ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
/* move tmp file over real file */
- if (verbose > 2) {
- rprintf(FINFO, "renaming %s to %s\n",
- safe_fname(fnametmp), safe_fname(fname));
- }
+ if (verbose > 2)
+ rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
rsyserr(FERROR, errno, "%s %s -> \"%s\"",
ret = robust_rename(fnametmp, fname, file->mode & INITACCESSPERMS);
if (ret < 0) {
rsyserr(FERROR, errno, "%s %s -> \"%s\"",
- ret == -2 ? "copy" : "rename",
-
full_fname(fnametmp), safe_fname(fname)
);
+
ret == -2 ? "copy" : "rename",
+
full_fname(fnametmp), fname
);
do_unlink(fnametmp);
return;
}
do_unlink(fnametmp);
return;
}