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

Submitted by Javier Celaya on May 3, 2019, 4:52 p.m.


Message ID 20190503165200.24328-1-javier.celaya@flexvdi.com
State New
Headers show
Series "SpiceSession: Create webdav even with NULL shared_dir" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Javier Celaya May 3, 2019, 4:52 p.m.
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.
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.
 src/spice-session.c | 4 ----
 1 file changed, 4 deletions(-)

Patch hide | download patch | download mbox

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;
-    }