Commit 7e0ca8e2 authored by David Dykstra's avatar David Dykstra

When not using -p and file being copied to already existed, was mistakenly

using all the mode bits of the existing file rather than just the permissions,
including the file type.
parent d79d1c69
...@@ -192,7 +192,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out) ...@@ -192,7 +192,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
/* if the file exists already and we aren't perserving /* if the file exists already and we aren't perserving
presmissions then act as though the remote end sent presmissions then act as though the remote end sent
us the file permissions we already have */ us the file permissions we already have */
file->mode = st.st_mode; file->mode = (file->mode & _S_IFMT) | (st.st_mode & ~_S_IFMT);
} }
if (S_ISDIR(file->mode)) { if (S_ISDIR(file->mode)) {
...@@ -234,7 +234,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out) ...@@ -234,7 +234,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out)
l = readlink(fname,lnk,MAXPATHLEN-1); l = readlink(fname,lnk,MAXPATHLEN-1);
if (l > 0) { if (l > 0) {
lnk[l] = 0; lnk[l] = 0;
if (file->link && strcmp(lnk,file->link) == 0) { if (strcmp(lnk,file->link) == 0) {
set_perms(fname,file,&st,1); set_perms(fname,file,&st,1);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment