fixed a bug in the flist sending code that caused the flist sending to
authorAndrew Tridgell <tridge@samba.org>
Fri, 29 May 1998 02:28:33 +0000 (02:28 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 29 May 1998 02:28:33 +0000 (02:28 +0000)
get out of sync.

flist.c
io.c

diff --git a/flist.c b/flist.c
index 5b6dc60..179e7e7 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -169,6 +169,11 @@ void send_file_entry(struct file_struct *file,int f,unsigned base_flags)
   if (l1 > 0) flags |= SAME_NAME;
   if (l2 > 255) flags |= LONG_NAME;
 
+  /* we must make sure we don't send a zero flags byte or the other
+     end will terminate the flist transfer */
+  if (flags == 0 && !S_ISDIR(file->mode)) flags |= FLAG_DELETE;
+  if (flags == 0) flags |= LONG_NAME;
+
   write_byte(f,flags);  
   if (flags & SAME_NAME)
     write_byte(f,l1);
diff --git a/io.c b/io.c
index 8eb62c3..85ff742 100644 (file)
--- a/io.c
+++ b/io.c
@@ -145,7 +145,7 @@ static void read_loop(int fd, char *buf, int len)
        }
 }
 
-/* read from the file descriptor handing multiplexing - 
+/* read from the file descriptor handling multiplexing - 
    return number of bytes read
    never return <= 0 */
 static int read_unbuffered(int fd, char *buf, int len)