extern int output_needs_newline;
extern int sender_keeps_checksum;
extern int unsort_ndx;
+extern uid_t our_uid;
extern struct stats stats;
extern char *filesfrom_host;
extern char *usermap, *groupmap;
extern iconv_t ic_send, ic_recv;
#endif
-#ifdef HAVE_UTIMENSAT
-#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-#define ST_MTIME_NSEC st_mtim.tv_nsec
-#elif defined(HAVE_STRUCT_STAT_ST_MTIMENSEC)
-#define ST_MTIME_NSEC st_mtimensec
-#endif
-#endif
-
#define PTR_SIZE (sizeof (struct file_struct *))
int io_error;
}
#endif
file->mode = st.st_mode;
- if (uid_ndx) /* Check uid_ndx instead of preserve_uid for del support */
+ if (preserve_uid)
F_OWNER(file) = st.st_uid;
- if (gid_ndx) /* Check gid_ndx instead of preserve_gid for del support */
+ if (preserve_gid)
F_GROUP(file) = st.st_gid;
+ if (am_generator && st.st_uid == our_uid)
+ file->flags |= FLAG_OWNED_BY_US;
if (basename != thisname)
file->dirname = lastdir;
remainder = 0;
for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) {
+ unsigned name_len;
char *dname = d_name(di);
if (dname[0] == '.' && (dname[1] == '\0'
|| (dname[1] == '.' && dname[2] == '\0')))
continue;
- unsigned name_len = strlcpy(p, dname, remainder);
+ name_len = strlcpy(p, dname, remainder);
if (name_len >= remainder) {
char save = fbuf[len];
fbuf[len] = '\0';