extern int uid_ndx;
extern int gid_ndx;
extern int eol_nulls;
-@@ -386,6 +387,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -390,6 +391,9 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
{
static time_t modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -415,6 +419,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -419,6 +423,14 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
xflags |= XMIT_SAME_MODE;
else
mode = file->mode;
if ((preserve_devices && IS_DEVICE(mode))
|| (preserve_specials && IS_SPECIAL(mode))) {
-@@ -529,6 +541,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
+@@ -533,6 +545,10 @@ static void send_file_entry(int f, const char *fname, struct file_struct *file,
}
if (!(xflags & XMIT_SAME_MODE))
write_int(f, to_wire_mode(mode));
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
write_int(f, uid);
-@@ -617,6 +633,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -621,6 +637,9 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
{
static int64 modtime;
static mode_t mode;
#ifdef SUPPORT_HARD_LINKS
static int64 dev;
#endif
-@@ -752,6 +771,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -756,6 +775,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
if (chmod_modes && !S_ISLNK(mode))
mode = tweak_mode(mode, chmod_modes);
if (preserve_uid && !(xflags & XMIT_SAME_UID)) {
if (protocol_version < 30)
-@@ -872,6 +895,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
+@@ -876,6 +899,10 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
}
file->mode = mode;
if (preserve_uid)
F_OWNER(file) = uid;
if (preserve_gid) {
-@@ -1222,6 +1249,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+@@ -1226,6 +1253,10 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
OPT_EXTRA(file, 0)->unum = (uint32)(st.st_size >> 32);
}
file->mode = st.st_mode;