From 7e0ca8e2f0945b8c1b99c88a0283068a3adb19e4 Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Wed, 29 Dec 1999 20:45:23 +0000 Subject: [PATCH] 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. --- generator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator.c b/generator.c index 886c6723..9bf0e959 100644 --- a/generator.c +++ b/generator.c @@ -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 presmissions then act as though the remote end sent 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)) { @@ -234,7 +234,7 @@ void recv_generator(char *fname,struct file_list *flist,int i,int f_out) l = readlink(fname,lnk,MAXPATHLEN-1); if (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); return; } -- 2.34.1