[PATCH] Samba3: bug in vfstest

Rainer Link link at unfug.org
Thu Jul 21 12:08:14 GMT 2005


Hi,

vfstest (as of Samba 3.0.20pre2) crashes during the "open" operation.
The following patch fixes this at least for me :-) 

Thanks.

cheers, Rainer


Index: source/torture/cmd_vfs.c
===================================================================
--- source/torture/cmd_vfs.c	(revision 8677)
+++ source/torture/cmd_vfs.c	(working copy)
@@ -203,6 +203,7 @@
 	int flags, fd;
 	mode_t mode;
 	const char *flagstr;
+	struct fd_handle *fh;
 
 	mode = 00400;
 
@@ -286,7 +287,9 @@
 
 	vfs->files[fd] = SMB_MALLOC_P(struct files_struct);
 	vfs->files[fd]->fsp_name = SMB_STRDUP(argv[1]);
-	vfs->files[fd]->fh->fd = fd;
+	fh = SMB_MALLOC_P(struct fd_handle);
+	fh->fd = fd;
+	vfs->files[fd]->fh = fh;
 	vfs->files[fd]->conn = vfs->conn;
 	printf("open: fd=%d\n", fd);
 	return NT_STATUS_OK;
@@ -345,6 +348,7 @@
 		printf("close: ok\n");
 
 	SAFE_FREE(vfs->files[fd]->fsp_name);
+	SAFE_FREE(vfs->files[fd]->fh);
 	SAFE_FREE(vfs->files[fd]);
 	vfs->files[fd] = NULL;
 	return NT_STATUS_OK;


More information about the samba-technical mailing list