If the generator sends us the index of a directory, generate an
authorWayne Davison <wayned@samba.org>
Wed, 2 Feb 2005 17:15:22 +0000 (17:15 +0000)
committerWayne Davison <wayned@samba.org>
Wed, 2 Feb 2005 17:15:22 +0000 (17:15 +0000)
error and die.

sender.c

index a964e08..1cf4365 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -145,6 +145,11 @@ void send_files(struct file_list *flist, int f_out, int f_in)
                        updating_basis_file = inplace && !make_backups;
 
                file = flist->files[i];
+               if (S_ISDIR(file->mode)) {
+                       rprintf(FERROR, "[%s] got index of directory: %d\n",
+                               who_am_i(), i);
+                       exit_cleanup(RERR_PROTOCOL);
+               }
 
                stats.current_file_index = i;
                stats.num_transferred_files++;