rprintf(FERROR,"rmdir(%s) : %s\n", fname, strerror(errno));
return -1;
}
rprintf(FERROR,"rmdir(%s) : %s\n", fname, strerror(errno));
return -1;
}
write_int(f_out,s->sums[i].sum1);
write_buf(f_out,s->sums[i].sum2,csum_length);
}
write_int(f_out,s->sums[i].sum1);
write_buf(f_out,s->sums[i].sum2,csum_length);
}
- if ((am_root && preserve_uid && st->st_uid != file->uid) ||
- (preserve_gid && st->st_gid != file->gid)) {
+ if ((am_root || !am_daemon) &&
+ ((am_root && preserve_uid && st->st_uid != file->uid) ||
+ (preserve_gid && st->st_gid != file->gid))) {
if (do_lchown(fname,
(am_root&&preserve_uid)?file->uid:-1,
preserve_gid?file->gid:-1) != 0) {
if (do_lchown(fname,
(am_root&&preserve_uid)?file->uid:-1,
preserve_gid?file->gid:-1) != 0) {
- if (!delete_list) {
- delete_list = (struct delete_list *)malloc(sizeof(delete_list[0])*dlist_alloc_len);
- } else {
- delete_list = (struct delete_list *)realloc(delete_list, sizeof(delete_list[0])*dlist_alloc_len);
- }
+ delete_list = (struct delete_list *)Realloc(delete_list, sizeof(delete_list[0])*dlist_alloc_len);
add_delete_entry(local_file_list->files[i]);
if (-1 == flist_find(flist,local_file_list->files[i])) {
delete_one(local_file_list->files[i]);
add_delete_entry(local_file_list->files[i]);
if (-1 == flist_find(flist,local_file_list->files[i])) {
delete_one(local_file_list->files[i]);
if (cleanup_fname)
do_unlink(cleanup_fname);
signal(SIGUSR1, SIG_IGN);
if (cleanup_fname)
do_unlink(cleanup_fname);
signal(SIGUSR1, SIG_IGN);
/* now we need to fix any directory permissions that were
modified during the transfer */
for (i = 0; i < flist->count; i++) {
/* now we need to fix any directory permissions that were
modified during the transfer */
for (i = 0; i < flist->count; i++) {
if (!file->basename || !S_ISDIR(file->mode)) continue;
recv_generator(f_name(file),flist,i,-1);
}
if (!file->basename || !S_ISDIR(file->mode)) continue;
recv_generator(f_name(file),flist,i,-1);
}
printf("%s\n",fname+offset);
match_sums(f_out,s,buf,st.st_size);
printf("%s\n",fname+offset);
match_sums(f_out,s,buf,st.st_size);
/* we expect to just sit around now, so don't exit on a timeout. If we
really get a timeout then the other process should exit */
/* we expect to just sit around now, so don't exit on a timeout. If we
really get a timeout then the other process should exit */