static FF_PKT *setup(struct conf ***confs) { FF_PKT *ff; fail_unless(!recursive_delete(BASE)); // Create the root directory, so that we can figure out the absolute // path to it, then delete it so that the root directory can be // included when setting up the expected file system. fail_unless(!mkdir(BASE, 0777)); fail_unless(realpath(BASE, fullpath)!=NULL); fail_unless(!recursive_delete(BASE)); fail_unless((ff=find_files_init(send_file_callback))!=NULL); *confs=setup_conf(); return ff; }
int backup_phase1_client(struct asfd *asfd, struct conf **confs) { int ret=-1; struct FF_PKT *ff=NULL; struct strlist *l=NULL; enable_acl=get_int(confs[OPT_ACL]); enable_xattr=get_int(confs[OPT_XATTR]); // First, tell the server about everything that needs to be backed up. logp("Phase 1 begin (file system scan)\n"); // Encryption not yet supported in protocol2. if(get_protocol(confs)==PROTO_1 && get_string(confs[OPT_ENCRYPTION_PASSWORD])) { encryption=ENCRYPTION_KEY_DERIVED; filesymbol=CMD_ENC_FILE; metasymbol=CMD_ENC_METADATA; #ifdef HAVE_WIN32 metasymbol=CMD_ENC_VSS; vss_trail_symbol=CMD_ENC_VSS_T; #endif } #ifdef HAVE_WIN32 dirsymbol=filesymbol; if(get_protocol(confs)==PROTO_1 && get_int(confs[OPT_STRIP_VSS])) dirsymbol=CMD_DIRECTORY; #endif if(!(ff=find_files_init(my_send_file))) goto end; for(l=get_strlist(confs[OPT_STARTDIR]); l; l=l->next) if(l->flag) if(find_files_begin(asfd, ff, confs, l->path)) goto end; ret=0; end: cntr_print_end_phase1(get_cntr(confs)); if(ret) logp("Error in phase 1\n"); logp("Phase 1 end (file system scan)\n"); find_files_free(&ff); return ret; }
int backup_phase1_client(struct asfd *asfd, struct conf *conf, int estimate) { int ret=-1; FF_PKT *ff=NULL; struct strlist *l=NULL; // First, tell the server about everything that needs to be backed up. logp("Phase 1 begin (file system scan)\n"); // Encryption not yet supported in burp2. if(conf->protocol==PROTO_BURP1 && conf->encryption_password) { filesymbol=CMD_ENC_FILE; metasymbol=CMD_ENC_METADATA; #ifdef HAVE_WIN32 metasymbol=CMD_ENC_VSS; vss_trail_symbol=CMD_ENC_VSS_T; #endif } #ifdef HAVE_WIN32 dirsymbol=filesymbol; #endif if(!(ff=find_files_init())) goto end; for(l=conf->startdir; l; l=l->next) if(l->flag) if(find_files_begin(asfd, ff, conf, l->path)) goto end; ret=0; end: cntr_print_end_phase1(conf->cntr); if(ret) logp("Error in phase 1\n"); logp("Phase 1 end (file system scan)\n"); find_files_free(ff); return ret; }