[Spice-devel] [spice-xpi 1/4] Move secure channel fixup to secure channel setter

Hans de Goede hdegoede at redhat.com
Tue Apr 3 12:29:34 PDT 2012


All 4 patches look good, ACK series

On 04/03/2012 04:38 PM, Christophe Fergeau wrote:
> The secure channel names need to be fixed for compatibility with
> older spice versions. However, it's better to do it directly when
> m_secure_channels is set rather than waiting until its first use
> ---
>   SpiceXPI/src/plugin/plugin.cpp |   29 ++++++++++++++---------------
>   1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
> index e3e6e80..04d272b 100644
> --- a/SpiceXPI/src/plugin/plugin.cpp
> +++ b/SpiceXPI/src/plugin/plugin.cpp
> @@ -329,6 +329,20 @@ char *nsPluginInstance::GetSSLChannels() const
>   void nsPluginInstance::SetSSLChannels(const char *aSSLChannels)
>   {
>       m_ssl_channels = aSSLChannels;
> +
> +    /*
> +     * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
> +     * RHEL5 uses 'smain' and 'sinpusts
> +     * RHEL6 uses 'main'  and 'inputs'
> +     */
> +    std::size_t found = 0;
> +    while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
> +        m_ssl_channels.replace(found, 5, "main");
> +
> +    found = 0;
> +    while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
> +        m_ssl_channels.replace(found, 7, "inputs");
> +    /* HACK */
>   }
>
>   //* attribute string TrustStore; */
> @@ -695,21 +709,6 @@ void nsPluginInstance::Connect()
>           SendBool(CONTROLLER_ENABLE_USB, m_usb_redir);
>           SendBool(CONTROLLER_ENABLE_USB_AUTOSHARE, m_usb_auto_share);
>           SendStr(CONTROLLER_USB_FILTER, m_usb_filter.c_str());
> -
> -        /*
> -         * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
> -         * RHEL5 uses 'smain' and 'sinpusts
> -         * RHEL6 uses 'main'  and 'inputs'
> -         */
> -        std::size_t found = 0;
> -        while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
> -            m_ssl_channels.replace(found, 5, "main");
> -
> -        found = 0;
> -        while ((found = m_ssl_channels.find("sinputs", found)) != std::string::npos)
> -            m_ssl_channels.replace(found, 7, "inputs");
> -        /* HACK */
> -
>           SendStr(CONTROLLER_SECURE_CHANNELS, m_ssl_channels.c_str());
>           SendStr(CONTROLLER_CA_FILE, m_trust_store_file.c_str());
>           SendStr(CONTROLLER_HOST_SUBJECT, m_host_subject.c_str());


More information about the Spice-devel mailing list