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

Victor Toso victortoso at redhat.com
Mon May 6 10:37:44 UTC 2019


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.

> 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?

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.

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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190506/003ac9e8/attachment.sig>


More information about the Spice-devel mailing list