/* set the dest file attributes to that of source (ignoring errors) */
- if (perms && chown(tl, st.st_uid, st.st_gid) < 0) ret = FALSE;
- if (perms && chmod(tl, st.st_mode) < 0) ret = FALSE;
+ if (perms)
+ {
+ ret = chown(tl, st.st_uid, st.st_gid);
+ /* Ignores chown errors, while still doing chown
+ (so root still can copy files preserving ownership) */
+ ret = TRUE;
+ if (chmod(tl, st.st_mode) < 0) ret = FALSE;
+ }
tb.actime = st.st_atime;
tb.modtime = st.st_mtime;