[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Fri Jan 17 17:15:02 UTC 2020


The branch, master has been updated
       via  c9adf47ac5a vfs_glusterfs: Return fake fd from pipe() during open
      from  6c7b722b3fa fuzz_oLschema2ldif: check multiple possible NULLs

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c9adf47ac5a5aa0dd12572c34b08cc51f15b2e97
Author: Anoop C S <anoopcs at redhat.com>
Date:   Wed Aug 14 18:03:01 2019 +0530

    vfs_glusterfs: Return fake fd from pipe() during open
    
    GlusterFS currently doesn't have an API implementation to set flags on
    open file descriptor. Thus we use pipe() to provide valid file descriptor
    from the system.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14241
    
    Signed-off-by: Anoop C S <anoopcs at redhat.com>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri Jan 17 17:14:43 UTC 2020 on sn-devel-184

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_glusterfs.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index bce7ae5e84a..2520382c42f 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -630,6 +630,7 @@ static int vfs_gluster_open(struct vfs_handle_struct *handle,
 {
 	glfs_fd_t *glfd;
 	glfs_fd_t **p_tmp;
+	int fakefd[2];
 
 	START_PROFILE(syscall_open);
 
@@ -659,8 +660,15 @@ static int vfs_gluster_open(struct vfs_handle_struct *handle,
 	*p_tmp = glfd;
 
 	END_PROFILE(syscall_open);
-	/* An arbitrary value for error reporting, so you know its us. */
-	return 13371337;
+
+	if (pipe(fakefd) == -1) {
+		DBG_ERR("pipe failed: %s\n", strerror(errno));
+		return -1;
+	}
+
+	close(fakefd[1]);
+
+	return fakefd[0];
 }
 
 static int vfs_gluster_close(struct vfs_handle_struct *handle,
@@ -678,6 +686,8 @@ static int vfs_gluster_close(struct vfs_handle_struct *handle,
 		return -1;
 	}
 
+	close(fsp->fh->fd);
+
 	VFS_REMOVE_FSP_EXTENSION(handle, fsp);
 
 	ret = glfs_close(glfd);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list