Beispiel #1
0
static INT64_T do_xattr_set(int argc, char **argv)
{
	char full_path[CHIRP_PATH_MAX];
	complete_remote_path(argv[1], full_path);
	INT64_T size;

	if(argc == 3) {
		if((size = chirp_reli_removexattr(current_host, full_path, argv[2], stoptime)) >= 0) {
			return 0;
		} else {
			return -1;
		}
	} else {
		if((size = chirp_reli_setxattr(current_host, full_path, argv[2], argv[3], strlen(argv[3]), 0, stoptime)) >= 0) {
			return 0;
		} else {
			return -1;
		}
	}
}
Beispiel #2
0
INT64_T chirp_global_setxattr(const char *host, const char *path, const char *name, const void *data, size_t size, int flags, time_t stoptime)
{
	if(is_multi_path(host)) {
		errno = EACCES;
		return -1;
	} else if(not_empty(path)) {
		return chirp_reli_setxattr(host, path, name, data, size, flags, stoptime);
	} else if(not_empty(host)) {
		if(server_lookup(host, stoptime)) {
			errno = EACCES;
			return -1;
		} else {
			errno = ENOENT;
			return -1;
		}
	} else {
		errno = EACCES;
		return -1;
	}
}