Beispiel #1
0
int onefs_close(vfs_handle_struct *handle, struct files_struct *fsp)
{
	int ret2, ret = 0;

	if (fsp->base_fsp) {
		ret = SMB_VFS_NEXT_CLOSE(handle, fsp->base_fsp);
	}
	ret2 = SMB_VFS_NEXT_CLOSE(handle, fsp);

	return ret ? ret : ret2;
}
Beispiel #2
0
static int vfsx_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
	int result = -1;
	int count;
	char buf[VFSX_MSG_OUT_SIZE];

	count = snprintf(buf, VFSX_MSG_OUT_SIZE, "close:%s:%s:%s", fsp->conn->user, fsp->conn->origpath, fsp->fsp_name);
	if (vfsx_execute(buf, count) == VFSX_SUCCESS_TRANSPARENT) {
		result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
	}
	return result;
}
Beispiel #3
0
static int audit_close(vfs_handle_struct *handle, files_struct *fsp)
{
	int result;

	result = SMB_VFS_NEXT_CLOSE(handle, fsp);

	syslog(audit_syslog_priority(handle), "close fd %d %s%s\n",
	       fsp->fh->fd,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");

	return result;
}
static int greyhole_close(vfs_handle_struct *handle, files_struct *fsp)
{
	int result;

	result = SMB_VFS_NEXT_CLOSE(handle, fsp);

	if (result >= 0) {
		gh_spoolf("close\n%s\n%d\n\n",
			lp_servicename(talloc_tos(), handle->conn->params->service),
			fsp->fh->fd);
	}

	return result;
}
Beispiel #5
0
/* close needs to be handled specially */
static int syncops_close(vfs_handle_struct *handle, files_struct *fsp)
{
	struct syncops_config_data *config;

	SMB_VFS_HANDLE_GET_DATA(handle, config,
				struct syncops_config_data,
				return -1);

	if (fsp->can_write && config->onclose) {
		/* ideally we'd only do this if we have written some
		 data, but there is no flag for that in fsp yet. */
		fsync(fsp->fh->fd);
	}
	return SMB_VFS_NEXT_CLOSE(handle, fsp);
}
Beispiel #6
0
static int audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
	int result;
	
	result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd);

	syslog(audit_syslog_priority(handle), "close fd %d %s%s\n",
	       fd,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : "");
	DEBUG(2, ("vfs_extd_audit: close fd %d %s %s\n",
	       fd,
	       (result < 0) ? "failed: " : "",
	       (result < 0) ? strerror(errno) : ""));

	return result;
}
static int greyhole_close(vfs_handle_struct *handle, files_struct *fsp)
{
	int result;
	FILE *spoolf;
	char filename[38];
	struct timeval tp;

	result = SMB_VFS_NEXT_CLOSE(handle, fsp);

	if (result >= 0) {
		gettimeofday(&tp, (struct timezone *) NULL);
		snprintf(filename, 37, "/var/spool/greyhole/%.0f", ((double) (tp.tv_sec)*1000000.0) + (((double) tp.tv_usec)));
		spoolf = fopen(filename, "wt");
		fprintf(spoolf, "close\n%s\n%d\n\n",
			lp_servicename(handle->conn->params->service),
			fsp->fh->fd);
		fclose(spoolf);
	}

	return result;
}
Beispiel #8
0
static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
{
	return SMB_VFS_NEXT_CLOSE(handle, fsp);
}
static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
{
	return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
}