- Restored the io_error test to delete_files().
authorWayne Davison <wayned@samba.org>
Sun, 30 Jan 2005 07:35:13 +0000 (07:35 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 30 Jan 2005 07:35:13 +0000 (07:35 +0000)
- Sanity check the dir_list value from send_file_list().

receiver.c

index 9d1007f..e129b1d 100644 (file)
@@ -57,17 +57,24 @@ extern struct filter_list_struct server_filter_list;
 void delete_files(struct file_list *flist)
 {
        struct file_list *dir_list;
 void delete_files(struct file_list *flist)
 {
        struct file_list *dir_list;
-       char fbuf[MAXPATHLEN];
-       char *argv[1];
+       char *argv[1], fbuf[MAXPATHLEN];
        int j;
 
        int j;
 
+       if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) {
+               rprintf(FINFO,
+                       "IO error encountered - skipping file deletion\n");
+               return;
+       }
+
        for (j = 0; j < flist->count; j++) {
                if (!(flist->files[j]->flags & FLAG_DEL_START)
                    || !S_ISDIR(flist->files[j]->mode))
                        continue;
 
                argv[0] = f_name_to(flist->files[j], fbuf);
        for (j = 0; j < flist->count; j++) {
                if (!(flist->files[j]->flags & FLAG_DEL_START)
                    || !S_ISDIR(flist->files[j]->mode))
                        continue;
 
                argv[0] = f_name_to(flist->files[j], fbuf);
-               dir_list = send_file_list(-1, 1, argv);
+
+               if (!(dir_list = send_file_list(-1, 1, argv)))
+                       continue;
 
                delete_missing(flist, dir_list, fbuf);
 
 
                delete_missing(flist, dir_list, fbuf);