Commit | Line | Data |
---|---|---|
e327acec | 1 | /* -*- c-file-style: "linux" -*- |
17fadf7d | 2 | |
e327acec | 3 | Copyright (C) 1996-2000 by Andrew Tridgell |
2f03f956 | 4 | Copyright (C) Paul Mackerras 1996 |
17fadf7d | 5 | |
2f03f956 AT |
6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
17fadf7d | 10 | |
2f03f956 AT |
11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
17fadf7d | 15 | |
2f03f956 AT |
16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | */ | |
20 | ||
21 | #include "rsync.h" | |
22 | ||
23 | extern int verbose; | |
24 | extern int recurse; | |
25 | extern int delete_mode; | |
2f03f956 AT |
26 | extern int csum_length; |
27 | extern struct stats stats; | |
28 | extern int dry_run; | |
29 | extern int am_server; | |
30 | extern int relative_paths; | |
31 | extern int preserve_hard_links; | |
32 | extern int cvs_exclude; | |
33 | extern int io_error; | |
34 | extern char *tmpdir; | |
375a4556 | 35 | extern char *compare_dest; |
53dd3135 | 36 | extern int make_backups; |
16417f8b | 37 | extern int do_progress; |
d74a2e3e | 38 | extern char *backup_dir; |
53dd3135 | 39 | extern char *backup_suffix; |
d74a2e3e | 40 | extern int backup_suffix_len; |
925c517f | 41 | extern int cleanup_got_literal; |
2f03f956 | 42 | |
d74a2e3e | 43 | static void delete_one(char *fn, int is_dir) |
2f03f956 | 44 | { |
d74a2e3e WD |
45 | if (!is_dir) { |
46 | if (robust_unlink(fn) != 0) { | |
ea42541f WD |
47 | rprintf(FERROR, "delete_one: unlink %s failed: %s\n", |
48 | full_fname(fn), strerror(errno)); | |
2f03f956 | 49 | } else if (verbose) { |
d74a2e3e | 50 | rprintf(FINFO, "deleting %s\n", fn); |
2f03f956 | 51 | } |
17fadf7d | 52 | } else { |
d74a2e3e WD |
53 | if (do_rmdir(fn) != 0) { |
54 | if (errno != ENOTEMPTY && errno != EEXIST) { | |
ea42541f | 55 | rprintf(FERROR, "delete_one: rmdir %s failed: %s\n", |
17fadf7d | 56 | full_fname(fn), strerror(errno)); |
d74a2e3e | 57 | } |
2f03f956 | 58 | } else if (verbose) { |
d74a2e3e | 59 | rprintf(FINFO, "deleting directory %s\n", fn); |
2f03f956 AT |
60 | } |
61 | } | |
62 | } | |
63 | ||
64 | ||
d74a2e3e WD |
65 | static int is_backup_file(char *fn) |
66 | { | |
67 | int k = strlen(fn) - backup_suffix_len; | |
68 | return k > 0 && strcmp(fn+k, backup_suffix) == 0; | |
69 | } | |
2f03f956 AT |
70 | |
71 | ||
72 | /* this deletes any files on the receiving side that are not present | |
17fadf7d WD |
73 | * on the sending side. For version 1.6.4 I have changed the behaviour |
74 | * to match more closely what most people seem to expect of this option */ | |
6957ae33 | 75 | void delete_files(struct file_list *flist) |
2f03f956 AT |
76 | { |
77 | struct file_list *local_file_list; | |
78 | int i, j; | |
446e239e | 79 | char *name, fbuf[MAXPATHLEN]; |
cda2ae84 | 80 | extern int module_id; |
ef55c686 | 81 | extern int ignore_errors; |
0b73ca12 AT |
82 | extern int max_delete; |
83 | static int deletion_count; | |
2f03f956 AT |
84 | |
85 | if (cvs_exclude) | |
86 | add_cvs_excludes(); | |
87 | ||
ef55c686 | 88 | if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) { |
2f03f956 AT |
89 | rprintf(FINFO,"IO error encountered - skipping file deletion\n"); |
90 | return; | |
91 | } | |
92 | ||
446e239e | 93 | for (j = 0;j < flist->count; j++) { |
17fadf7d | 94 | if (!S_ISDIR(flist->files[j]->mode) || |
2f03f956 AT |
95 | !(flist->files[j]->flags & FLAG_DELETE)) continue; |
96 | ||
446e239e | 97 | name = f_name_to(flist->files[j], fbuf, sizeof fbuf); |
2f03f956 | 98 | |
446e239e | 99 | if (!(local_file_list = send_file_list(-1,1,&name))) |
2f03f956 | 100 | continue; |
2f03f956 AT |
101 | |
102 | if (verbose > 1) | |
103 | rprintf(FINFO,"deleting in %s\n", name); | |
104 | ||
446e239e | 105 | for (i = local_file_list->count-1; i >= 0; i--) { |
0b73ca12 | 106 | if (max_delete && deletion_count > max_delete) break; |
2f03f956 | 107 | if (!local_file_list->files[i]->basename) continue; |
2f03f956 | 108 | if (-1 == flist_find(flist,local_file_list->files[i])) { |
53dd3135 | 109 | char *f = f_name(local_file_list->files[i]); |
d74a2e3e | 110 | if (make_backups && (backup_dir || !is_backup_file(f))) { |
53dd3135 | 111 | (void) make_backup(f); |
d74a2e3e WD |
112 | if (verbose) |
113 | rprintf(FINFO, "deleting %s\n", f); | |
53dd3135 | 114 | } else { |
d74a2e3e WD |
115 | int mode = local_file_list->files[i]->mode; |
116 | delete_one(f, S_ISDIR(mode) != 0); | |
53dd3135 | 117 | } |
31f3b68a | 118 | deletion_count++; |
53dd3135 | 119 | } |
2f03f956 AT |
120 | } |
121 | flist_free(local_file_list); | |
2f03f956 AT |
122 | } |
123 | } | |
124 | ||
125 | ||
52d3e106 S |
126 | /* |
127 | * get_tmpname() - create a tmp filename for a given filename | |
128 | * | |
129 | * If a tmpdir is defined, use that as the directory to | |
130 | * put it in. Otherwise, the tmp filename is in the same | |
131 | * directory as the given name. Note that there may be no | |
132 | * directory at all in the given name! | |
17fadf7d | 133 | * |
52d3e106 S |
134 | * The tmp filename is basically the given filename with a |
135 | * dot prepended, and .XXXXXX appended (for mkstemp() to | |
136 | * put its unique gunk in). Take care to not exceed | |
137 | * either the MAXPATHLEN or NAME_MAX, esp. the last, as | |
138 | * the basename basically becomes 8 chars longer. In that | |
139 | * case, the original name is shortened sufficiently to | |
140 | * make it all fit. | |
17fadf7d | 141 | * |
52d3e106 S |
142 | * Of course, there's no real reason for the tmp name to |
143 | * look like the original, except to satisfy us humans. | |
144 | * As long as it's unique, rsync will work. | |
145 | */ | |
146 | ||
2f03f956 AT |
147 | static int get_tmpname(char *fnametmp, char *fname) |
148 | { | |
149 | char *f; | |
52d3e106 S |
150 | int length = 0; |
151 | int maxname; | |
2f03f956 | 152 | |
2f03f956 | 153 | if (tmpdir) { |
b7cee949 | 154 | length = strlcpy(fnametmp, tmpdir, MAXPATHLEN - 2); |
52d3e106 S |
155 | fnametmp[length++] = '/'; |
156 | fnametmp[length] = '\0'; /* always NULL terminated */ | |
0c2ef5f4 | 157 | } |
52d3e106 | 158 | |
0c2ef5f4 | 159 | if ((f = strrchr(fname, '/')) != NULL) { |
52d3e106 S |
160 | ++f; |
161 | if (!tmpdir) { | |
162 | length = f - fname; | |
0c2ef5f4 | 163 | /* copy up to and including the slash */ |
52d3e106 | 164 | strlcpy(fnametmp, fname, length + 1); |
0c2ef5f4 | 165 | } |
446e239e | 166 | } else |
52d3e106 | 167 | f = fname; |
52d3e106 S |
168 | fnametmp[length++] = '.'; |
169 | fnametmp[length] = '\0'; /* always NULL terminated */ | |
2f03f956 | 170 | |
52d3e106 | 171 | maxname = MIN(MAXPATHLEN - 7 - length, NAME_MAX - 8); |
2f03f956 | 172 | |
0c2ef5f4 | 173 | if (maxname < 1) { |
52d3e106 S |
174 | rprintf(FERROR, "temporary filename too long: %s\n", fname); |
175 | fnametmp[0] = '\0'; | |
2f03f956 AT |
176 | return 0; |
177 | } | |
178 | ||
17fadf7d | 179 | strlcpy(fnametmp + length, f, maxname); |
52d3e106 | 180 | strcat(fnametmp + length, ".XXXXXX"); |
2f03f956 AT |
181 | |
182 | return 1; | |
183 | } | |
184 | ||
185 | ||
446e239e | 186 | static int receive_data(int f_in,struct map_struct *mapbuf,int fd,char *fname, |
2f03f956 AT |
187 | OFF_T total_size) |
188 | { | |
9dd891bb | 189 | int i; |
fc0257c9 S |
190 | struct sum_struct sum; |
191 | unsigned int len; | |
2f03f956 AT |
192 | OFF_T offset = 0; |
193 | OFF_T offset2; | |
194 | char *data; | |
195 | static char file_sum1[MD4_SUM_LENGTH]; | |
196 | static char file_sum2[MD4_SUM_LENGTH]; | |
197 | char *map=NULL; | |
17fadf7d | 198 | |
fc0257c9 | 199 | read_sum_head(f_in, &sum); |
17fadf7d | 200 | |
2f03f956 | 201 | sum_init(); |
17fadf7d | 202 | |
3f55bd5d | 203 | while ((i = recv_token(f_in, &data)) != 0) { |
16417f8b WD |
204 | if (do_progress) |
205 | show_progress(offset, total_size); | |
2f03f956 AT |
206 | |
207 | if (i > 0) { | |
2f03f956 | 208 | if (verbose > 3) { |
5f808dfb AT |
209 | rprintf(FINFO,"data recv %d at %.0f\n", |
210 | i,(double)offset); | |
2f03f956 AT |
211 | } |
212 | ||
213 | stats.literal_data += i; | |
214 | cleanup_got_literal = 1; | |
17fadf7d | 215 | |
2f03f956 AT |
216 | sum_update(data,i); |
217 | ||
218 | if (fd != -1 && write_file(fd,data,i) != i) { | |
ea42541f WD |
219 | rprintf(FERROR, "write failed on %s: %s\n", |
220 | full_fname(fname), strerror(errno)); | |
65417579 | 221 | exit_cleanup(RERR_FILEIO); |
2f03f956 AT |
222 | } |
223 | offset += i; | |
224 | continue; | |
17fadf7d | 225 | } |
2f03f956 AT |
226 | |
227 | i = -(i+1); | |
fc0257c9 S |
228 | offset2 = i*(OFF_T)sum.blength; |
229 | len = sum.blength; | |
230 | if (i == (int) sum.count-1 && sum.remainder != 0) | |
231 | len = sum.remainder; | |
17fadf7d | 232 | |
2f03f956 | 233 | stats.matched_data += len; |
17fadf7d | 234 | |
2f03f956 | 235 | if (verbose > 3) |
5f808dfb AT |
236 | rprintf(FINFO,"chunk[%d] of size %d at %.0f offset=%.0f\n", |
237 | i,len,(double)offset2,(double)offset); | |
17fadf7d | 238 | |
446e239e WD |
239 | if (mapbuf) { |
240 | map = map_ptr(mapbuf,offset2,len); | |
17fadf7d | 241 | |
c55f7021 AT |
242 | see_token(map, len); |
243 | sum_update(map,len); | |
244 | } | |
17fadf7d | 245 | |
a261989c | 246 | if (fd != -1 && write_file(fd,map,len) != (int) len) { |
ea42541f WD |
247 | rprintf(FERROR, "write failed on %s: %s\n", |
248 | full_fname(fname), strerror(errno)); | |
65417579 | 249 | exit_cleanup(RERR_FILEIO); |
2f03f956 AT |
250 | } |
251 | offset += len; | |
252 | } | |
253 | ||
76c21947 WD |
254 | flush_write_file(fd); |
255 | ||
16417f8b WD |
256 | if (do_progress) |
257 | end_progress(total_size); | |
2f03f956 AT |
258 | |
259 | if (fd != -1 && offset > 0 && sparse_end(fd) != 0) { | |
ea42541f WD |
260 | rprintf(FERROR, "write failed on %s: %s\n", |
261 | full_fname(fname), strerror(errno)); | |
65417579 | 262 | exit_cleanup(RERR_FILEIO); |
2f03f956 AT |
263 | } |
264 | ||
265 | sum_end(file_sum1); | |
266 | ||
bc63ae3f S |
267 | read_buf(f_in,file_sum2,MD4_SUM_LENGTH); |
268 | if (verbose > 2) { | |
269 | rprintf(FINFO,"got file_sum\n"); | |
270 | } | |
17fadf7d | 271 | if (fd != -1 && memcmp(file_sum1,file_sum2,MD4_SUM_LENGTH) != 0) { |
bc63ae3f | 272 | return 0; |
2f03f956 AT |
273 | } |
274 | return 1; | |
275 | } | |
276 | ||
277 | ||
b35d0d8e MP |
278 | /** |
279 | * main routine for receiver process. | |
280 | * | |
281 | * Receiver process runs on the same host as the generator process. */ | |
0569a133 | 282 | int recv_files(int f_in,struct file_list *flist,char *local_name) |
17fadf7d | 283 | { |
2f03f956 AT |
284 | int fd1,fd2; |
285 | STRUCT_STAT st; | |
446e239e | 286 | char *fname, fbuf[MAXPATHLEN]; |
f62c17e3 | 287 | char template[MAXPATHLEN]; |
2f03f956 | 288 | char fnametmp[MAXPATHLEN]; |
375a4556 DD |
289 | char *fnamecmp; |
290 | char fnamecmpbuf[MAXPATHLEN]; | |
446e239e | 291 | struct map_struct *mapbuf; |
2f03f956 AT |
292 | int i; |
293 | struct file_struct *file; | |
294 | int phase=0; | |
295 | int recv_ok; | |
17fadf7d | 296 | extern struct stats stats; |
4df9f368 | 297 | extern int preserve_perms; |
57df171b | 298 | extern int delete_after; |
b35d0d8e | 299 | extern int orig_umask; |
1b7c47cb | 300 | struct stats initial_stats; |
11a5a3c7 | 301 | |
2f03f956 AT |
302 | if (verbose > 2) { |
303 | rprintf(FINFO,"recv_files(%d) starting\n",flist->count); | |
304 | } | |
305 | ||
17fadf7d | 306 | while (1) { |
2f03f956 AT |
307 | cleanup_disable(); |
308 | ||
309 | i = read_int(f_in); | |
310 | if (i == -1) { | |
97feb557 | 311 | if (phase == 0) { |
2f03f956 AT |
312 | phase++; |
313 | csum_length = SUM_LENGTH; | |
314 | if (verbose > 2) | |
315 | rprintf(FINFO,"recv_files phase=%d\n",phase); | |
0569a133 | 316 | send_msg(MSG_DONE, "", 0); |
2f03f956 AT |
317 | continue; |
318 | } | |
319 | break; | |
320 | } | |
321 | ||
322 | if (i < 0 || i >= flist->count) { | |
17fadf7d | 323 | rprintf(FERROR,"Invalid file index %d in recv_files (count=%d)\n", |
2f03f956 | 324 | i, flist->count); |
65417579 | 325 | exit_cleanup(RERR_PROTOCOL); |
2f03f956 AT |
326 | } |
327 | ||
328 | file = flist->files[i]; | |
2f03f956 | 329 | |
97feb557 | 330 | stats.current_file_index = i; |
2f03f956 AT |
331 | stats.num_transferred_files++; |
332 | stats.total_transferred_size += file->length; | |
925c517f | 333 | cleanup_got_literal = 0; |
2f03f956 AT |
334 | |
335 | if (local_name) | |
336 | fname = local_name; | |
446e239e WD |
337 | else |
338 | fname = f_name_to(file, fbuf, sizeof fbuf); | |
2f03f956 AT |
339 | |
340 | if (dry_run) { | |
42d4edc0 S |
341 | if (!am_server && verbose) { /* log transfer */ |
342 | rprintf(FINFO, "%s\n", fname); | |
11a5a3c7 | 343 | } |
2f03f956 AT |
344 | continue; |
345 | } | |
346 | ||
1b7c47cb AT |
347 | initial_stats = stats; |
348 | ||
2f03f956 AT |
349 | if (verbose > 2) |
350 | rprintf(FINFO,"recv_files(%s)\n",fname); | |
351 | ||
375a4556 DD |
352 | fnamecmp = fname; |
353 | ||
17fadf7d | 354 | /* open the file */ |
8c9fd200 | 355 | fd1 = do_open(fnamecmp, O_RDONLY, 0); |
375a4556 DD |
356 | |
357 | if ((fd1 == -1) && (compare_dest != NULL)) { | |
358 | /* try the file at compare_dest instead */ | |
8950ac03 | 359 | snprintf(fnamecmpbuf,MAXPATHLEN,"%s/%s", |
375a4556 DD |
360 | compare_dest,fname); |
361 | fnamecmp = fnamecmpbuf; | |
8c9fd200 | 362 | fd1 = do_open(fnamecmp, O_RDONLY, 0); |
375a4556 | 363 | } |
2f03f956 AT |
364 | |
365 | if (fd1 != -1 && do_fstat(fd1,&st) != 0) { | |
ea42541f WD |
366 | rprintf(FERROR, "fstat %s failed: %s\n", |
367 | full_fname(fnamecmp), strerror(errno)); | |
2f03f956 AT |
368 | receive_data(f_in,NULL,-1,NULL,file->length); |
369 | close(fd1); | |
370 | continue; | |
371 | } | |
372 | ||
350e4e4d S |
373 | if (fd1 != -1 && S_ISDIR(st.st_mode) && fnamecmp == fname) { |
374 | /* this special handling for directories | |
375 | * wouldn't be necessary if robust_rename() | |
376 | * and the underlying robust_unlink could cope | |
377 | * with directories | |
378 | */ | |
ea42541f WD |
379 | rprintf(FERROR,"recv_files: %s is a directory\n", |
380 | full_fname(fnamecmp)); | |
350e4e4d | 381 | receive_data(f_in, NULL, -1, NULL, file->length); |
2f03f956 AT |
382 | close(fd1); |
383 | continue; | |
384 | } | |
385 | ||
350e4e4d S |
386 | if (fd1 != -1 && !S_ISREG(st.st_mode)) { |
387 | close(fd1); | |
388 | fd1 = -1; | |
446e239e | 389 | mapbuf = NULL; |
350e4e4d S |
390 | } |
391 | ||
4df9f368 | 392 | if (fd1 != -1 && !preserve_perms) { |
85ed0aa3 | 393 | /* if the file exists already and we aren't preserving |
17fadf7d WD |
394 | * permissions then act as though the remote end sent |
395 | * us the file permissions we already have */ | |
4df9f368 AT |
396 | file->mode = st.st_mode; |
397 | } | |
398 | ||
2f03f956 | 399 | if (fd1 != -1 && st.st_size > 0) { |
446e239e | 400 | mapbuf = map_file(fd1,st.st_size); |
2f03f956 | 401 | if (verbose > 2) |
5f808dfb | 402 | rprintf(FINFO,"recv mapped %s of size %.0f\n",fnamecmp,(double)st.st_size); |
446e239e WD |
403 | } else |
404 | mapbuf = NULL; | |
2f03f956 AT |
405 | |
406 | if (!get_tmpname(fnametmp,fname)) { | |
446e239e | 407 | if (mapbuf) unmap_file(mapbuf); |
2f03f956 AT |
408 | if (fd1 != -1) close(fd1); |
409 | continue; | |
410 | } | |
411 | ||
f62c17e3 | 412 | strlcpy(template, fnametmp, sizeof(template)); |
2f03f956 AT |
413 | |
414 | /* we initially set the perms without the | |
17fadf7d WD |
415 | * setuid/setgid bits to ensure that there is no race |
416 | * condition. They are then correctly updated after | |
417 | * the lchown. Thanks to snabb@epipe.fi for pointing | |
418 | * this out. We also set it initially without group | |
419 | * access because of a similar race condition. */ | |
f62c17e3 | 420 | fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS); |
2f03f956 | 421 | |
752eaba4 | 422 | /* in most cases parent directories will already exist |
17fadf7d WD |
423 | * because their information should have been previously |
424 | * transferred, but that may not be the case with -R */ | |
425 | if (fd2 == -1 && relative_paths && errno == ENOENT && | |
b35d0d8e | 426 | create_directory_path(fnametmp, orig_umask) == 0) { |
f62c17e3 AT |
427 | strlcpy(fnametmp, template, sizeof(fnametmp)); |
428 | fd2 = do_mkstemp(fnametmp, file->mode & INITACCESSPERMS); | |
2f03f956 AT |
429 | } |
430 | if (fd2 == -1) { | |
ea42541f WD |
431 | rprintf(FERROR, "mkstemp %s failed: %s\n", |
432 | full_fname(fnametmp), strerror(errno)); | |
446e239e WD |
433 | receive_data(f_in,mapbuf,-1,NULL,file->length); |
434 | if (mapbuf) unmap_file(mapbuf); | |
2f03f956 AT |
435 | if (fd1 != -1) close(fd1); |
436 | continue; | |
437 | } | |
17fadf7d | 438 | |
446e239e | 439 | cleanup_set(fnametmp, fname, file, mapbuf, fd1, fd2); |
2f03f956 | 440 | |
42d4edc0 S |
441 | if (!am_server && verbose) { /* log transfer */ |
442 | rprintf(FINFO, "%s\n", fname); | |
11a5a3c7 AT |
443 | } |
444 | ||
2f03f956 | 445 | /* recv file data */ |
446e239e | 446 | recv_ok = receive_data(f_in,mapbuf,fd2,fname,file->length); |
1b7c47cb AT |
447 | |
448 | log_recv(file, &initial_stats); | |
17fadf7d | 449 | |
446e239e | 450 | if (mapbuf) unmap_file(mapbuf); |
2f03f956 AT |
451 | if (fd1 != -1) { |
452 | close(fd1); | |
453 | } | |
454 | close(fd2); | |
17fadf7d | 455 | |
2f03f956 AT |
456 | if (verbose > 2) |
457 | rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname); | |
458 | ||
459 | finish_transfer(fname, fnametmp, file); | |
c6b81a98 | 460 | |
2f03f956 | 461 | cleanup_disable(); |
554e0a8d | 462 | |
2f03f956 AT |
463 | if (!recv_ok) { |
464 | if (csum_length == SUM_LENGTH) { | |
465 | rprintf(FERROR,"ERROR: file corruption in %s. File changed during transfer?\n", | |
ea42541f | 466 | full_fname(fname)); |
2f03f956 | 467 | } else { |
0569a133 | 468 | char buf[4]; |
2f03f956 AT |
469 | if (verbose > 1) |
470 | rprintf(FINFO,"redoing %s(%d)\n",fname,i); | |
0569a133 WD |
471 | SIVAL(buf, 0, i); |
472 | send_msg(MSG_REDO, buf, 4); | |
2f03f956 AT |
473 | } |
474 | } | |
475 | } | |
476 | ||
3f55bd5d WD |
477 | if (delete_after && recurse && delete_mode && !local_name |
478 | && flist->count > 0) | |
479 | delete_files(flist); | |
57df171b | 480 | |
2f03f956 | 481 | if (preserve_hard_links) |
fae5bb31 | 482 | do_hard_links(); |
2f03f956 | 483 | |
17fadf7d WD |
484 | /* now we need to fix any directory permissions that were |
485 | * modified during the transfer */ | |
2f03f956 AT |
486 | for (i = 0; i < flist->count; i++) { |
487 | file = flist->files[i]; | |
488 | if (!file->basename || !S_ISDIR(file->mode)) continue; | |
446e239e | 489 | recv_generator(local_name? local_name |
25bfc8ce | 490 | : f_name_to(file,fbuf,sizeof fbuf), file, i, -1); |
2f03f956 AT |
491 | } |
492 | ||
493 | if (verbose > 2) | |
494 | rprintf(FINFO,"recv_files finished\n"); | |
17fadf7d | 495 | |
2f03f956 AT |
496 | return 0; |
497 | } |