Пример #1
0
static void tear_down(FF_PKT **ff, struct conf ***confs)
{
	fail_unless(e==NULL);
	find_files_free(ff);
	confs_free(confs);
	strlists_free(&expected);
	fail_unless(recursive_delete(BASE)==0);
	alloc_check();
}
Пример #2
0
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;
}
Пример #3
0
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;
}