Ejemplo n.º 1
0
int has_extrameta(const char *path, enum cmd cmd, struct conf **confs)
{
#if defined(WIN32_VSS)
	return 1;
#endif
#if defined(HAVE_LINUX_OS) || \
    defined(HAVE_FREEBSD_OS) || \
    defined(HAVE_OPENBSD_OS) || \
    defined(HAVE_NETBSD_OS)

	// FIX THIS: extra meta not supported in protocol2.
	if(get_e_protocol(confs[OPT_PROTOCOL])==PROTO_2) return 0;

#ifdef HAVE_ACL
	if(has_acl(path, cmd)) return 1;
#endif
#endif
#if defined(HAVE_LINUX_OS) || \
    defined(HAVE_FREEBSD_OS) || \
    defined(HAVE_OPENBSD_OS) || \
    defined(HAVE_NETBSD_OS)
#ifdef HAVE_XATTR
	if(has_xattr(path, cmd)) return 1;
#endif
#endif
        return 0;
}
Ejemplo n.º 2
0
static void test_xattr(struct xattrdata x)
{
	size_t rlen=0;
	char metasymbol=META_XATTR;
	char *retrieved=NULL;
	const char *path=NULL;
	const char *myfile=BASE "/myfile";
	char expected[256];

	fail_unless(recursive_delete(BASE)==0);
	build_file(myfile, NULL);

	if(x.do_dir) path=BASE;
	else path=myfile;

#if defined(HAVE_FREEBSD_OS) || \
    defined(HAVE_NETBSD_OS)
	metasymbol=META_XATTR_BSD;
#endif
#if defined(HAVE_LINUX_OS) || \
    defined(HAVE_DARWIN_OS)
	metasymbol=META_XATTR;
#endif
	snprintf(expected, sizeof(expected), "%s", x.expected_read);
	expected[0]=metasymbol;

	fail_unless(has_xattr(path)==0);
	fail_unless(!set_xattr(
		NULL, // asfd
		path,
		x.write,
		strlen(x.write),
		metasymbol,
		NULL // cntr
	));
	fail_unless(!get_xattr(
		NULL, // asfd
		path,
		&retrieved,
		&rlen,
		NULL // cntr
	));
	fail_unless(rlen==strlen(expected));

	assert_xattr(expected, retrieved, rlen);

	free_w(&retrieved);
	tear_down();
}
Ejemplo n.º 3
0
int has_extrameta(const char *path, char cmd)
{
#if defined(HAVE_LINUX_OS) || \
    defined(HAVE_FREEBSD_OS) || \
    defined(HAVE_OPENBSD_OS) || \
    defined(HAVE_NETBSD_OS)
#ifdef HAVE_ACL
	if(has_acl(path, cmd)) return 1;
#endif
#endif
#if defined(HAVE_LINUX_OS) || \
    defined(HAVE_FREEBSD_OS) || \
    defined(HAVE_OPENBSD_OS) || \
    defined(HAVE_NETBSD_OS)
#ifdef HAVE_XATTR
	if(has_xattr(path, cmd)) return 1;
#endif
#endif
        return 0;
}