Module Name:    src
Committed By:   tron
Date:           Sat Jul  9 17:16:46 UTC 2011

Modified Files:
        src/lib/librefuse: refuse.c

Log Message:
Call the FUSE init operation before we try to access the file-system.
This prevents a crash in "fuse_ext2" which I previously worked around
with a patch.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/lib/librefuse/refuse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librefuse/refuse.c
diff -u src/lib/librefuse/refuse.c:1.93 src/lib/librefuse/refuse.c:1.94
--- src/lib/librefuse/refuse.c:1.93	Sat Jul  9 14:50:00 2011
+++ src/lib/librefuse/refuse.c	Sat Jul  9 17:16:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: refuse.c,v 1.93 2011/07/09 14:50:00 tron Exp $	*/
+/*	$NetBSD: refuse.c,v 1.94 2011/07/09 17:16:46 tron Exp $	*/
 
 /*
  * Copyright © 2007 Alistair Crooks.  All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: refuse.c,v 1.93 2011/07/09 14:50:00 tron Exp $");
+__RCSID("$NetBSD: refuse.c,v 1.94 2011/07/09 17:16:46 tron Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -1298,6 +1298,9 @@
 
 	fuse->fc = fc;
 
+	if (fuse->op.init != NULL)
+		fusectx->private_data = fuse->op.init(NULL); /* XXX */
+
 	/* initialise the puffs operations structure */
         PUFFSOP_INIT(pops);
 
@@ -1361,9 +1364,6 @@
 			puffs_stat2vattr(&pn_root->pn_va, &st);
 	assert(pn_root->pn_va.va_type == VDIR);
 
-	if (fuse->op.init)
-		fusectx->private_data = fuse->op.init(NULL); /* XXX */
-
 	puffs_set_prepost(pu, set_fuse_context_pid, NULL);
 
 	puffs_zerostatvfs(&svfsb);

Reply via email to