+backward image iochannel over CORBA transport to be sandboxable
[captive.git] / src / libcaptive / storage / size.c
index f1a80c2..7dfbbe7 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "captive/storage.h"   /* self */
 #include "../client/giochannel-blind.h"        /* for captive_giochannel_blind_get_size() */
+#include "../sandbox/client-CaptiveIOChannel.h"        /* for captive_io_channel_get_size() */
 #include <glib/gmessages.h>
 #include <glib/gtypes.h>
 #include <fcntl.h>
@@ -46,6 +47,19 @@ guint64 r;
 }
 
 
+static guint64 size_sandbox(GIOChannel *iochannel)
+{
+guint64 r;
+
+       g_return_val_if_fail(iochannel!=NULL,0);
+
+       if (!captive_io_channel_get_size(iochannel,&r))
+               return 0;
+
+       return r;
+}
+
+
 static GIOChannel *iochannel_null;
 
 static int iounixchannel_get_fd(GIOChannel *iochannel)
@@ -197,6 +211,8 @@ guint64 r;
 
        if ((r=size_blind(iochannel)))
                return r;
+       if ((r=size_sandbox(iochannel)))
+               return r;
        if ((r=size_ioctl(iochannel)))
                return r;
        if ((r=size_seek(iochannel)))