Re: [Spice-Gtk] SpiceSession: Create webdav even with NULL shared_dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

El lun, 06-05-2019 a las 10:37 +0000, Victor Toso escribió:
Hi,

On Fri, May 03, 2019 at 06:52:00PM +0200, Javier Celaya wrote:
A phodav server created with a NULL shared dir is valid and
results in an error answer to all requests of the webdav channel,
instead of silently ignoring them.

This is better than just returning NULL from
spice_session_get_webdav_server because:
a) it crashes channel_webdav.c:start_client.

Can you give some steps on how to reproduce? I was trying with
remote-viewer on F29 guest earlier and couldn't.

You cannot just try an existing client, this problem happened as we are developing our new client for flexVDI. You will have to modify some of the source code for remote-viewer to see it.

The thing is, if you do not set the shared-dir property of the SpiceSession object, it default to the XDG public directory. This happens if you do not pass the "shared-dir" command line option, for instance. But how do I say "I do not want to share any directory with the guest"? I can set the shared-dir property to a file, or a non-existing directory, and the guest just complaints when I try to access it through webdavd. However, this does not seem a good solution... Setting the property to NULL, on the other hand, seems a reasonable value for "share nothing", but it makes spice_session_get_webdav_server return NULL and start_client crashes.

Unless I missed something and there is some way of making remote-viewer share nothing... then we can just use that way.

b) even if it did not crash, access to the shared dir from the guest
   would fail by timeout instead of immediately notifying of an error.

Is that on windows as guest?

Yes, I tested it on Windows as guest. I tried to fix a) by just returning early from start_client if spice_session_get_webdav_server returned NULL, but then all requests made by spice-webdavd are silently ignored. There is a webdav channel but no webdav server... so I imagine spice-webdavd on Linux will get the same result.


I spent some time looking at the code, found small issue and
added a checks on start_client(). Still, I don't see why we
should accept a webdav server running on NULL instead of only in
a valid folder but I'm also interested in fixing (a) and (b) if
possible.

As I explained before (maybe that should go in the commit message too) I wanted a way of sharing no directory at all. Passing NULL as shared-dir property seems like a good value, but you tell me if there is a better way.

Best regards


Cheers,

---
 src/spice-session.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/spice-session.c b/src/spice-session.c
index 04ba124..cbcd8c4 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -2813,10 +2813,6 @@ PhodavServer* spice_session_get_webdav_server(SpiceSession *session)
     static GMutex mutex;
 
     const gchar *shared_dir = spice_session_get_shared_dir(session);
-    if (shared_dir == NULL) {
-        SPICE_DEBUG("No shared dir set, not creating webdav server");
-        return NULL;
-    }
 
     g_mutex_lock(&mutex);
 
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx

https://lists.freedesktop.org/mailman/listinfo/spice-devel

-- 


flexVDI

Javier Celaya Alastrué

Chief Technology Officer

email javier.celaya@xxxxxxxxxxx

Phone +34696969959

Skype j_celaya

Legal Legal Information and Privacy Policy

Política de confidencialidad

Este mensaje y los ficheros anexos son confidenciales dirigiéndose exclusivamente al destinatario mencionado en el encabezamiento. Si usted ha recibido este correo por error, tenga la amabilidad de eliminarlo de su sistema y no divulgar el contenido a terceros. Los datos personales facilitados por usted o por terceros serán tratados por FLEXIBLE SOFTWARE SOLUTIONS S.L.U. con la finalidad de gestionar y mantener los contactos y relaciones que se produzcan como consecuencia de la relación que mantiene con FLEXIBLE SOFTWARE SOLUTIONS S.L.U. Normalmente, la base jurídica que legitima este tratamiento, será su consentimiento, el interés legítimo o la necesidad para gestionar una relación contractual o similar. El plazo de conservación de sus datos vendrá determinado por la relación que mantiene con nosotros. Para más información al respecto, o para ejercer sus derechos de acceso, rectificación, supresión, oposición, limitación o portabilidad, dirija una comunicación por escrito a FLEXIBLE SOFTWARE SOLUTIONS S.L.U: Avenida de Ranillas 1D, Planta 3, Oficina 3G, Zaragoza o al correo electrónico pdo@xxxxxxxxxxx. En caso de considerar vulnerado su derecho a la protección de datos personales, podrá interponer una reclamación ante la Agencia Española de Protección de Datos (www.agpd.es).

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]