예제 #1
0
static int do_to_server(struct asfd *asfd,
	struct conf *conf, FF_PKT *ff, struct sbuf *sb,
	char cmd, int compression) 
{
	sb->compression=compression;
	sb->statp=ff->statp;
	attribs_encode(sb);

#ifdef HAVE_WIN32
	if(conf->split_vss && !conf->strip_vss
	  && maybe_send_extrameta(asfd, ff->fname, cmd, sb, conf, metasymbol))
		return -1;
#endif

	if(usual_stuff(asfd, conf, ff->fname, ff->link, sb, cmd)) return -1;

	if(ff->type==FT_REG)
		cntr_add_val(conf->cntr, CMD_BYTES_ESTIMATED,
			(unsigned long long)ff->statp.st_size, 0);
#ifdef HAVE_WIN32
	if(conf->split_vss && !conf->strip_vss
	// FIX THIS: May have to check that it is not a directory here.
	  && !S_ISDIR(sb->statp.st_mode) // does this work?
	  && maybe_send_extrameta(asfd,
		ff->fname, cmd, sb, conf, vss_trail_symbol))
			return -1;
	return 0;
#else
	return maybe_send_extrameta(asfd, ff->fname, cmd, sb, conf, metasymbol);
#endif
}
예제 #2
0
파일: backup_phase1.c 프로젝트: grke/burp
static int maybe_send_extrameta(struct asfd *asfd,
	const char *path, enum cmd cmd,
	struct sbuf *sb,
	struct cntr *cntr, enum cmd symbol)
{
	// FIX THIS: should probably initialise extrameta with the desired
	// conf parameters so that they do not need to be passed in all the
	// time.
	if(!has_extrameta(path, cmd, enable_acl, enable_xattr))
		return 0;
	return usual_stuff(asfd, cntr, path, NULL, sb, symbol);
}
예제 #3
0
파일: backup_phase1.c 프로젝트: grke/burp
static int do_to_server(struct asfd *asfd,
	struct conf **confs, struct FF_PKT *ff, struct sbuf *sb,
	enum cmd cmd, int compression)
{
#ifdef HAVE_WIN32
	int split_vss=0;
	int strip_vss=0;
	if(get_protocol(confs)==PROTO_1)
	{
		split_vss=get_int(confs[OPT_SPLIT_VSS]);
		strip_vss=get_int(confs[OPT_STRIP_VSS]);
	}
#endif
	struct cntr *cntr=get_cntr(confs);
	sb->compression=compression;
	sb->encryption=encryption;
	sb->statp=ff->statp;
	attribs_encode(sb);

#ifdef HAVE_WIN32
	if(split_vss
	  && !strip_vss
	  && cmd!=CMD_EFS_FILE
	  && maybe_send_extrameta(asfd, ff->fname,
		cmd, sb, cntr, metasymbol))
			return -1;
#endif

	if(usual_stuff(asfd, cntr, ff->fname, ff->link, sb, cmd)) return -1;

	if(ff->type==FT_REG)
		cntr_add_val(cntr, CMD_BYTES_ESTIMATED,
			(uint64_t)ff->statp.st_size);
#ifdef HAVE_WIN32
	if(split_vss
	  && !strip_vss
	  && cmd!=CMD_EFS_FILE
	// FIX THIS: May have to check that it is not a directory here.
	  && !S_ISDIR(sb->statp.st_mode) // does this work?
	  && maybe_send_extrameta(asfd,
		ff->fname, cmd, sb, cntr, vss_trail_symbol))
			return -1;
	return 0;
#else
	return maybe_send_extrameta(asfd, ff->fname, cmd, sb,
		cntr, metasymbol);
#endif
}
예제 #4
0
static int maybe_send_extrameta(struct asfd *asfd, const char *path, char cmd,
	struct sbuf *sb, struct conf *conf, int symbol)
{
	if(!has_extrameta(path, cmd, conf)) return 0;
	return usual_stuff(asfd, conf, path, NULL, sb, symbol);
}