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.
This commit is contained in:
tron 2011-07-09 17:16:46 +00:00
parent 9c4afb0ddd
commit c15a9046d9
1 changed files with 5 additions and 5 deletions

View File

@ -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_new(struct fuse_chan *fc, struct fuse_args *args,
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 @@ fuse_new(struct fuse_chan *fc, struct fuse_args *args,
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);