#include "vfs.h" /* self-priv */
#include <glib/gmessages.h>
#include "captive/macros.h"
-#include "captive/sandbox.h"
#include "init.h"
+#include "captive/parent-Vfs.h"
+#include "../sandbox/server-Vfs.h" /* for captive_corba_child_options */
static gpointer captive_vfs_object_parent_class=NULL;
static void captive_vfs_object_finalize(CaptiveVfsObject *captive_vfs_object)
{
-GnomeVFSResult errvfsresult;
-
g_return_if_fail(captive_vfs_object!=NULL);
- errvfsresult=captive_vfs_close(captive_vfs_object);
- g_assert(errvfsresult==GNOME_VFS_OK);
+ captive_vfs_close(captive_vfs_object); /* errors ignored */
G_OBJECT_CLASS(captive_vfs_object_parent_class)->finalize((GObject *)captive_vfs_object);
}
captive_options_copy(&captive_vfs_object->options,options);
+ *captive_vfs_object_return=captive_vfs_object;
+
+ /* We are sandboxing && we are the master */
+ if (options->sandbox && !captive_corba_child_options)
+ return captive_sandbox_parent_vfs_new(captive_vfs_object);
+
g_assert(captive_options==NULL);
captive_options=&captive_vfs_object->options;
errbool=captive_init();
g_assert(errbool==TRUE);
- *captive_vfs_object_return=captive_vfs_object;
return GNOME_VFS_OK;
}
{
gboolean errbool;
- if (CAPTIVE_IS_SANDBOX_PARENT())
- return captive_sandbox_parent_vfs_close(captive_vfs_object);
-
g_return_val_if_fail(captive_vfs_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
+ if (captive_vfs_object->is_sandbox_parent)
+ return captive_sandbox_parent_vfs_close(captive_vfs_object);
+
g_assert(captive_options==&captive_vfs_object->options);
errbool=captive_shutdown();
g_assert(errbool==TRUE);